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

> ## Agent Instructions
> Bridge exposes three integration surfaces: the REST Integrations API for pushing data into Bridge, webhooks for receiving events from Bridge, and the public Lead Capture endpoint that a tenant's landing page posts to.
> The Integrations API host is https://api-connect-us.bridge.new and every request to it must be authenticated with the x-api-key header. Bridge does not use bearer tokens or OAuth.
> The Lead Capture endpoint is different and the Integrations API rules do not apply to it: it has its own host, it takes no x-api-key and no authentication header of any kind, and it is called from a visitor's browser. It is identified by a workspace id and a capture key together with a reCAPTCHA token. Never tell a reader to authenticate it with an API key, and never tell them to keep its capture key out of frontend code - it is designed to live in the page.
> Integrations API error codes follow the BRIDGE_<DOMAIN>_<NNNN> format, for example BRIDGE_CONVERSATION_0001, and are listed on the error codes page. Lead Capture error codes follow a different format, BRIDGE.CAMPAIGN_LEADS.<NAME>, and are listed on the Lead Capture error reference. Never invent a code that is not listed on the page for its own surface.
> This documentation covers the Integrations API, webhooks and Lead Capture only. It does not describe the Bridge web application or its internal APIs.

# Start an outbound conversation with a Contact as a given Agent

> Start an outbound conversation with a known Contact, answered by the given Agent.

Works for LeadScout and Service Agents. The Contact is resolved first, then the Agent, which must exist in
the workspace and be available (see `GET /agents`). The template must exist and be APPROVED, and a
`handoffOverride` Bridge User must be valid. If `template.media.mediaId` is unknown, the request fails
with 400 `BRIDGE_AI_LEADSCOUT_0016` only after the conversation was created or recovered, so a retry after
that error may answer differently. Body rules (`consent.status=GRANTED` without `capturedAt`, `template.media`
without exactly one of `mediaId` or `url`) fail with 400 `BRIDGE_CORE_0103`.

The conversation opens on one of the Agent's active WhatsApp lines, controlled by the Agent, with the template
as its first message. A line is picked in this order:
- A free line.
- Otherwise, a line holding a released conversation with this Contact that can be recovered. Recovering
  returns `recovered=true` and replaces the previous outbound context and `agentContext`. This happens even
  with `forceSend=false`.
- Otherwise, when no line is free or recoverable: `forceSend=false` (default) fails with 409
  `BRIDGE_AI_LEADSCOUT_0008`; `forceSend=true` reuses a line occupied by an active conversation with this
  Contact, preferring one this Agent controls. If the chosen conversation is held by another Agent or a
  Bridge User, the call fails with 409 `BRIDGE_AI_AGENT_OUTBOUND_0006` and nothing is written. Release it
  first, then retry. Lines whose conversation is blocked or was released without recovery are never used, so
  if no line is occupied by an active conversation the call fails with 409 `BRIDGE_AI_LEADSCOUT_0008` even
  with `forceSend=true`.

`contact.providerChannelId` is a preference: the pinned line is used when it is free or recoverable;
otherwise the same order applies over all the Agent's lines. Among occupied lines, one this Agent controls
comes first; if none does, the pinned line is the one reused (and may fail with 0006).

Reusing a conversation depends on the Agent type:
- LeadScout: if its LeadScout session is still open and not expired, the call fails with 409
  `BRIDGE_AI_LEADSCOUT_0017` (`extra` carries `conversationId`, `sessionId` and `stage`). If an expired
  session cannot be finalized, it fails with 409 `BRIDGE_AI_LEADSCOUT_0018`.
- Service Agent: an open, unexpired service session is continued; an expired one is closed as abandoned and a
  new one opens.



## OpenAPI

````yaml /api-reference/openapi.yaml post /bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound
openapi: 3.1.0
info:
  title: Bridge API
  summary: Bridge API specification for chat system management.
  description: >-
    Bridge API specification including webhook receiver endpoints, Contact CRUD
    operations, and comprehensive chat system.

                        This API includes:
                        1. Webhook Receiver API - for CRM clients to receive event notifications from Bridge
                        2. Contact CRUD API - for clients to manage contacts in Bridge
                        3. Conversations API - for managing conversations with flexible user identification and participant management
                        4. Messages API - for sending messages and files to a conversation
                        5. Files API - for managing files in a message
                        6. Custom attributes API - for consult custom attributes of an specific workspace
                    
                        **Multi-Tenant Architecture**: All operations are scoped to a specific workspace using workspaceId.
  termsOfService: https://www.sainapsis.com/legal/terms-of-service
  contact:
    name: Bridge Support
    url: https://app.bridge.new/
    email: support@sainapsis.com
  license:
    name: MIT License
    url: https://spdx.org/licenses/MIT.html
  version: 1.0.0
