# Create a banner `POST /platform/v1/banners` Authorized against the `organization_id` in the body: credentials granted on that organization are enough, while a grant on one of its catalogs is not. ## Request example ```bash curl --request POST \ --url 'https://api.eu1.luigisbox.ai/platform/v1/banners' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "html": "example", "metadata": { "additionalProperty": "example" }, "name": "example", "organization_id": "example" }' ``` ## Request Body **Required.** ### application/json Schema: `object` #### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `html` | `anyOf(string, null)` | No | 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:`, e.g. ``; a name without an image is rejected with `banner_image_not_found`. | — | | `metadata` | `anyOf(object, null)` | No | 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. | — | | `metadata.*` | `anyOf(string, boolean, integer, number)` | No | Additional property. | — | | `name` | `string` | Yes | Name of the banner, unique among the organization's banners that are not archived. | >= 1 characters; <= 256 characters | | `organization_id` | `string` | Yes | The organization the banner belongs to. | — | #### Request body example ```json { "html": "example", "metadata": { "additionalProperty": "example" }, "name": "example", "organization_id": "example" } ``` ### multipart/form-data Schema: `object` #### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `banner` | `object` | Yes | The same body as the JSON request. | — | | `banner.html` | `anyOf(string, null)` | No | 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:`, e.g. ``; a name without an image is rejected with `banner_image_not_found`. | — | | `banner.metadata` | `anyOf(object, null)` | No | 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. | — | | `banner.metadata.*` | `anyOf(string, boolean, integer, number)` | No | Additional property. | — | | `banner.name` | `string` | Yes | Name of the banner, unique among the organization's banners that are not archived. | >= 1 characters; <= 256 characters | | `banner.organization_id` | `string` | Yes | The organization the banner belongs to. | — | | `images` | `Array` | No | 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. | <= 10 items | #### Request body example ```json { "banner": { "html": "example", "metadata": { "additionalProperty": "example" }, "name": "example", "organization_id": "example" }, "images": [ "example" ] } ``` ## Responses | Status | Description | Content | |---|---|---| | `201` | Successful Response | application/json: Banner | | `401` | Missing or invalid credentials | application/json: ErrorResponse | | `403` | Authenticated but not permitted | application/json: ErrorResponse | | `409` | A banner of the organization that is not archived already has this name. | application/json: BannerConflictError | | `413` | Request body too large | application/json: ErrorResponse | | `422` | Request validation failed. Each problem is listed in `exception_details.validation_errors`, under a typed code. | application/json: anyOf(BannerValidationError, ErrorResponse) | | `503` | Service temporarily unavailable | application/json: ErrorResponse | ### 201 Successful Response #### application/json Schema: `Banner` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `created_at` | `string` | Yes | When the banner was created. | format: date-time | | `created_by` | `anyOf(string, null)` | Yes | The user who created the banner, if a user did. | — | | `html` | `anyOf(string, null)` | Yes | 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:`, e.g. ``; a name without an image is rejected with `banner_image_not_found`. | — | | `html_url` | `anyOf(string, null)` | Yes | The public URL the banner's `html` is hosted at, its image placeholders replaced with the images' URLs. Each change to the page gives a new URL. `null` when the banner has no html or is archived. | — | | `id` | `string` | Yes | Banner id, `lbbn_` followed by six characters. | — | | `images` | `Array` | Yes | 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. | — | | `images[].content_type` | `ImageContentType` | Yes | The image's media type, read from its bytes. | — | | `images[].created_at` | `string` | Yes | When the image was uploaded. | format: date-time | | `images[].height` | `integer` | Yes | The image's height in pixels. | — | | `images[].id` | `string` | Yes | Image id, kept when an upload replaces it. | format: uuid | | `images[].name` | `string` | Yes | The image's name within the banner, the file name it was uploaded under. | — | | `images[].size_bytes` | `integer` | Yes | The image's size in bytes. | — | | `images[].url` | `string` | Yes | The public URL the image is served at. | — | | `images[].width` | `integer` | Yes | The image's width in pixels. | — | | `metadata` | `anyOf(object, null)` | Yes | 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. | — | | `metadata.*` | `anyOf(string, boolean, integer, number)` | No | Additional property. | — | | `name` | `string` | Yes | Name of the banner, unique among the organization's banners that are not archived. | — | | `organization_id` | `string` | Yes | The organization the banner belongs to. | — | | `status` | `BannerStatus` | Yes | `archived` is terminal: an archived banner cannot be updated. | — | | `updated_at` | `string` | Yes | When the banner was last changed. | format: date-time | | `updated_by` | `anyOf(string, null)` | Yes | The user who last changed the banner, if a user did. | — | | `version` | `integer` | Yes | 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 `""`. | format: int64; >= 1 | ##### Response example ```json { "created_at": "2026-04-15T12:00:00Z", "created_by": "example", "html": "example", "html_url": "example", "id": "example", "images": [ { "content_type": "image/jpeg", "created_at": "2026-04-15T12:00:00Z", "height": 1, "id": "2489e9ad-2ee2-4e00-8ec9-32d5f69181c0", "name": "example", "size_bytes": 1, "url": "example", "width": 1 } ], "metadata": { "additionalProperty": "example" }, "name": "example", "organization_id": "example", "status": "active", "updated_at": "2026-04-15T12:00:00Z", "updated_by": "example", "version": 1 } ``` ### 401 Missing or invalid credentials #### application/json Schema: `ErrorResponse` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `ExceptionDetails` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.error_code` | `string` | No | 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. | — | | `exception_details.validation_errors` | `Array` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "error_code": "example", "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ``` ### 403 Authenticated but not permitted #### application/json Schema: `ErrorResponse` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `ExceptionDetails` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.error_code` | `string` | No | 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. | — | | `exception_details.validation_errors` | `Array` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "error_code": "example", "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ``` ### 409 A banner of the organization that is not archived already has this name. #### application/json Schema: `BannerConflictError` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `BannerConflictDetails` | Yes | The ``exception_details`` of a refused banner write, naming why it was refused. | — | | `exception_details.campaign_ids` | `Array` | No | On `banner_in_use`, the campaigns that are not archived and show the banner. | — | | `exception_details.error_code` | `BannerConflictCode` | Yes | Why the write was refused. | — | | `exception_details.validation_errors` | `Array` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "campaign_ids": [ "example" ], "error_code": "banner_name_taken", "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ``` ### 413 Request body too large #### application/json Schema: `ErrorResponse` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `ExceptionDetails` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.error_code` | `string` | No | 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. | — | | `exception_details.validation_errors` | `Array` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "error_code": "example", "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ``` ### 422 Request validation failed. Each problem is listed in `exception_details.validation_errors`, under a typed code. #### application/json Schema: `anyOf(BannerValidationError, ErrorResponse)` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `BannerValidationDetails` | Yes | The `exception_details` of a banner write that failed field validation. | — | | `exception_details.error_code` | `string` | No | 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. | — | | `exception_details.validation_errors` | `Array` | Yes | Every field-level problem found, each naming where in the body it sits. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `anyOf(BannerProblemCode, BannerImageProblemCode, string)` | Yes | Stable machine code for the problem: one of the banner codes listed here, or a generic one such as `missing` or `string_too_long`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "error_code": "example", "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "banner_content_required" } ] }, "reason": "example", "request_id": "example" } ``` ### 503 Service temporarily unavailable #### application/json Schema: `ErrorResponse` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `ExceptionDetails` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.error_code` | `string` | No | 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. | — | | `exception_details.validation_errors` | `Array` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "error_code": "example", "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ```