> ## 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.

# Initiate a LeadScout outbound conversation with a known lead

> Start an AI-controlled outbound conversation with a known lead.

Pre-flight checks run before any write: template exists and is APPROVED, contact
exists, a WhatsApp channel resolves, a prospection agent owns it, and any
`handoffOverride` user is valid.

If an active conversation is already running on the chosen channel:
- `forceSend=false` (default) → `409` with error code BRIDGE_AI_LEADSCOUT_0007.
- `forceSend=true` → that conversation is reused; the new template and follow-ups
  are appended to it and the response sets `alreadyInitiated=true`.

Otherwise a fresh conversation is opened (controlled by the prospection agent) with
the template as its first message; `additionalMessages` are persisted for the agent
to send once the lead replies.

Error codes:
- BRIDGE_AI_LEADSCOUT_0001: external user not found
- BRIDGE_AI_LEADSCOUT_0002: internal user not found
- BRIDGE_AI_LEADSCOUT_0003: internal user deleted
- BRIDGE_AI_LEADSCOUT_0004: template not found
- BRIDGE_AI_LEADSCOUT_0005: template not approved
- BRIDGE_AI_LEADSCOUT_0006: template ordered params mismatch
- BRIDGE_AI_LEADSCOUT_0007: active conversation already exists
- BRIDGE_AI_LEADSCOUT_0008: all provider channels occupied
- BRIDGE_AI_LEADSCOUT_0009: no channels for brand
- BRIDGE_AI_LEADSCOUT_0010: provider channel not in workspace
- BRIDGE_AI_LEADSCOUT_0011: workspace has no provider channels
- BRIDGE_AI_LEADSCOUT_0012: no prospecting agent for channel
- BRIDGE_AI_LEADSCOUT_0013: multiple prospecting agents for brand
- BRIDGE_AI_LEADSCOUT_0014: multiple prospecting agents for channel
- BRIDGE_AI_LEADSCOUT_0015: conversation operation failed
- BRIDGE_AI_LEADSCOUT_0016: outbound validation error



## OpenAPI

