> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cludo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Banner

> Creates a banner. The server assigns `id`.



## OpenAPI

````yaml /openapi/search-tools.json post /api/banners
openapi: 3.1.0
info:
  title: Cludo Search Tools API
  version: 4.0.0
  description: >-
    Manage search experience tools: banners, rankings, quicklinks, and synonym
    groups for Cludo search engines.
servers:
  - url: https://api.cludo.com
    description: EU region (Customer IDs below 10,000,000)
  - url: https://api-us1.cludo.com
    description: US region (Customer IDs 10,000,000 and above)
security:
  - BasicAuth: []
paths:
  /api/banners:
    post:
      summary: Create Banner
      description: Creates a banner. The server assigns `id`.
      operationId: createBanner
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BannerCreate'
      responses:
        '201':
          description: Banner created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Banner'
        '400':
          description: >-
            The request body failed validation. Each key in the response is the
            JSON path of the offending field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BasicAuth: []
components:
  schemas:
    BannerCreate:
      type: object
      description: Banner payload without `id` (server assigns `id`).
      required:
        - name
        - htmlcode
        - websiteid
      properties:
        name:
          type: string
          description: Admin-facing name for the banner.
        htmlcode:
          type: string
          description: Markup to render; validate in staging before production.
        bannerterms:
          type: array
          items:
            $ref: '#/components/schemas/BannerTerm'
          description: >-
            Optional trigger list; omit for banners driven only by audience
            rules.
        websiteid:
          type: integer
          description: Must match the engine you are configuring.
        isDisabled:
          type: boolean
          description: Create in disabled state to review before go-live.
        from:
          type:
            - string
            - 'null'
          format: date-time
        to:
          type:
            - string
            - 'null'
          format: date-time
        audiences:
          type:
            - array
            - 'null'
          items: true
          description: >-
            Audience targeting configuration. Omit the field entirely (or send
            `null`) when the banner is not audience-targeted.
    Banner:
      type: object
      required:
        - name
        - htmlcode
        - websiteid
      properties:
        id:
          type: integer
          description: Banner ID (assigned by server on create).
        name:
          type: string
          description: Internal label in MyCludo (not shown to end users).
        htmlcode:
          type: string
          description: >-
            HTML snippet injected on the SERP when terms match (keep accessible
            and scoped).
        bannerterms:
          type: array
          items:
            $ref: '#/components/schemas/BannerTerm'
          description: >-
            List of trigger phrases; any match can activate the banner depending
            on engine rules.
        websiteid:
          type: integer
          description: Search engine ID.
        isDisabled:
          type: boolean
          description: When true, the banner is stored but never served.
        from:
          type:
            - string
            - 'null'
          format: date-time
          description: Start of scheduled display window.
        to:
          type:
            - string
            - 'null'
          format: date-time
          description: End of scheduled display window.
        audiences:
          type:
            - array
            - 'null'
          items: true
          description: >-
            Audience targeting configuration. Omit the field entirely (or send
            `null`) when the banner is not audience-targeted.
        engineIds:
          type:
            - array
            - 'null'
          items:
            type: integer
          description: Managed by the Cludo backend; informational only.
        frequency:
          type:
            - string
            - 'null'
          description: Managed by the Cludo backend; informational only.
        daysOfWeek:
          type:
            - string
            - 'null'
          description: Managed by the Cludo backend; informational only.
        cssCode:
          type:
            - string
            - 'null'
          description: Managed by the Cludo backend; informational only.
        jsonOption:
          type:
            - string
            - 'null'
          description: Managed by the Cludo backend; informational only.
        editorType:
          type:
            - string
            - 'null'
          description: Managed by the Cludo backend; informational only.
        brokenLinksFoundAt:
          type:
            - string
            - 'null'
          description: Timestamp when broken links were last detected, if any.
    ValidationErrorResponse:
      type: object
      description: >-
        Per-field validation errors. Each key is the JSON path of the offending
        property (using the controller parameter name as the root) and the value
        is an array of error messages for that field. May also include a
        `general` key for non-field-specific messages.
      additionalProperties:
        type: array
        items:
          type: string
      example:
        viewModel.pages[0]:
          - The Url field is required.
    BannerTerm:
      type: object
      required:
        - name
      additionalProperties: false
      properties:
        name:
          type: string
          description: >-
            Search term or phrase that triggers this banner when the user’s
            query matches.
    UnauthorizedError:
      type: object
      description: Returned when authentication fails.
      properties:
        message:
          type: string
          description: Authentication failure reason.
    ServerError:
      type: object
      description: Returned when an unexpected server error occurs.
      properties:
        status:
          type: string
          description: HTTP status name.
        code:
          type: integer
          description: HTTP status code.
        messages:
          type: array
          items:
            type: string
          description: Error details, usually including a support reference id.
  responses:
    Unauthorized:
      description: >-
        Authentication failed. The Authorization header is missing or contains
        invalid credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedError'
          example:
            message: unauthorized
    InternalServerError:
      description: >-
        An unexpected server error occurred. If this persists, contact
        support@cludo.com.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServerError'
          example:
            status: InternalServerError
            code: 500
            messages:
              - >-
                Error occur. Please contact support with error ID:
                a1b2c3d4-e5f6-7890-abcd-ef1234567890
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: >-
        Basic authentication. Use your Customer ID as the username and API Key
        as the password. Example header: `Authorization: Basic
        MTIzNDU2NzpteS1hcGkta2V5`.

````