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.

    Get a banner

    View source
    GET
    /platform/v1/banners/{banner_id}
    curl --request GET \
    --url https://api.eu1.luigisbox.ai/platform/v1/banners/example \
    --header 'Authorization: Bearer <token>'

    Get one banner, archived ones included. The response carries the banner’s version as its ETag. Send it back as If-None-Match to get a 304 with no body while the banner is unchanged.

    banner_id
    required
    Banner Id

    The banner’s id, lbbn_ followed by six characters.

    string

    The banner’s id, lbbn_ followed by six characters.

    If-None-Match
    If-None-Match
    string

    *, or the ETag the caller holds. Answered with 304 and no body for *, and for the current version where the resource sends an ETag.

    Successful Response

    Media typeapplication/json
    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

    Example

    {
    "images": [
    {
    "content_type": "image/jpeg"
    }
    ],
    "status": "active"
    }
    ETag
    string
    /^"[1-9][0-9]{0,18}"$/

    The resource’s version in double quotes, e.g. "42". Send it back in If-Match.

    Not modified: the version held is current

    ETag
    string
    /^"[1-9][0-9]{0,18}"$/

    The resource’s version in double quotes, e.g. "42". Send it back in If-Match.

    Malformed request

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

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

    Resource not found

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