````yaml /api-reference/openapi.yaml post /bridge/api/v1/workspaces/{workspaceId}/leadscout/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}/leadscout/outbound:
    post:
      tags:
        - LeadScout API
      summary: Initiate a LeadScout outbound conversation with a known lead
      description: >-
        Start an AI-controlled outbound conversation with a known lead.


        Pre-flight checks run before any write: template exists and is APPROVED,
        contact

        exists, a WhatsApp channel resolves, a prospection agent owns it, and
        any

        `handoffOverride` user is valid.


        If an active conversation is already running on the chosen channel:

        - `forceSend=false` (default) → `409` with error code
        BRIDGE_AI_LEADSCOUT_0007.

        - `forceSend=true` → that conversation is reused; the new template and
        follow-ups
          are appended to it and the response sets `alreadyInitiated=true`.

        Otherwise a fresh conversation is opened (controlled by the prospection
        agent) with

        the template as its first message; `additionalMessages` are persisted
        for the agent

        to send once the lead replies.


        Error codes:

        - BRIDGE_AI_LEADSCOUT_0001: external user not found

        - BRIDGE_AI_LEADSCOUT_0002: internal user not found

        - BRIDGE_AI_LEADSCOUT_0003: internal user deleted

        - BRIDGE_AI_LEADSCOUT_0004: template not found

        - BRIDGE_AI_LEADSCOUT_0005: template not approved

        - BRIDGE_AI_LEADSCOUT_0006: template ordered params mismatch

        - BRIDGE_AI_LEADSCOUT_0007: active conversation already exists

        - BRIDGE_AI_LEADSCOUT_0008: all provider channels occupied

        - BRIDGE_AI_LEADSCOUT_0009: no channels for brand

        - BRIDGE_AI_LEADSCOUT_0010: provider channel not in workspace

        - BRIDGE_AI_LEADSCOUT_0011: workspace has no provider channels

        - BRIDGE_AI_LEADSCOUT_0012: no prospecting agent for channel

        - BRIDGE_AI_LEADSCOUT_0013: multiple prospecting agents for brand

        - BRIDGE_AI_LEADSCOUT_0014: multiple prospecting agents for channel

        - BRIDGE_AI_LEADSCOUT_0015: conversation operation failed

        - BRIDGE_AI_LEADSCOUT_0016: outbound validation error
      operationId: >-
        initiate_leadscout_outbound_bridge_api_v1_workspaces__workspaceId__leadscout_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).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadscoutOutboundRequest'
              description: Request body for initiating a LeadScout outbound conversation.
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadscoutOutboundResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                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'
        '404':
          description: Not Found
          content:
            application/json:
              examples:
                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
                PROVIDER_CHANNEL_NOT_IN_WORKSPACE:
                  value:
                    title: Channel Not In Workspace
                    status: 404
                    code: BRIDGE_AI_LEADSCOUT_0010
                WORKSPACE_HAS_NO_PROVIDER_CHANNELS:
                  value:
                    title: No Provider Channels
                    status: 404
                    code: BRIDGE_AI_LEADSCOUT_0011
                NO_PROSPECTING_AGENT_FOR_CHANNEL:
                  value:
                    title: No Agent For Channel
                    status: 404
                    code: BRIDGE_AI_LEADSCOUT_0012
              schema:
                $ref: '#/components/schemas/Problem'
        '409':
          description: Conflict
          content:
            application/json:
              examples:
                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
                MULTIPLE_PROSPECTING_AGENTS_FOR_BRAND:
                  value:
                    title: Multiple Agents For Brand
                    status: 409
                    code: BRIDGE_AI_LEADSCOUT_0013
                MULTIPLE_PROSPECTING_AGENTS_FOR_CHANNEL:
                  value:
                    title: Multiple Agents For Channel
                    status: 409
                    code: BRIDGE_AI_LEADSCOUT_0014
              schema:
                $ref: '#/components/schemas/Problem'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              examples:
                CONVERSATION_OPERATION_FAILED:
                  value:
                    title: Conversation Operation Failed
                    status: 500
                    code: BRIDGE_AI_LEADSCOUT_0015
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - x-api-key: []
components:
  schemas:
    LeadscoutOutboundRequest:
      properties:
        contact:
          $ref: '#/components/schemas/LeadscoutOutboundContactRef'
          title: Contact
          description: >-
            The lead 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/OutboundFollowUpRequest'
          type: array
          maxItems: 5
          title: Additional Messages
          description: >-
            Up to five follow-up messages persisted on the conversation. They
            are not delivered immediately; the agent decides when to send them
            once the lead replies.
        agentContext:
          anyOf:
            - $ref: '#/components/schemas/OutboundAgentContextRequest'
            - 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/LeadscoutOutboundHandoffOverride'
            - type: 'null'
          title: Handoff Override
          description: >-
            Optional override to pre-assign a specific internal user as the
            handoff advisor. Validated at request time; conversation creation is
            aborted if validation fails.
        brandId:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand Identifier
          description: >-
            Optional brand id. When provided, only channels linked to this brand
            are eligible. Omit to consider every channel in the workspace.
          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: >-
            When true, bypass all blockers on the chosen channel: any active
            conversation (AI-prospecting or human) is ignored and a fresh
            outbound is created. When no providerChannelId is supplied and every
            workspace channel is occupied, the first candidate is used instead
            of raising AllProviderChannelsOccupied. When false (default), an
            existing active conversation on the chosen channel returns 409.
          default: false
          examples:
            - false
            - true
      type: object
      required:
        - contact
        - template
      title: LeadscoutOutboundRequest
      description: Request body for initiating a LeadScout outbound conversation.
    LeadscoutOutboundResponse:
      properties:
        conversation:
          $ref: '#/components/schemas/ConversationResponse'
          title: Conversation
          description: The newly created AI-controlled conversation.
        contact:
          $ref: '#/components/schemas/ContactResponse'
          title: Contact
          description: The contact the conversation was initiated with.
        templateSent:
          anyOf:
            - $ref: '#/components/schemas/LeadscoutTemplateSent'
            - type: 'null'
          title: Template Sent
          description: Summary of the dispatched template.
        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
      type: object
      required:
        - conversation
        - contact
      title: LeadscoutOutboundResponse
      description: Response body for a successful LeadScout 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.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LeadscoutOutboundContactRef:
      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 explicit WhatsApp channel id. If omitted, the workspace's
            single WhatsApp channel is used; in workspaces with multiple
            channels this field is required.
          examples:
            - c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c
            - null
      type: object
      required:
        - identifier
        - identifierType
        - messageProviderType
      title: LeadscoutOutboundContactRef
      description: Identifies the lead 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
        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.
    OutboundFollowUpRequest:
      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: Optional preloaded-file identifiers to attach to the follow-up.
          examples:
            - []
            - - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
      type: object
      required:
        - messageBody
      title: OutboundFollowUpRequest
      description: >-
        A pre-loaded follow-up message persisted on the conversation alongside
        the opening template.
    OutboundAgentContextRequest:
      properties:
        notes:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Notes
          description: Free-text notes for the agent, capped at 2000 characters.
          examples:
            - Lead 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
            agent context.
          examples:
            - []
            - - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
      type: object
      title: OutboundAgentContextRequest
      description: >-
        Notes and media stored on the conversation as agent context for the AI /
        human reviewer.
    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.
    LeadscoutOutboundHandoffOverride:
      properties:
        preAssignedUser:
          $ref: '#/components/schemas/LeadscoutOutboundPreAssignedUser'
          title: Pre-assigned User
          description: >-
            The internal user to assign as advisor when the AI hands off the
            conversation. Validated at request time — if the user does not
            exist, is inactive, or belongs to a different workspace, the request
            is rejected before any conversation is created.
          examples:
            - identifier: advisor@acme.com
              identifierType: EMAIL
      additionalProperties: false
      type: object
      required:
        - preAssignedUser
      title: LeadscoutOutboundHandoffOverride
      description: Overrides the default advisor assignment for 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.
    LeadscoutTemplateSent:
      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: >-
            Meta wamid of the dispatched template. Null on the happy path until
            the send pipeline propagates the wamid back to the inbound API.
          examples:
            - null
            - wamid.HBgM...
      type: object
      required:
        - name
      title: LeadscoutTemplateSent
      description: Summary of the template dispatched to open the conversation.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    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
    LeadscoutOutboundPreAssignedUser:
      properties:
        identifier:
          type: string
          title: Identifier
          description: >-
            Value that identifies the internal user, interpreted according to
            identifier_type.
          examples:
            - advisor@acme.com
            - usr_01HZ2K3J4M5N6P7Q8R9S0T1UV2
        identifierType:
          $ref: '#/components/schemas/InternalParticipantIdentifierType'
          title: Identifier Type
          description: >-
            How to resolve the identifier. ID looks up by internal user ID;
            EMAIL looks up by email address.
          examples:
            - EMAIL
            - ID
      additionalProperties: false
      type: object
      required:
        - identifier
        - identifierType
      title: LeadscoutOutboundPreAssignedUser
      description: Identifies the internal 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

````