Pre-launch API. The concepts described here are settled, but the API shape is not: request and response fields, parameters and defaults can still change. Build against it, and talk to your Luigi's Box contact before you put an integration into production.
const url = 'https://api.eu1.luigisbox.ai/platform/v1/banners/example';const options = { method: 'PATCH', headers: { 'If-Match': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"html":"example","metadata":{"additionalProperty":"example"},"name":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.eu1.luigisbox.ai/platform/v1/banners/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'If-Match: example' \ --data '{ "html": "example", "metadata": { "additionalProperty": "example" }, "name": "example" }'Change the fields sent; null clears html or metadata, but the banner must keep one of them. Images sent in a multipart/form-data request are added, or replace the banner’s images of the same name, keeping their ids; the banner keeps only the images its html names. Sending html needs platform:banner:script. An archived banner cannot be updated. A request that names no field and carries no image is a 422 with error_code entity_change_empty. Every change gives the banner a new version.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The banner’s id, lbbn_ followed by six characters.
The banner’s id, lbbn_ followed by six characters.
Header Parameters
Section titled “Header Parameters”The version of the resource the change is based on, a positive integer in double quotes, e.g. "42". Missing or * is a 428; any other value is a 422 with validation_errors[].type entity_version_malformed.
Request Bodyrequired
Section titled “Request Bodyrequired”Partial update (JSON Merge Patch). Only fields present in the request are applied.
organization_id is immutable and not accepted. The banner left after the update must
still hold html or metadata. An archived banner cannot be updated.
object
The banner as HTML markup, served as written at its own URL, scripts included. Setting it needs the platform:banner:script permission. At most 64 KB in UTF-8; a larger one is rejected with the validation error type banner_html_too_large. A banner holds html, metadata or both; one without either is rejected with banner_content_required. It refers to the banner’s images as lbx-image:<name>, e.g. <img src="lbx-image:hero.jpg">; a name without an image is rejected with banner_image_not_found. null clears it.
Metadata of the banner, a flat key-value object for the client’s own code, e.g. {"headline": "Nike -30 %", "image_url": "https://…", "target_url": "https://…"}. At most 20 keys of 1 to 64 characters from A-Z a-z 0-9 _ . : -. A value is a string of at most 2048 characters, a number or a boolean; an integer outside ±9007199254740991 is rejected with banner_metadata_integer_out_of_range. At most 64 KB in total as compact JSON in UTF-8 (banner_metadata_too_large). A string with a control character, invisible mark or bidirectional override is rejected with banner_metadata_value_unprintable, and one a browser would read as a javascript:, vbscript: or data: URL with banner_metadata_value_unsafe_url. Values are returned as written: escape them before putting them into markup. Replaced whole, never merged key by key; null clears it.
Name of the banner, unique among the organization’s banners that are not archived.
Example generated
{ "html": "example", "metadata": { "additionalProperty": "example" }, "name": "example"}object
The same body as the JSON request.
object
The banner as HTML markup, served as written at its own URL, scripts included. Setting it needs the platform:banner:script permission. At most 64 KB in UTF-8; a larger one is rejected with the validation error type banner_html_too_large. A banner holds html, metadata or both; one without either is rejected with banner_content_required. It refers to the banner’s images as lbx-image:<name>, e.g. <img src="lbx-image:hero.jpg">; a name without an image is rejected with banner_image_not_found. null clears it.
Metadata of the banner, a flat key-value object for the client’s own code, e.g. {"headline": "Nike -30 %", "image_url": "https://…", "target_url": "https://…"}. At most 20 keys of 1 to 64 characters from A-Z a-z 0-9 _ . : -. A value is a string of at most 2048 characters, a number or a boolean; an integer outside ±9007199254740991 is rejected with banner_metadata_integer_out_of_range. At most 64 KB in total as compact JSON in UTF-8 (banner_metadata_too_large). A string with a control character, invisible mark or bidirectional override is rejected with banner_metadata_value_unprintable, and one a browser would read as a javascript:, vbscript: or data: URL with banner_metadata_value_unsafe_url. Values are returned as written: escape them before putting them into markup. Replaced whole, never merged key by key; null clears it.
Name of the banner, unique among the organization’s banners that are not archived.
Image files, each named by its part’s filename, a name the html must refer to. An image named like one the banner already has replaces it.
Responses
Section titled “Responses”Successful Response
Promotional content an organization shows on its results pages, as html, metadata or both.
object
When the banner was created.
The banner as HTML markup, served as written at its own URL, scripts included. Setting it needs the platform:banner:script permission. At most 64 KB in UTF-8; a larger one is rejected with the validation error type banner_html_too_large. A banner holds html, metadata or both; one without either is rejected with banner_content_required. It refers to the banner’s images as lbx-image:<name>, e.g. <img src="lbx-image:hero.jpg">; a name without an image is rejected with banner_image_not_found.
Banner id, lbbn_ followed by six characters.
The images the html refers to, by name. At most 10 per banner, each a JPEG, PNG, GIF or WebP file of at most 1 MB and 4096 × 4096 pixels. They are uploaded as images parts of a multipart/form-data create or update, each named by the filename of its part, which the client chooses: 1 to 64 characters from A-Z a-z 0-9 _ . -. An upload the html does not name is rejected with banner_image_unused. The banner keeps only the images its html names, so html that stops naming an image removes it; a removed image stays served at its URL until the banner is archived. Ordered by name.
An image stored with a banner, which its html refers to by name.
object
The image’s media type, read from its bytes.
When the image was uploaded.
The image’s height in pixels.
Image id, kept when an upload replaces it.
The image’s name within the banner, the file name it was uploaded under.
The image’s size in bytes.
The public URL the image is served at.
The image’s width in pixels.
Metadata of the banner, a flat key-value object for the client’s own code, e.g. {"headline": "Nike -30 %", "image_url": "https://…", "target_url": "https://…"}. At most 20 keys of 1 to 64 characters from A-Z a-z 0-9 _ . : -. A value is a string of at most 2048 characters, a number or a boolean; an integer outside ±9007199254740991 is rejected with banner_metadata_integer_out_of_range. At most 64 KB in total as compact JSON in UTF-8 (banner_metadata_too_large). A string with a control character, invisible mark or bidirectional override is rejected with banner_metadata_value_unprintable, and one a browser would read as a javascript:, vbscript: or data: URL with banner_metadata_value_unsafe_url. Values are returned as written: escape them before putting them into markup.
Name of the banner, unique among the organization’s banners that are not archived.
The organization the banner belongs to.
archived is terminal: an archived banner cannot be updated.
When the banner was last changed.
The banner’s version, an opaque value that changes on every change to the banner. An update or archive names the version it is based on in If-Match, as "<version>".
Example
{ "images": [ { "content_type": "image/jpeg" } ], "status": "active"}Headers
Section titled “Headers”The resource’s version in double quotes, e.g. "42". Send it back in If-Match.
Malformed request
Canonical error body — every non-2xx response uses this shape.
object
Machine-readable error context; empty object when there is nothing to add.
object
Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.
Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.
One field-level reason a request was rejected.
object
Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].
What is wrong with the value at loc.
Stable machine code for the problem, e.g. missing or string_too_short.
Human-readable, actionable error message.
Example generated
{ "exception_details": { "error_code": "example", "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example"}Missing or invalid credentials
Canonical error body — every non-2xx response uses this shape.
object
Machine-readable error context; empty object when there is nothing to add.
object
Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.
Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.
One field-level reason a request was rejected.
object
Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].
What is wrong with the value at loc.
Stable machine code for the problem, e.g. missing or string_too_short.
Human-readable, actionable error message.
Example generated
{ "exception_details": { "error_code": "example", "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example"}Authenticated but not permitted
Canonical error body — every non-2xx response uses this shape.
object
Machine-readable error context; empty object when there is nothing to add.
object
Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.
Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.
One field-level reason a request was rejected.
object
Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].
What is wrong with the value at loc.
Stable machine code for the problem, e.g. missing or string_too_short.
Human-readable, actionable error message.
Example generated
{ "exception_details": { "error_code": "example", "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example"}Resource not found
Canonical error body — every non-2xx response uses this shape.
object
Machine-readable error context; empty object when there is nothing to add.
object
Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.
Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.
One field-level reason a request was rejected.
object
Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].
What is wrong with the value at loc.
Stable machine code for the problem, e.g. missing or string_too_short.
Human-readable, actionable error message.
Example generated
{ "exception_details": { "error_code": "example", "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example"}The banner is archived, or a banner that is not archived already has the name.
The canonical error body of a refused banner write, with error_code typed.
object
The exception_details of a refused banner write, naming why it was refused.
object
On banner_in_use, the campaigns that are not archived and show the banner.
Why the write was refused.
Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.
One field-level reason a request was rejected.
object
Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].
What is wrong with the value at loc.
Stable machine code for the problem, e.g. missing or string_too_short.
Human-readable, actionable error message.
Example
{ "exception_details": { "error_code": "banner_name_taken" }}Version not current
The canonical error body of a 412, with exception_details typed.
object
Why the write was refused, and the entity’s current version.
object
The entity’s current version. Read the entity again, reapply the change and resend it.
The entity changed since the version the request was based on.
Human-readable, actionable error message.
Example
{ "exception_details": { "error_code": "entity_version_stale" }}Headers
Section titled “Headers”The resource’s version in double quotes, e.g. "42". Send it back in If-Match.
Request body too large
Canonical error body — every non-2xx response uses this shape.
object
Machine-readable error context; empty object when there is nothing to add.
object
Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.
Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.
One field-level reason a request was rejected.
object
Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].
What is wrong with the value at loc.
Stable machine code for the problem, e.g. missing or string_too_short.
Human-readable, actionable error message.
Example generated
{ "exception_details": { "error_code": "example", "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example"}Request validation failed. Each problem is listed in exception_details.validation_errors, under a typed code. A request that changes nothing has none listed.
The canonical error body of a banner write that failed field validation, its codes typed.
object
The exception_details of a banner write that failed field validation.
object
Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.
Every field-level problem found, each naming where in the body it sits.
One field-level reason a banner write was rejected, with its banner codes published.
object
Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].
What is wrong with the value at loc.
Stable machine code for the problem: one of the banner codes listed here, or a generic one such as missing or string_too_long.
The stable machine codes a rejected banner is reported under.
The stable machine codes a rejected banner image is reported under.
Human-readable, actionable error message.
The canonical error body of a 422 to a partial update, with exception_details typed.
object
The field-level problems found, or why a request with none was refused.
object
entity_change_empty when the request names no field to change and has no field-level problems. Absent when validation_errors says what failed.
Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.
One field-level reason a request was rejected.
object
Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].
What is wrong with the value at loc.
Stable machine code for the problem, e.g. missing or string_too_short.
Human-readable, actionable error message.
Example
{ "exception_details": { "validation_errors": [ { "type": "banner_content_required" } ] }}Version required
The canonical error body of a 428, with exception_details typed.
object
Why the write was refused.
object
The request’s If-Match named no version it was based on: it was absent or *.
Human-readable, actionable error message.
Example
{ "exception_details": { "error_code": "entity_version_required" }}Service temporarily unavailable
Canonical error body — every non-2xx response uses this shape.
object
Machine-readable error context; empty object when there is nothing to add.
object
Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.
Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.
One field-level reason a request was rejected.
object
Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].
What is wrong with the value at loc.
Stable machine code for the problem, e.g. missing or string_too_short.
Human-readable, actionable error message.
Example generated
{ "exception_details": { "error_code": "example", "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example"}Was this page helpful?
Thanks.