servers:
  - url: https://api-connect-us.bridge.new
    description: Production server
security: []
paths:
  /bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound:
    post:
      tags:
        - Agents API
      summary: Start an outbound conversation with a Contact as a given Agent
      description: >-
        Start an outbound conversation with a known Contact, answered by the
        given Agent.


        Works for LeadScout and Service Agents. The Contact is resolved first,
        then the Agent, which must exist in

        the workspace and be available (see `GET /agents`). The template must
        exist and be APPROVED, and a

        `handoffOverride` Bridge User must be valid. If `template.media.mediaId`
        is unknown, the request fails

        with 400 `BRIDGE_AI_LEADSCOUT_0016` only after the conversation was
        created or recovered, so a retry after

        that error may answer differently. Body rules (`consent.status=GRANTED`
        without `capturedAt`, `template.media`

        without exactly one of `mediaId` or `url`) fail with 400
        `BRIDGE_CORE_0103`.


        The conversation opens on one of the Agent's active WhatsApp lines,
        controlled by the Agent, with the template

        as its first message. A line is picked in this order:

        - A free line.

        - Otherwise, a line holding a released conversation with this Contact
        that can be recovered. Recovering
          returns `recovered=true` and replaces the previous outbound context and `agentContext`. This happens even
          with `forceSend=false`.
        - Otherwise, when no line is free or recoverable: `forceSend=false`
        (default) fails with 409
          `BRIDGE_AI_LEADSCOUT_0008`; `forceSend=true` reuses a line occupied by an active conversation with this
          Contact, preferring one this Agent controls. If the chosen conversation is held by another Agent or a
          Bridge User, the call fails with 409 `BRIDGE_AI_AGENT_OUTBOUND_0006` and nothing is written. Release it
          first, then retry. Lines whose conversation is blocked or was released without recovery are never used, so
          if no line is occupied by an active conversation the call fails with 409 `BRIDGE_AI_LEADSCOUT_0008` even
          with `forceSend=true`.

        `contact.providerChannelId` is a preference: the pinned line is used
        when it is free or recoverable;

        otherwise the same order applies over all the Agent's lines. Among
        occupied lines, one this Agent controls

        comes first; if none does, the pinned line is the one reused (and may
        fail with 0006).


        Reusing a conversation depends on the Agent type:

        - LeadScout: if its LeadScout session is still open and not expired, the
        call fails with 409
          `BRIDGE_AI_LEADSCOUT_0017` (`extra` carries `conversationId`, `sessionId` and `stage`). If an expired
          session cannot be finalized, it fails with 409 `BRIDGE_AI_LEADSCOUT_0018`.
        - Service Agent: an open, unexpired service session is continued; an
        expired one is closed as abandoned and a
          new one opens.
      operationId: >-
        start_agent_outbound_bridge_api_v1_workspaces__workspaceId__agents__agentId__outbound_post
      parameters:
        - name: workspaceId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Unique identifier of the workspace (UUID v4).
            examples:
              - b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234
            title: Workspaceid
          description: Unique identifier of the workspace (UUID v4).
        - name: agentId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              Unique identifier of the Agent (UUID v4), as listed by `GET
              /agents`.
            examples:
              - 4e362e2b-67b2-4a7e-a9df-e9ecf9141be8
            title: Agentid
          description: >-
            Unique identifier of the Agent (UUID v4), as listed by `GET
            /agents`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentOutboundRequest'
              description: >-
                Request body for starting an outbound conversation answered by a
                given Agent.
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentOutboundResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                BAD_REQUEST:
                  value:
                    title: Bad Request
                    status: 400
                    code: BRIDGE_CORE_0103
                OUTBOUND_VALIDATION_ERROR:
                  value:
                    title: Outbound Validation Error
                    status: 400
                    code: BRIDGE_AI_LEADSCOUT_0016
                TEMPLATE_ORDERED_PARAMS_MISMATCH:
                  value:
                    title: Template Params Mismatch
                    status: 400
                    code: BRIDGE_AI_LEADSCOUT_0006
              schema:
                $ref: '#/components/schemas/Problem'
        '403':
          description: Forbidden
          content:
            application/json:
              examples:
                FORBIDDEN:
                  value:
                    title: Forbidden
                    status: 403
                    code: BRIDGE_CORE_0301
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: Not Found
          content:
            application/json:
              examples:
                AGENT_NOT_FOUND:
                  value:
                    title: Agent Not Found
                    status: 404
                    code: BRIDGE_AI_AGENT_OUTBOUND_0001
                NO_CHANNELS_FOR_AGENT:
                  value:
                    title: No Channels For Agent
                    status: 404
                    code: BRIDGE_AI_AGENT_OUTBOUND_0004
                EXTERNAL_USER_NOT_FOUND:
                  value:
                    title: External User Not Found
                    status: 404
                    code: BRIDGE_AI_LEADSCOUT_0001
                INTERNAL_USER_NOT_FOUND:
                  value:
                    title: Internal User Not Found
                    status: 404
                    code: BRIDGE_AI_LEADSCOUT_0002
                TEMPLATE_NOT_FOUND:
                  value:
                    title: Template Not Found
                    status: 404
                    code: BRIDGE_AI_LEADSCOUT_0004
                NO_CHANNELS_FOR_BRAND:
                  value:
                    title: No Channels For Brand
                    status: 404
                    code: BRIDGE_AI_LEADSCOUT_0009
              schema:
                $ref: '#/components/schemas/Problem'
        '409':
          description: Conflict
          content:
            application/json:
              examples:
                AGENT_NOT_AVAILABLE:
                  value:
                    title: Agent Not Available
                    status: 409
                    code: BRIDGE_AI_AGENT_OUTBOUND_0002
                ACTIVE_CONVERSATION_CONTROLLED_BY_OTHER_AGENT:
                  value:
                    title: Conversation Controlled By Other Agent
                    status: 409
                    code: BRIDGE_AI_AGENT_OUTBOUND_0006
                INTERNAL_USER_DELETED:
                  value:
                    title: Internal User Deleted
                    status: 409
                    code: BRIDGE_AI_LEADSCOUT_0003
                TEMPLATE_NOT_APPROVED:
                  value:
                    title: Template Not Approved
                    status: 409
                    code: BRIDGE_AI_LEADSCOUT_0005
                ACTIVE_CONVERSATION_ALREADY_EXISTS:
                  value:
                    title: Active Conversation Exists
                    status: 409
                    code: BRIDGE_AI_LEADSCOUT_0007
                ALL_PROVIDER_CHANNELS_OCCUPIED:
                  value:
                    title: All Channels Occupied
                    status: 409
                    code: BRIDGE_AI_LEADSCOUT_0008
                LATEST_SESSION_NOT_FINAL:
                  value:
                    title: Latest Session Not Final
                    status: 409
                    code: BRIDGE_AI_LEADSCOUT_0017
                SESSION_FINALIZATION_FAILED:
                  value:
                    title: Session Finalization Failed
                    status: 409
                    code: BRIDGE_AI_LEADSCOUT_0018
              schema:
                $ref: '#/components/schemas/Problem'
        '422':
          description: Unprocessable Content
          content:
            application/json:
              examples:
                AGENT_TYPE_NOT_SUPPORTED:
                  value:
                    title: Agent Type Not Supported
                    status: 422
                    code: BRIDGE_AI_AGENT_OUTBOUND_0003
                AGENT_NOT_ASSIGNED_TO_CHANNEL:
                  value:
                    title: Agent Not Assigned To Channel
                    status: 422
                    code: BRIDGE_AI_AGENT_OUTBOUND_0005
                MISSING_TEMPLATE_VARIABLES:
                  value:
                    title: Missing Template Variables
                    status: 422
                    code: BRIDGE_AI_LEADSCOUT_0019
                CONFLICTING_TEMPLATE_PARAMETERS:
                  value:
                    title: Conflicting Template Parameters
                    status: 422
                    code: BRIDGE_AI_LEADSCOUT_0020
                UNKNOWN_TEMPLATE_PARAMETER_KEY:
                  value:
                    title: Unknown Template Parameter Key
                    status: 422
                    code: BRIDGE_AI_LEADSCOUT_0021
              schema:
                $ref: '#/components/schemas/Problem'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
              examples:
                WORKSPACE_BUDGET_EXHAUSTED:
                  value:
                    title: Too Many Requests
                    status: 429
                    code: BRIDGE_RATE_LIMIT_0001
      security:
        - x-api-key: []
components:
  schemas:
    AgentOutboundRequest:
      properties:
        contact:
          $ref: '#/components/schemas/AgentOutboundContactRef'
          title: Contact
          description: >-
            The Contact this outbound conversation targets. Must already exist
            in the workspace.
        template:
          $ref: '#/components/schemas/LeadscoutOutboundTemplateRef'
          title: Template
          description: The opening template to send.
        additionalMessages:
          items:
            $ref: '#/components/schemas/AgentOutboundFollowUp'
          type: array
          maxItems: 5
          title: Additional Messages
          description: >-
            Up to five text follow-ups stored on the conversation right after
            the opening template, in the order given, and sent like the
            template. Attachments (`mediaIds`) are not sent yet.
        agentContext:
          anyOf:
            - $ref: '#/components/schemas/AgentOutboundContext'
            - type: 'null'
          title: Agent Context
          description: >-
            Optional notes and media stored on the conversation as context for
            the Agent.
        consent:
          anyOf:
            - $ref: '#/components/schemas/OutboundConsentRequest'
            - type: 'null'
          title: Consent
          description: >-
            Optional tenant-affirmed opt-in evidence recorded on the
            conversation.
        handoffOverride:
          anyOf:
            - $ref: '#/components/schemas/AgentOutboundHandoffOverride'
            - type: 'null'
          title: Handoff Override
          description: >-
            Optional. Pre-assigns a specific Bridge User as the advisor for the
            handoff. The Bridge User is validated before anything is written:
            the request is rejected if the user does not exist, belongs to
            another workspace, or has been deleted.
        brandId:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand Identifier
          description: >-
            Optional brand id. When given, only the Agent's lines linked to this
            brand are eligible; if none is, the request fails with 404. Omit to
            consider every line of the Agent.
          examples:
            - null
            - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
        campaignId:
          anyOf:
            - type: string
            - type: 'null'
          title: Campaign Identifier
          description: >-
            Optional campaign reference stored on the conversation for audit and
            reporting.
          examples:
            - null
            - spring_promo_2026
        forceSend:
          type: boolean
          title: Force Send
          description: >-
            Controls what happens when no line of the Agent is free or
            recoverable. A free line always wins, then a line holding a released
            conversation with this Contact that can be recovered, whatever this
            flag says. When neither exists: with false (default) the request
            fails with 409 `BRIDGE_AI_LEADSCOUT_0008`; with true, a line
            occupied by an active conversation with this Contact is reused,
            preferring one this Agent controls. If the chosen conversation is
            held by another Agent or a Bridge User the request fails with 409
            `BRIDGE_AI_AGENT_OUTBOUND_0006` and nothing is written; release it
            first, then retry. Lines whose conversation is blocked or was
            released without recovery are never used, so with no line occupied
            by an active conversation the request fails with 409
            `BRIDGE_AI_LEADSCOUT_0008` even with true.
          default: false
          examples:
            - false
            - true
      type: object
      required:
        - contact
        - template
      title: AgentOutboundRequest
      description: >-
        Request body for starting an outbound conversation answered by a given
        Agent.
    AgentOutboundResponse:
      properties:
        conversation:
          $ref: '#/components/schemas/ConversationResponse'
          title: Conversation
          description: >-
            The conversation the Agent now controls: newly created, reused
            (`alreadyInitiated`) or recovered (`recovered`).
        contact:
          $ref: '#/components/schemas/ContactResponse'
          title: Contact
          description: The contact the conversation was initiated with.
        templateSent:
          anyOf:
            - $ref: '#/components/schemas/AgentTemplateSent'
            - type: 'null'
          title: Template Sent
          description: Summary of the template stored to open the conversation.
        additionalMessagesPersisted:
          type: integer
          title: Additional Messages Persisted
          description: Count of follow-up messages persisted on the conversation.
          default: 0
          examples:
            - 0
            - 3
        alreadyInitiated:
          type: boolean
          title: Already Initiated
          description: >-
            True when this request landed on a pre-existing conversation
            (forceSend=true reuse path); false when a fresh conversation was
            created. Informational only — the new template and follow-ups are
            persisted either way.
          default: false
          examples:
            - false
            - true
        recovered:
          type: boolean
          title: Recovered
          description: >-
            True when a released conversation the Contact had on the line was
            recovered instead of creating a new one. Recovery replaces the
            previous outbound context and `agentContext`. Recoverable lines are
            used even with `forceSend=false`.
          default: false
          examples:
            - false
            - true
      type: object
      required:
        - conversation
        - contact
      title: AgentOutboundResponse
      description: Response body for a successful Agent outbound initiation.
    Problem:
      properties:
        title:
          type: string
          title: Title
          description: Short, summary of the problem type.
        status:
          type: integer
          title: Status
          description: >-
            HTTP status code generated by the origin server for this occurrence
            of the problem.
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          description: Explanation specific to this occurrence of the problem.
        instance:
          anyOf:
            - type: string
            - type: 'null'
          title: Instance
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
        traceId:
          anyOf:
            - type: string
            - type: 'null'
          title: Traceid
          description: Trace ID for debugging purposes.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Error code for identification, view the error codes page for more
            details.
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Errors
          description: List of error details.
        extra:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extra
          description: Extra information about the problem.
      type: object
      required:
        - title
        - status
      title: Problem
      description: Object representing a Problem response body.
    AgentOutboundContactRef:
      properties:
        identifier:
          type: string
          title: Identifier
          description: Phone number in E.164 format identifying the contact.
          examples:
            - '+573001234567'
        identifierType:
          $ref: '#/components/schemas/ParticipantIdentifierType'
          title: Identifier Type
          description: Type of identifier.
          examples:
            - PHONE
            - EMAIL
            - ID
        messageProviderType:
          $ref: '#/components/schemas/MessageProviderType'
          title: Message Provider Type
          description: Provider used to deliver the template.
          examples:
            - WHATSAPP
        providerChannelId:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Channel Identifier
          description: >-
            Optional. A line of the Agent to prefer (the `providerChannelId` of
            one of its `lines` in `GET /agents`). When omitted, any of the
            Agent's lines can be used. When given, it must be an active line of
            the Agent, otherwise the request fails with 422. It is a preference,
            not a guarantee: if that line is neither free nor recoverable, the
            same order applies over all the Agent's lines (with
            `forceSend=true`, an occupied line this Agent controls comes first,
            then the pinned one), and the response does not say which line was
            used.
          examples:
            - c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c
            - null
      type: object
      required:
        - identifier
        - identifierType
        - messageProviderType
      title: AgentOutboundContactRef
      description: Identifies the Contact the outbound conversation will target.
    LeadscoutOutboundTemplateRef:
      properties:
        name:
          type: string
          title: Template Name
          description: Name of the registered Meta-approved template to send.
          examples:
            - leadscout_outbound_fb_v1
        orderedParams:
          items:
            type: string
          type: array
          title: Ordered Parameters
          description: >-
            Caller-supplied values for the template's CALLER-source parameter
            slots, in position order.
          examples:
            - - Maria
              - ACME
        parameters:
          additionalProperties:
            type: string
          type: object
          title: Parameters
          description: >-
            Caller-supplied values keyed by the template's variable key (see GET
            /templates/{id} for the key inventory), covering both body and
            button slots. Prefer this over orderedParams for any template that
            has a dynamic button. An unknown key, or a key that overlaps a slot
            already covered by orderedParams, is rejected with 422.
          examples:
            - recipient_first_name: Maria
              tracking_code: TRK123
        media:
          anyOf:
            - $ref: '#/components/schemas/OutboundTemplateMedia'
            - type: 'null'
          title: Header Media
          description: >-
            Optional header media (image/video) to attach to the template
            message. Accepts either a preloaded mediaId or a public url.
      type: object
      required:
        - name
      title: LeadscoutOutboundTemplateRef
      description: References the Meta-approved template that will open the conversation.
    AgentOutboundFollowUp:
      properties:
        messageBody:
          type: string
          title: Message Body
          description: Plain-text body for the follow-up message.
          examples:
            - Just confirming we're still on for tomorrow at 10am.
        mediaIds:
          items:
            type: string
          type: array
          title: Media Identifiers
          description: >-
            Accepted but not used yet: follow-ups are stored as text only, so
            attachments are not sent.
          examples:
            - []
            - - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
      type: object
      required:
        - messageBody
      title: AgentOutboundFollowUp
      description: >-
        A text follow-up stored on the conversation right after the opening
        template.
    AgentOutboundContext:
      properties:
        notes:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Notes
          description: Free-text notes for the Agent, capped at 2000 characters.
          examples:
            - The Contact asked about pricing tiers last week.
            - null
        mediaIds:
          items:
            type: string
          type: array
          title: Media Identifiers
          description: >-
            Optional preloaded-file identifiers persisted on the conversation as
            context for the Agent.
          examples:
            - []
            - - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
      type: object
      title: AgentOutboundContext
      description: >-
        Notes and media stored on the conversation as context for the Agent and
        for Bridge Users.
    OutboundConsentRequest:
      properties:
        status:
          $ref: '#/components/schemas/ConsentStatus'
          title: Status
          description: >-
            Tenant-affirmed consent state. Use GRANTED (with capturedAt) for
            explicit opt-in or NOT_PROVIDED when the tenant has no opt-in
            evidence to attest.
          examples:
            - GRANTED
            - NOT_PROVIDED
        capturedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Captured At
          description: >-
            ISO8601 timestamp (with milliseconds) when consent was captured by
            the tenant. Required when status=GRANTED; null/omitted is accepted
            when status=NOT_PROVIDED.
          examples:
            - '2026-04-20T10:00:00.000Z'
            - null
      type: object
      required:
        - status
      title: OutboundConsentRequest
      description: Tenant-affirmed opt-in evidence recorded verbatim on the conversation.
    AgentOutboundHandoffOverride:
      properties:
        preAssignedUser:
          $ref: '#/components/schemas/AgentOutboundPreAssignedUser'
          title: Pre-assigned User
          description: >-
            The Bridge User to assign as advisor when the Agent hands off the
            conversation. Validated at request time: the request is rejected if
            the user does not exist, belongs to another workspace, or has been
            deleted.
          examples:
            - identifier: advisor@acme.com
              identifierType: EMAIL
      additionalProperties: false
      type: object
      required:
        - preAssignedUser
      title: AgentOutboundHandoffOverride
      description: >-
        Pre-assigns the Bridge User who receives the handoff of the outbound
        conversation.
    ConversationResponse:
      properties:
        id:
          type: string
          title: Identifier
          description: Unique identifier of the conversation (UUID v4).
          examples:
            - b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234
        workspaceId:
          type: string
          title: Workspace Identifier
          description: Unique identifier of the workspace (UUID v4).
          examples:
            - b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234
        participants:
          $ref: '#/components/schemas/ConversationParticipantsResponse'
          title: Participants
          description: Participants of the conversation.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Optional name/title for the conversation.
          examples:
            - Bridge Support Team
        status:
          anyOf:
            - $ref: '#/components/schemas/ConversationStatus'
            - type: 'null'
          title: Status
          description: >-
            Current conversation status - 'ACTIVE' for visible conversations,
            'GHOST' for invisible until first interaction.
          examples:
            - ACTIVE
        createdAt:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when the conversation was created.
          examples:
            - '2003-04-10T09:00:00.000Z'
        updatedAt:
          type: string
          format: date-time
          title: Updated At
          description: Timestamp when the conversation was last updated.
          examples:
            - '2003-04-10T09:00:00.000Z'
      type: object
      required:
        - id
        - workspaceId
        - participants
        - createdAt
        - updatedAt
      title: ConversationResponse
      description: Response body for conversation details.
    ContactResponse:
      properties:
        id:
          type: string
          title: Identifier
          description: Unique identifier for the contact (UUID v4).
          examples:
            - b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234
        workspaceId:
          type: string
          title: Workspace Identifier
          description: Unique identifier of the workspace this contact belongs to
          examples:
            - 92b2d4f3-81e1-4b61-a7ec-6f4ff3b58be5
        type:
          $ref: '#/components/schemas/ExternalUserType'
          title: Contact Type
          description: >-
            NORMAL when all required identity and custom attribute fields are
            present, PARTIAL otherwise.
          examples:
            - NORMAL
            - PARTIAL
        firstName:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
          description: Contact's first name.
          examples:
            - John
            - null
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
          description: Contact's last name.
          examples:
            - Doe
            - null
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
          description: Contact's email address.
          examples:
            - john.doe@example.com
            - null
        cellphone:
          anyOf:
            - type: string
              format: phone
            - type: 'null'
          title: Cellphone
          description: Contact's cellphone address.
          examples:
            - '+14084029292'
            - null
        customAttributes:
          items:
            $ref: '#/components/schemas/CustomAttributeResponse'
          type: array
          title: Custom Attributes
          description: Array of custom key-value attributes.
        languageCode:
          anyOf:
            - $ref: '#/components/schemas/LanguageCode'
            - type: 'null'
          title: Language Code
          description: Language code from external user.
          examples:
            - EN
            - null
        ownerId:
          anyOf:
            - type: string
            - type: 'null'
          title: Owner Identifier
          description: Email address of the salesperson or user who owns this contact.
          examples:
            - 37673840-6259-40f9-bbe5-a7db40f8e3cf
            - null
        createdAt:
          type: string
          title: Created At
          description: Timestamp when the contact was created.
          examples:
            - '2003-04-10T08:00:00.000Z'
        updatedAt:
          type: string
          title: Updated At
          description: Timestamp when the contact was last updated.
          examples:
            - '2003-04-10T08:00:00.000Z'
      type: object
      required:
        - id
        - workspaceId
        - type
        - createdAt
        - updatedAt
      title: ContactResponse
      description: Response body for contact-related operations.
    AgentTemplateSent:
      properties:
        name:
          type: string
          title: Template Name
          description: Name of the template that was dispatched.
          examples:
            - leadscout_outbound_fb_v1
        messageId:
          anyOf:
            - type: string
            - type: 'null'
          title: Message Identifier
          description: >-
            Bridge message id of the template. Always present; it is not a
            WhatsApp `wamid`.
          examples:
            - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
      type: object
      required:
        - name
      title: AgentTemplateSent
      description: Summary of the template stored to open the conversation.
    ParticipantIdentifierType:
      type: string
      enum:
        - ID
        - EMAIL
        - PHONE
      title: ParticipantIdentifierType
    MessageProviderType:
      type: string
      enum:
        - WHATSAPP
        - SMS
        - TELEGRAM
        - INSTAGRAM
        - TWITTER
        - LINE
        - FACEBOOK
        - IMESSAGE
        - WHATSAPP_TEST
        - HEYGIA
      title: MessageProviderType
    OutboundTemplateMedia:
      properties:
        type:
          $ref: '#/components/schemas/HeaderFileType'
          title: Media Type
          description: >-
            Header media kind. Must match the template header type configured in
            Meta.
          examples:
            - IMAGE
            - VIDEO
        mediaId:
          anyOf:
            - type: string
            - type: 'null'
          title: Media Identifier
          description: UUID returned by /preloaded-files. Mutually exclusive with url.
          examples:
            - null
            - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Source URL
          description: >-
            Public source URL fetched asynchronously via the URL file fetcher.
            Mutually exclusive with mediaId.
          examples:
            - null
            - https://cdn.example.com/promo.jpg
      type: object
      required:
        - type
      title: OutboundTemplateMedia
      description: >-
        Optional header media attached to the opening template message.


        Provide exactly one of ``mediaId`` (a UUID returned by ``POST
        /preloaded-files``)

        or ``url`` (a public source URL fetched asynchronously by the URL file
        fetcher).
    ConsentStatus:
      type: string
      enum:
        - GRANTED
        - NOT_PROVIDED
      title: ConsentStatus
    AgentOutboundPreAssignedUser:
      properties:
        identifier:
          type: string
          title: Identifier
          description: >-
            Value that identifies the Bridge User, interpreted according to
            identifierType.
          examples:
            - advisor@acme.com
            - usr_01HZ2K3J4M5N6P7Q8R9S0T1UV2
        identifierType:
          $ref: '#/components/schemas/InternalParticipantIdentifierType'
          title: Identifier Type
          description: >-
            How to resolve the identifier. ID looks up by Bridge User ID; EMAIL
            looks up by email address.
          examples:
            - EMAIL
            - ID
      additionalProperties: false
      type: object
      required:
        - identifier
        - identifierType
      title: AgentOutboundPreAssignedUser
      description: Identifies the Bridge User who should receive the handoff.
    ConversationParticipantsResponse:
      properties:
        externals:
          items:
            $ref: '#/components/schemas/ExternalParticipant'
          type: array
          title: Externals
          description: List of external participants.
        internals:
          items:
            $ref: '#/components/schemas/InternalParticipant'
          type: array
          title: Internals
          description: List of internal participants.
      type: object
      required:
        - externals
        - internals
      title: ConversationParticipantsResponse
      description: Response body for conversation participants.
    ConversationStatus:
      type: string
      enum:
        - ACTIVE
        - GHOST
        - RELEASED
        - NOT_ASSIGNED_TO_HUMAN
        - BLOCKED
      title: ConversationStatus
    ExternalUserType:
      type: string
      enum:
        - PARTIAL
        - NORMAL
      title: ExternalUserType
    CustomAttributeResponse:
      properties:
        key:
          type: string
          title: Key
          description: Attribute key/name
        values:
          items:
            type: string
          type: array
          title: Values
          description: Attribute value
      type: object
      required:
        - key
      title: CustomAttributeResponse
      description: Response body for custom attributes in contact-related operations.
    LanguageCode:
      type: string
      enum:
        - ES
        - EN
      title: LanguageCode
    HeaderFileType:
      type: string
      enum:
        - IMAGE
        - VIDEO
        - GIF
      title: HeaderFileType
    InternalParticipantIdentifierType:
      type: string
      enum:
        - ID
        - EMAIL
      title: InternalParticipantIdentifierType
    ExternalParticipant:
      properties:
        identifier:
          type: string
          title: Identifier
          description: Participant identifier value.
          examples:
            - ef7ee722-5f95-415a-9a98-81eeae178b11
        identifierType:
          type: string
          enum:
            - ID
            - EMAIL
            - PHONE
          title: Identifier Type
          description: Type of identifier for external participants (ID, EMAIL, or PHONE).
          examples:
            - EMAIL
            - PHONE
            - ID
        role:
          $ref: '#/components/schemas/UserType'
          title: Role
          description: Participant role in the conversation.
          examples:
            - EXTERNAL
            - INTERNAL
        joinedAt:
          type: string
          format: date-time
          title: Joined At
          description: Timestamp when participant joined the conversation.
          examples:
            - '2004-04-10T09:00:00.000Z'
        lastSeenAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Seen At
          description: Timestamp when participant was last seen.
          examples:
            - null
            - '2004-04-10T09:00:00.000Z'
      type: object
      required:
        - identifier
        - identifierType
        - role
        - joinedAt
      title: Participant
      description: Object representing the external participant in the conversation.
    InternalParticipant:
      properties:
        identifier:
          type: string
          title: Identifier
          description: Participant identifier value.
          examples:
            - ef7ee722-5f95-415a-9a98-81eeae178b11
        identifierType:
          $ref: '#/components/schemas/InternalParticipantIdentifierType'
          title: Identifier Type
          description: Type of identifier for internal participants (ID or EMAIL).
          examples:
            - EMAIL
            - ID
        role:
          $ref: '#/components/schemas/UserType'
          title: Role
          description: Participant role in the conversation.
          examples:
            - EXTERNAL
            - INTERNAL
        joinedAt:
          type: string
          format: date-time
          title: Joined At
          description: Timestamp when participant joined the conversation.
          examples:
            - '2004-04-10T09:00:00.000Z'
        lastSeenAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Seen At
          description: Timestamp when participant was last seen.
          examples:
            - null
            - '2004-04-10T09:00:00.000Z'
      type: object
      required:
        - identifier
        - identifierType
        - role
        - joinedAt
      title: Participant
      description: Object representing the internal participant in the conversation.
    UserType:
      type: string
      enum:
        - INTERNAL
        - EXTERNAL
        - BOT
      title: UserType
  securitySchemes:
    x-api-key:
      type: apiKey
      description: Copy the API key as provided by the Bridge Console.
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.