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

# Get a published ContactButton Agent



## OpenAPI

````yaml /openapi.yaml get /public/agents/{agent}
openapi: 3.1.0
info:
  title: Contact Button API
  version: 1.0.0-alpha.1
  description: >
    API-first management and public agent actions for Contact Buttons and
    button.contact pages.

    API v1 is the first public contract. Existing private legacy API and browser
    workflows remain supported.
  contact:
    name: Contact Button
    url: https://learn.contactbutton.com
servers:
  - url: https://api.contactbutton.com/v1
    description: Production (canonical)
  - url: https://app.contactbutton.com/v1
    description: Backwards-compatible application-domain alias
security:
  - bearerAuth: []
tags:
  - name: Onboarding
    description: Human-verified agent onboarding.
  - name: Workspaces
  - name: Team
  - name: Pages
  - name: Agents
    description: Workspace Agent profile and behavior configuration.
  - name: Domains
  - name: Buttons
  - name: Forms
  - name: Surveys
  - name: Apps
  - name: Knowledge
  - name: Booking
  - name: Telephony
    description: >-
      Bring-your-own-Telnyx setup, call flows, phone numbers, and voice
      interactions.
  - name: Reviews
    description: >-
      Send consented review requests through workspace-owned email, SMS, and
      WhatsApp channels.
  - name: Commerce
  - name: Conversations
    description: >-
      Contact-centric threads and messages across chat, email, WhatsApp, and
      forms.
  - name: Engagement inbox
  - name: Public actions
    description: Public, rate-limited actions that may require human confirmation.
paths:
  /public/agents/{agent}:
    get:
      tags:
        - Conversations
      summary: Get a published ContactButton Agent
      operationId: getPublicAgent
      parameters:
        - $ref: '#/components/parameters/PublicAgent'
        - name: app
          in: query
          description: >-
            Optional published Agent Chat App UUID used to resolve
            assignment-level presentation overrides.
          schema:
            type: string
            format: uuid
        - name: button
          in: query
          description: >-
            Optional active Button UUID. When app is supplied, the App must be
            attached to this Button.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: >-
            Published Agent metadata and the effective first-interaction
            presentation for this context.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    $ref: '#/components/schemas/PublicAgentManifest'
                  meta:
                    type: object
      security: []
components:
  parameters:
    PublicAgent:
      name: agent
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    PublicAgentManifest:
      type: object
      required:
        - id
        - name
        - welcome_message
        - presentation
        - human_handoff_available
        - is_online
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        welcome_message:
          type: string
          description: Compatibility alias for presentation.welcome_message.
        presentation:
          $ref: '#/components/schemas/PublicAgentPresentation'
        human_handoff_available:
          type: boolean
        is_online:
          type: boolean
        language:
          type: string
        requires_contact:
          type: boolean
        requires_email:
          type: boolean
        lead_capture:
          $ref: '#/components/schemas/AgentLeadCaptureState'
        profile:
          type: object
          additionalProperties: true
        protocol_contract:
          $ref: '#/components/schemas/AgentProtocolContract'
    PublicAgentPresentation:
      type: object
      required:
        - welcome_message
        - suggested_replies
        - footer
        - appearance
        - sources
      properties:
        welcome_message:
          type: string
        suggested_replies:
          type: array
          maxItems: 6
          items:
            $ref: '#/components/schemas/PublicSuggestedReply'
        footer:
          type: object
          required:
            - enabled
            - html
            - text
          properties:
            enabled:
              type: boolean
            html:
              type:
                - string
                - 'null'
              description: Sanitized display HTML.
            text:
              type:
                - string
                - 'null'
              description: Plain-text equivalent for non-HTML clients.
        appearance:
          $ref: '#/components/schemas/PublicAgentAppearance'
        sources:
          type: object
          required:
            - welcome_message
            - suggested_replies
            - footer
            - appearance
          properties:
            welcome_message:
              type: string
              enum:
                - agent
                - assignment
            suggested_replies:
              type: string
              enum:
                - agent
                - assignment
            footer:
              type: string
              enum:
                - agent
                - assignment
            appearance:
              type: string
              enum:
                - legacy
                - agent
    AgentLeadCaptureState:
      type: object
      required:
        - version
        - timing
        - fields
        - contact_requirement
        - state
        - input_schema
      properties:
        version:
          type: integer
          enum:
            - 1
        timing:
          type: string
          enum:
            - required_before_chat
            - optional_before_chat
            - before_first_answer
            - after_first_reply
        fields:
          type: array
          items:
            type: string
            enum:
              - name
              - email
              - phone
              - consent
        contact_requirement:
          type: string
          enum:
            - either
            - email
            - phone
            - both
        default_phone_country:
          type: string
        request_message:
          type: string
          maxLength: 500
        success_with_name:
          type: string
          maxLength: 500
        success_without_name:
          type: string
          maxLength: 500
        requires_consent:
          type: boolean
        consent_text:
          type: string
          maxLength: 1000
        privacy_url:
          type:
            - string
            - 'null'
          format: uri
        state:
          type: string
          enum:
            - ready
            - optional
            - deferred
            - input_requested
            - input_required
            - complete
        captured:
          type: boolean
        success_message:
          type:
            - string
            - 'null'
        input_schema:
          type: object
          additionalProperties: true
    AgentProtocolContract:
      type: object
      required:
        - version
        - protocol
        - states
        - review
      properties:
        version:
          type: string
          enum:
            - '2026-08-05'
        protocol:
          type: string
          enum:
            - web
            - rest
            - mcp
            - a2a
        states:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        review:
          type: object
          required:
            - contactbutton_owned
            - external_client_can_approve
            - external_client_receives_otp
            - material_actions_require_verification
          properties:
            contactbutton_owned:
              type: boolean
            external_client_can_approve:
              type: boolean
            external_client_receives_otp:
              type: boolean
              enum:
                - false
            material_actions_require_verification:
              type: boolean
    PublicSuggestedReply:
      type: object
      description: >-
        Safe visitor-facing shortcut. The server-owned message and analytics
        label are intentionally omitted.
      required:
        - id
        - label
        - featured
        - operation
        - kind
        - action
      properties:
        id:
          type: string
          format: uuid
        label:
          type: string
          maxLength: 120
        featured:
          type: boolean
        operation:
          type: string
          enum:
            - message
            - request_human
        kind:
          type: string
        action:
          $ref: '#/components/schemas/SuggestedReplyAction'
    PublicAgentAppearance:
      type: object
      required:
        - theme
        - accent
        - avatar
        - caption
        - header_pattern
        - show_powered_by
        - tokens
        - source
      description: >-
        Presentation-only Agent defaults. Values are bounded presets and safe
        color tokens; placement and session policy remain canonical
        ContactButton settings.
      properties:
        theme:
          type: string
          enum:
            - light
            - light_accent
            - light_soft
            - dark
        accent:
          type: string
          enum:
            - inherit
            - indigo
            - blue
            - green
            - orange
            - rose
            - graphite
        avatar:
          type: string
          enum:
            - initials
            - sparkles
            - support
            - sales
        caption:
          type: string
          maxLength: 160
        header_pattern:
          type: boolean
        show_powered_by:
          type: boolean
        source:
          type: string
          enum:
            - legacy
            - agent
        tokens:
          type: object
          required:
            - primary
            - secondary
            - ink
            - muted
            - line
            - surface
            - panel
            - page_start
            - page_end
            - assistant
          additionalProperties: false
          properties:
            primary:
              $ref: '#/components/schemas/SafeHexColor'
            secondary:
              $ref: '#/components/schemas/SafeHexColor'
            ink:
              $ref: '#/components/schemas/SafeHexColor'
            muted:
              $ref: '#/components/schemas/SafeHexColor'
            line:
              $ref: '#/components/schemas/SafeHexColor'
            surface:
              $ref: '#/components/schemas/SafeHexColor'
            panel:
              $ref: '#/components/schemas/SafeHexColor'
            page_start:
              $ref: '#/components/schemas/SafeHexColor'
            page_end:
              $ref: '#/components/schemas/SafeHexColor'
            assistant:
              $ref: '#/components/schemas/SafeHexColor'
    SuggestedReplyAction:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - native_chat
            - request_human
            - url
            - app_widget
            - popup
        target:
          type:
            - string
            - 'null'
          description: >-
            An http(s), tel, or mailto URL; an installed app public ID; or a
            popup external ID, depending on type.
        new_tab:
          type: boolean
          default: false
          description: Applies only to http(s) URL actions.
    SafeHexColor:
      type: string
      pattern: ^#[0-9a-fA-F]{6}$
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Sanctum personal access token or OAuth 2.0 access token
      description: >
        A Contact Button scoped bearer key. Send `Authorization: Bearer
        <token>`.

        Token abilities are enforced independently of workspace membership; both
        checks must pass.

        Interactive MCP clients use registered OAuth applications, Authorization
        Code + PKCE,

        audience-bound tokens, and explicit workspace grants. Personal Sanctum
        tokens remain supported.
      x-contact-button-token-abilities:
        workspaces:read: Read workspaces, teams, domains, settings, and connections.
        workspaces:write: >-
          Create and manage workspaces, teams, domains, settings, and
          connections.
        content:read: Read buttons, forms, lists, pages, booking types, and knowledge.
        content:write: Create, update, publish, and remove content.
        engagements:read: >-
          Read submissions, subscribers, bookings, callbacks, calls, reviews,
          and conversations.
        engagements:manage: Reply to and manage engagement records.
        actions:request: Request protected actions that can still require human confirmation.

````