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

# Select a CTA

> Returns the CTA text and destination URL for the same query context as the search response.

<Note>
  Call this after you create the `requestId` for the user action. The response
  returns CTA text and a target URL for the same context.
</Note>


## OpenAPI

````yaml api-reference/openapi-latest.json POST /api/v1/cta-selection
openapi: 3.1.0
info:
  title: Webless API
  description: >-
    Reference for the latest Webless API surface. New integrations should use
    the /api/v1 endpoints.
  version: v1
servers:
  - url: https://api.webless.ai
    description: Production Search API
security: []
paths:
  /api/v1/cta-selection:
    post:
      tags:
        - Search API
      summary: Select a CTA
      description: >-
        Returns the CTA text and destination URL for the same query context as
        the search response.
      operationId: createCtaSelectionV1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1DynamicCtaRequest'
            examples:
              default:
                value:
                  query: What does Webless do?
                  company: YOUR_COMPANY
                  requestId: 1f7c5f74-7b9e-4a0a-9b7d-4e3e2a5e3b60
                  sessionId: a1c2d3e4-1111-2222-3333-444455556666
                  version: published
      responses:
        '200':
          description: CTA result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DynamicCtaResponse'
        '422':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
components:
  schemas:
    V1DynamicCtaRequest:
      type: object
      required:
        - query
      properties:
        query:
          type: string
          example: What does Webless do?
        company:
          type: string
          default: sigma
          example: YOUR_COMPANY
        version:
          $ref: '#/components/schemas/V1RuntimeVersion'
        requestId:
          type: string
          example: 1f7c5f74-7b9e-4a0a-9b7d-4e3e2a5e3b60
        sessionId:
          type: string
          example: a1c2d3e4-1111-2222-3333-444455556666
        is_private_session:
          type: boolean
          default: false
    DynamicCtaResponse:
      type: object
      properties:
        text:
          type: string
        url:
          type: string
          format: uri
        open_type:
          type: string
          description: >-
            Determines how the CTA URL should be opened. `self` opens in the
            same tab, `blank` opens in a new tab, and `form` triggers an in-page
            form interaction.
          enum:
            - self
            - form
            - blank
      additionalProperties: true
    ValidationErrorResponse:
      type: object
      properties:
        detail:
          type: array
          items:
            type: object
            additionalProperties: true
    V1RuntimeVersion:
      type: string
      enum:
        - published
        - unpublished
      default: published
      description: >-
        Runtime package pointer. Omit this field or use `published` for
        production traffic. Use `unpublished` only when testing an unpublished
        runtime package.

````