Skip to content

    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.

    List banners

    View source
    GET
    /platform/v1/banners
    curl --request GET \
    --url 'https://api.eu1.luigisbox.ai/platform/v1/banners?page=1&size=20' \
    --header 'Authorization: Bearer <token>'

    List banners, ordered by id. Listing without organization_id spans every organization, which requires a grant that wide; name your organization instead. GET /platform/v1/me/entitlements returns the organizations your credentials reach, with their ids.

    organization_id
    Organization Id

    Only banners of this organization.

    Any of:
    string

    Only banners of this organization.

    status
    Status

    Keep only this status.

    Any of:
    BannerStatus

    Lifecycle state of a Banner. Archived is terminal.

    string
    Allowed values: active archived

    Keep only this status.

    page
    Page

    1-based page number.

    integer
    default: 1 >= 1 <= 10000

    1-based page number.

    size
    Size

    Number of items per page.

    integer
    default: 20 >= 1 <= 100

    Number of items per page.

    Successful Response

    Media typeapplication/json
    Page[Banner]
    object
    items
    required
    Items

    The items on this page.

    Array<object>
    Banner

    Promotional content an organization shows on its results pages, as html, metadata or both.

    object
    created_at
    required
    Created At

    When the banner was created.

    string format: date-time
    created_by
    required
    Created By

    The user who created the banner, if a user did.

    Any of:
    string
    html
    required
    Html

    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.

    Any of:
    string
    html_url
    required
    Html Url

    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.

    Any of:
    string
    id
    required
    Id

    Banner id, lbbn_ followed by six characters.

    string
    images
    required
    Images

    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.

    Array<object>
    BannerImage

    An image stored with a banner, which its html refers to by name.

    object
    content_type
    required
    ImageContentType

    The image’s media type, read from its bytes.

    string
    Allowed values: image/jpeg image/png image/gif image/webp
    created_at
    required
    Created At

    When the image was uploaded.

    string format: date-time
    height
    required
    Height

    The image’s height in pixels.

    integer
    id
    required
    Id

    Image id, kept when an upload replaces it.

    string format: uuid
    name
    required
    Name

    The image’s name within the banner, the file name it was uploaded under.

    string
    size_bytes
    required
    Size Bytes

    The image’s size in bytes.

    integer
    url
    required
    Url

    The public URL the image is served at.

    string
    width
    required
    Width

    The image’s width in pixels.

    integer
    metadata
    required
    Metadata

    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.

    Any of:
    object
    key
    additional properties
    Any of:
    string
    name
    required
    Name

    Name of the banner, unique among the organization’s banners that are not archived.

    string
    organization_id
    required
    Organization Id

    The organization the banner belongs to.

    string
    status
    required
    BannerStatus

    archived is terminal: an archived banner cannot be updated.

    string
    Allowed values: active archived
    updated_at
    required
    Updated At

    When the banner was last changed.

    string format: date-time
    updated_by
    required
    Updated By

    The user who last changed the banner, if a user did.

    Any of:
    string
    version
    required
    Version

    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>".

    integer format: int64
    >= 1
    page
    required
    Page

    1-based page number.

    integer
    size
    required
    Size

    Number of items per page.

    integer
    total
    required
    Total

    Total number of items across all pages.

    integer

    Example

    {
    "items": [
    {
    "images": [
    {
    "content_type": "image/jpeg"
    }
    ],
    "status": "active"
    }
    ]
    }

    Missing or invalid credentials

    Media typeapplication/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    error_code
    Error Code

    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.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Request Id

    Request correlation ID (matches the X-Request-Id response header).

    Any of:
    string

    Example generated

    {
    "exception_details": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Authenticated but not permitted

    Media typeapplication/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    error_code
    Error Code

    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.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Request Id

    Request correlation ID (matches the X-Request-Id response header).

    Any of:
    string

    Example generated

    {
    "exception_details": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Request validation failed

    Media typeapplication/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    error_code
    Error Code

    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.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Request Id

    Request correlation ID (matches the X-Request-Id response header).

    Any of:
    string

    Example generated

    {
    "exception_details": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Service temporarily unavailable

    Media typeapplication/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    error_code
    Error Code

    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.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Request Id

    Request correlation ID (matches the X-Request-Id response header).

    Any of:
    string

    Example generated

    {
    "exception_details": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }