> ## 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 Custom Connections 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 Custom Connections 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.
> REST error catalog keys use BRIDGE_<DOMAIN>_<NNNN>, for example BRIDGE_CONVERSATION_0001. Some reviewed legacy handlers return a recognized code plus a symbolic suffix separated by |; preserve the complete received value and use the compatible catalog lookup on /error-codes. Custom Connections uses separate BRIDGE.CAMPAIGN_LEADS.<NAME> identifiers on its own error reference. Never invent an error code or confuse the two integration surfaces.
> This documentation covers the Integrations API, webhooks and Custom Connections only. It does not describe the Bridge web application or its internal APIs.
> Before generating an API request, read the relevant OpenAPI specification or the individual endpoint Markdown page. llms-full.txt collects guides and endpoint descriptions; it does not embed every request and response schema. The REST and Custom Connections contracts are separate.
> Preserve the published host, method, path, operationId, authentication, headers, parameter and field names, types, formats, required and nullable fields, enums, defaults, limits, and response codes. Do not invent identifiers, fields, retry rules, or delivery guarantees. When published sources conflict, identify the conflicting passages and ask Bridge support to confirm the current behavior before relying on it.
> Custom Connections is the current name of the landing-page feature previously documented as Lead Capture. The existing /lead-capture documentation URLs, captureKey field, campaign-leads endpoint, and BRIDGE.CAMPAIGN_LEADS error identifiers are unchanged. This is a naming change, not a change to authentication or the API contract.
> For a complete workflow, start with the task guides: /guides/first-conversation, /guides/send-attachments, /guides/send-template, /guides/agent-outbound, /guides/pagination, /guides/identifiers and /guides/responses. Read the endpoint contract as well as the recipe. Outbound requires an existing Contact, but does not require creating a separate Conversation first.
> forceSend=true permits reuse of an existing active conversation; it does not create a fresh one by ignoring it and it is not idempotency. Recovery of a released recoverable conversation can occur even with false. The LeadScout and Agents outbound routes have different line-selection and controller checks; use /guides/agent-outbound.
> For webhook HMAC, follow /webhooks/verifying-signatures exactly: the Python JSON serialization with sorted keys is signed; X-Bridge-Timestamp is not included in that signature. Do not claim a signed timestamp, raw-body signing, exactly-once delivery or a global event order. Use /webhooks/receive-events for durable acceptance and duplicates.
> A 201 message response, 202 handoff or 202 Custom Connections response is not a provider delivery receipt. Do not invent a polling endpoint from messageId, trackingId or requestId. REST validation parsing must tolerate the compatibility difference explained in /error-codes.
> The documentation is available in English (existing root URLs), Spanish (/es/) and Brazilian Portuguese (/pt-br/). Prefer the reader's language when a localized page exists, but preserve the API's exact field names, enums, routes, authentication and examples. Translations describe the same API; they do not introduce regional API hosts or behaviors.
> For coding-assistant setup, use /connect-your-agent, /es/connect-your-agent or /pt-br/connect-your-agent. The Bridge documentation MCP server reads published documentation and has a separate optional feedback tool. Connecting it does not connect the coding assistant to a customer workspace or authorize live business requests.
> For direct HTTP access without MCP, start at https://docs.bridge.new/llms.txt. It lists every published page in English, Spanish and Brazilian Portuguese. Choose /llms-en.json, /llms-es.json or /llms-pt-br.json for a language-specific index, and /llms-full-en.json, /llms-full-es.json or /llms-full-pt-br.json for collected content. /llms-full.txt contains the combined collection. Fetch the original OpenAPI specification for exact schemas.
> For HTTP page reads, follow the .md URLs from the index or request Accept: text/markdown at the canonical page URL. The MCP virtual filesystem uses .mdx page paths instead; .mdx is not the public HTTP export extension. With Search MCP, set language to en, es or pt-BR explicitly; its default is en.
> For integration capabilities and source-selection rules, read https://docs.bridge.new/skill.md. Documentation access does not authorize business API actions; use the actual user request, workspace, credentials and target identifiers for any live integration.

# Iniciar conversa de saída com um Contact como Agent específico

> Inicia uma conversa de saída com um Contact conhecido, atendida pelo Agent indicado.

Funciona com Agents LeadScout e Service. Primeiro é resolvido o Contact e depois o Agent, que deve existir no workspace e estar disponível (consulte `GET /agents`). O template é referenciado por `template.id` ou `template.name` (id tem precedência quando ambos são enviados), deve existir e estar APPROVED, e qualquer Bridge User de `handoffOverride` deve ser válido. Se `template.media.mediaId` for desconhecido, a solicitação falha com 400 `BRIDGE_AI_LEADSCOUT_0016` somente depois de a conversa ser criada ou recuperada, portanto uma nova tentativa após esse erro pode responder de forma diferente. As regras do corpo (`consent.status=GRANTED` sem `capturedAt`, ou `template.media` sem exatamente um de `mediaId` ou `url`) falham com 400 `BRIDGE_CORE_0103`.

A conversa é aberta em uma das linhas ativas de WhatsApp do Agent, sob seu controle, com o template como primeira mensagem. A linha é escolhida nesta ordem:
- Uma linha livre.
- Caso contrário, uma linha com uma conversa liberada recuperável com este Contact. A recuperação retorna `recovered=true` e substitui o contexto de saída anterior e `agentContext`. Isso acontece mesmo com `forceSend=false`.
- Se nenhuma linha estiver livre ou for recuperável: `forceSend=false` (padrão) falha com 409 `BRIDGE_AI_LEADSCOUT_0008`; `forceSend=true` reutiliza uma linha ocupada por uma conversa ativa com este Contact, dando preferência a uma controlada por este Agent. Se a conversa escolhida for controlada por outro Agent ou por um Bridge User, a chamada falha com 409 `BRIDGE_AI_AGENT_OUTBOUND_0006` e nada é gravado. Libere-a primeiro e tente novamente. Linhas cuja conversa está bloqueada ou foi liberada sem recuperação nunca são usadas; assim, se nenhuma linha estiver ocupada por uma conversa ativa, a chamada falha com 409 `BRIDGE_AI_LEADSCOUT_0008` mesmo com `forceSend=true`.

`contact.providerChannelId` é uma preferência: a linha indicada é usada quando está livre ou é recuperável; caso contrário, a mesma ordem é aplicada entre todas as linhas do Agent. Entre as linhas ocupadas, uma controlada por este Agent tem prioridade; se nenhuma for, a linha indicada é reutilizada (e pode falhar com 0006).

A reutilização de uma conversa depende do tipo de Agent:
- LeadScout: se sua sessão do LeadScout ainda estiver aberta e não expirada, a chamada falha com 409 `BRIDGE_AI_LEADSCOUT_0017` (`extra` inclui `conversationId`, `sessionId` e `stage`). Se uma sessão expirada não puder ser finalizada, falha com 409 `BRIDGE_AI_LEADSCOUT_0018`.
- Service Agent: uma sessão de serviço aberta e não expirada continua; uma sessão expirada é encerrada como abandonada e uma nova é aberta.

Consulte [o guia completo de saída](/pt-br/guides/agent-outbound) para os pré-requisitos, a tabela de decisão de forceSend, a recuperação, o trabalho parcial e as decisões seguras de nova tentativa.



## OpenAPI

````yaml /pt-br/api-reference/openapi.yaml post /bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound
openapi: 3.1.0
info:
  title: Bridge API
  summary: Especificação da API do Bridge para gerenciar o sistema de chat.
  description: >-
    Especificação da API REST de integrações do Bridge para gerenciar contatos,
    conversas, mensagens, arquivos, atributos personalizados, canais de
    provedores, modelos, usuários internos e Agents.


    Os webhooks são documentados separadamente em
    https://docs.bridge.new/pt-br/webhooks; este OpenAPI contém apenas endpoints
    REST.


    **Arquitetura multiempresa**: as operações sobre recursos são limitadas a um
    workspace específico por workspaceId. A verificação de integridade não
    inclui um workspace no caminho.
  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: Servidor de produção
security: []
paths:
  /bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound:
    post:
      tags:
        - Agents API
      summary: Iniciar conversa de saída com um Contact como Agent específico
      description: >-
        Inicia uma conversa de saída com um Contact conhecido, atendida pelo
        Agent indicado.


        Funciona com Agents LeadScout e Service. Primeiro é resolvido o Contact
        e depois o Agent, que deve existir no workspace e estar disponível
        (consulte `GET /agents`). O template é referenciado por `template.id` ou
        `template.name` (id tem precedência quando ambos são enviados), deve
        existir e estar APPROVED, e qualquer Bridge User de `handoffOverride`
        deve ser válido. Se `template.media.mediaId` for desconhecido, a
        solicitação falha com 400 `BRIDGE_AI_LEADSCOUT_0016` somente depois de a
        conversa ser criada ou recuperada, portanto uma nova tentativa após esse
        erro pode responder de forma diferente. As regras do corpo
        (`consent.status=GRANTED` sem `capturedAt`, ou `template.media` sem
        exatamente um de `mediaId` ou `url`) falham com 400 `BRIDGE_CORE_0103`.


        A conversa é aberta em uma das linhas ativas de WhatsApp do Agent, sob
        seu controle, com o template como primeira mensagem. A linha é escolhida
        nesta ordem:

        - Uma linha livre.

        - Caso contrário, uma linha com uma conversa liberada recuperável com
        este Contact. A recuperação retorna `recovered=true` e substitui o
        contexto de saída anterior e `agentContext`. Isso acontece mesmo com
        `forceSend=false`.

        - Se nenhuma linha estiver livre ou for recuperável: `forceSend=false`
        (padrão) falha com 409 `BRIDGE_AI_LEADSCOUT_0008`; `forceSend=true`
        reutiliza uma linha ocupada por uma conversa ativa com este Contact,
        dando preferência a uma controlada por este Agent. Se a conversa
        escolhida for controlada por outro Agent ou por um Bridge User, a
        chamada falha com 409 `BRIDGE_AI_AGENT_OUTBOUND_0006` e nada é gravado.
        Libere-a primeiro e tente novamente. Linhas cuja conversa está bloqueada
        ou foi liberada sem recuperação nunca são usadas; assim, se nenhuma
        linha estiver ocupada por uma conversa ativa, a chamada falha com 409
        `BRIDGE_AI_LEADSCOUT_0008` mesmo com `forceSend=true`.


        `contact.providerChannelId` é uma preferência: a linha indicada é usada
        quando está livre ou é recuperável; caso contrário, a mesma ordem é
        aplicada entre todas as linhas do Agent. Entre as linhas ocupadas, uma
        controlada por este Agent tem prioridade; se nenhuma for, a linha
        indicada é reutilizada (e pode falhar com 0006).


        A reutilização de uma conversa depende do tipo de Agent:

        - LeadScout: se sua sessão do LeadScout ainda estiver aberta e não
        expirada, a chamada falha com 409 `BRIDGE_AI_LEADSCOUT_0017` (`extra`
        inclui `conversationId`, `sessionId` e `stage`). Se uma sessão expirada
        não puder ser finalizada, falha com 409 `BRIDGE_AI_LEADSCOUT_0018`.

        - Service Agent: uma sessão de serviço aberta e não expirada continua;
        uma sessão expirada é encerrada como abandonada e uma nova é aberta.


        Consulte [o guia completo de saída](/pt-br/guides/agent-outbound) para
        os pré-requisitos, a tabela de decisão de forceSend, a recuperação, o
        trabalho parcial e as decisões seguras de nova tentativa.
      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: Identificador único do workspace (UUID v4).
            examples:
              - b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234
            title: Workspaceid
          description: Identificador único do workspace (UUID v4).
        - name: agentId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Identificador único do Agent (UUID v4), conforme `GET /agents`.
            examples:
              - 4e362e2b-67b2-4a7e-a9df-e9ecf9141be8
            title: Agentid
          description: Identificador único do Agent (UUID v4), conforme `GET /agents`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentOutboundRequest'
              description: >-
                Corpo da solicitação para iniciar uma conversa de saída atendida
                por um Agent específico.
      responses:
        '201':
          description: Resposta bem-sucedida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentOutboundResponse'
        '400':
          description: Solicitação inválida
          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: Acesso proibido
          content:
            application/json:
              examples:
                FORBIDDEN:
                  value:
                    title: Forbidden
                    status: 403
                    code: BRIDGE_CORE_0301
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: Não encontrado
          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: Conflito
          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: Conteúdo não processável
          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: Muitas solicitações
          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: >-
            Contact ao qual esta conversa de saída é direcionada. Já deve
            existir no workspace.
        template:
          $ref: '#/components/schemas/LeadscoutOutboundTemplateRef'
          title: Template
          description: Modelo inicial a ser enviado.
        additionalMessages:
          items:
            $ref: '#/components/schemas/AgentOutboundFollowUp'
          type: array
          maxItems: 5
          title: Additional Messages
          description: >-
            Até cinco acompanhamentos de texto armazenados na conversa após o
            modelo inicial, na ordem informada, e enviados como o modelo. Os
            anexos (`mediaIds`) ainda não são enviados.
        agentContext:
          anyOf:
            - $ref: '#/components/schemas/AgentOutboundContext'
            - type: 'null'
          title: Agent Context
          description: >-
            Notas e mídias opcionais armazenadas na conversa como contexto para
            o Agent.
        consent:
          anyOf:
            - $ref: '#/components/schemas/OutboundConsentRequest'
            - type: 'null'
          title: Consent
          description: >-
            Evidência opcional de consentimento, declarada pela empresa,
            registrada na conversa.
        handoffOverride:
          anyOf:
            - $ref: '#/components/schemas/AgentOutboundHandoffOverride'
            - type: 'null'
          title: Handoff Override
          description: >-
            Opcional. Pré-atribui um Bridge User específico como consultor para
            a transferência. O Bridge User é validado antes de qualquer
            gravação: a solicitação é rejeitada se o usuário não existir,
            pertencer a outro workspace ou tiver sido excluído.
        brandId:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand Identifier
          description: >-
            ID opcional da marca. Quando informado, apenas as linhas do Agent
            vinculadas à marca são elegíveis; se não houver nenhuma, a
            solicitação falha com 404. Omita para considerar todas as linhas do
            Agent.
          examples:
            - null
            - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
        campaignId:
          anyOf:
            - type: string
            - type: 'null'
          title: Campaign Identifier
          description: >-
            Referência opcional de campanha armazenada na conversa para
            auditoria e relatórios.
          examples:
            - null
            - spring_promo_2026
        forceSend:
          type: boolean
          title: Force Send
          description: >-
            Controla o que acontece quando nenhuma linha do Agent está livre ou
            é recuperável. Uma linha livre sempre tem prioridade, seguida de uma
            linha com uma conversa liberada recuperável com este Contact,
            qualquer que seja o valor desta opção. Quando nenhuma existe: com
            false (padrão), a solicitação falha com 409
            `BRIDGE_AI_LEADSCOUT_0008`; com true, uma linha ocupada por uma
            conversa ativa com este Contact é reutilizada, dando preferência a
            uma controlada por este Agent. Se a conversa escolhida for
            controlada por outro Agent ou por um Bridge User, a solicitação
            falha com 409 `BRIDGE_AI_AGENT_OUTBOUND_0006` e nada é gravado;
            libere-a primeiro e tente novamente. Linhas cuja conversa está
            bloqueada ou foi liberada sem recuperação nunca são usadas;
            portanto, se nenhuma linha estiver ocupada por uma conversa ativa, a
            solicitação falha com 409 `BRIDGE_AI_LEADSCOUT_0008` mesmo com true.
          default: false
          examples:
            - false
            - true
      type: object
      required:
        - contact
        - template
      title: AgentOutboundRequest
      description: >-
        Corpo da solicitação para iniciar uma conversa de saída atendida por um
        Agent específico.
    AgentOutboundResponse:
      properties:
        conversation:
          $ref: '#/components/schemas/ConversationResponse'
          title: Conversation
          description: >-
            Conversa agora controlada pelo Agent: nova, reutilizada
            (`alreadyInitiated`) ou recuperada (`recovered`).
        contact:
          $ref: '#/components/schemas/ContactResponse'
          title: Contact
          description: Contato com o qual a conversa foi iniciada.
        templateSent:
          anyOf:
            - $ref: '#/components/schemas/AgentTemplateSent'
            - type: 'null'
          title: Template Sent
          description: Resumo do modelo armazenado para abrir a conversa.
        additionalMessagesPersisted:
          type: integer
          title: Additional Messages Persisted
          description: Número de mensagens de acompanhamento armazenadas na conversa.
          default: 0
          examples:
            - 0
            - 3
        alreadyInitiated:
          type: boolean
          title: Already Initiated
          description: >-
            True quando esta solicitação bem-sucedida reutilizou uma conversa
            ativa existente por forceSend=true. False para criação ou
            recuperação; consulte recovered para distinguir esses caminhos. É
            informativo: uma reutilização bem-sucedida também armazena o novo
            modelo e os acompanhamentos, portanto repetir a solicitação pode
            adicionar mensagens.
          default: false
          examples:
            - false
            - true
        recovered:
          type: boolean
          title: Recovered
          description: >-
            True quando uma conversa liberada que o Contact tinha na linha foi
            recuperada em vez de criar outra. A recuperação substitui o contexto
            de saída anterior e `agentContext`. Linhas recuperáveis são usadas
            mesmo com `forceSend=false`.
          default: false
          examples:
            - false
            - true
      type: object
      required:
        - conversation
        - contact
      title: AgentOutboundResponse
      description: Corpo da resposta de uma iniciação de saída bem-sucedida do Agent.
    Problem:
      properties:
        title:
          type: string
          title: Title
          description: Resumo breve do tipo de problema.
        status:
          type: integer
          title: Status
          description: >-
            Código de status HTTP gerado pelo servidor de origem para esta
            ocorrência do problema.
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          description: Explicação específica desta ocorrência do problema.
        instance:
          anyOf:
            - type: string
            - type: 'null'
          title: Instance
          description: Referência URI que identifica esta ocorrência do problema.
        traceId:
          anyOf:
            - type: string
            - type: 'null'
          title: Traceid
          description: ID de rastreamento para depuração.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Código para identificar o erro; consulte a página de códigos de erro
            para mais detalhes.
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Errors
          description: Lista de detalhes dos erros.
        extra:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extra
          description: Informações adicionais sobre o problema.
      type: object
      required:
        - title
        - status
      title: Problem
      description: Objeto que representa o corpo de uma resposta Problem.
    AgentOutboundContactRef:
      properties:
        identifier:
          type: string
          title: Identifier
          description: >-
            Identificador do Contact conforme identifierType: ID do Contact para
            ID, e-mail para EMAIL ou telefone em formato E.164 para PHONE. O
            Contact já deve existir no workspace.
          examples:
            - '+573001234567'
        identifierType:
          $ref: '#/components/schemas/ParticipantIdentifierType'
          title: Identifier Type
          description: Tipo de identificador.
          examples:
            - PHONE
            - EMAIL
            - ID
        messageProviderType:
          $ref: '#/components/schemas/MessageProviderType'
          title: Message Provider Type
          description: Provedor usado para entregar o modelo.
          examples:
            - WHATSAPP
        providerChannelId:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Channel Identifier
          description: >-
            Opcional. Linha preferida do Agent (o `providerChannelId` de uma de
            suas `lines` em `GET /agents`). Se omitida, qualquer uma de suas
            linhas pode ser usada. Se informada, deve ser uma linha ativa do
            Agent; caso contrário, a solicitação falha com 422. É uma
            preferência, não uma garantia: se a linha não estiver livre nem for
            recuperável, a mesma ordem se aplica a todas as linhas do Agent (com
            `forceSend=true`, primeiro uma ocupada controlada por este Agent e
            depois a indicada). A resposta não identifica a linha utilizada.
          examples:
            - c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c
            - null
      type: object
      required:
        - identifier
        - identifierType
        - messageProviderType
      title: AgentOutboundContactRef
      description: Identifica o Contact ao qual a conversa de saída será direcionada.
    LeadscoutOutboundTemplateRef:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Template Identifier
          description: >-
            ID do modelo registrado (de GET /templates). Se id e name forem
            enviados, usa-se id.
          examples:
            - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
            - null
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Template Name
          description: >-
            Nome do modelo registrado e aprovado pela Meta a ser enviado.
            Obrigatório quando id não é enviado; ignorado quando id é enviado.
          examples:
            - leadscout_outbound_fb_v1
            - null
        orderedParams:
          items:
            type: string
          type: array
          title: Ordered Parameters
          description: >-
            Valores fornecidos pelo cliente para os slots de parâmetros do
            modelo com origem CALLER, em ordem de posição.
          examples:
            - - Maria
              - ACME
        parameters:
          additionalProperties:
            type: string
          type: object
          title: Parameters
          description: >-
            Valores fornecidos pelo cliente e indexados pela chave de variável
            do modelo (consulte GET /templates/{id} para obter as chaves), tanto
            para o corpo como para os botões. Prefira esta opção a orderedParams
            se o modelo tiver um botão dinâmico. Uma chave desconhecida ou que
            se sobreponha a um slot já coberto por orderedParams é rejeitada com
            422.
          examples:
            - recipient_first_name: Maria
              tracking_code: TRK123
        media:
          anyOf:
            - $ref: '#/components/schemas/OutboundTemplateMedia'
            - type: 'null'
          title: Header Media
          description: >-
            Mídia opcional de cabeçalho (imagem ou vídeo) a anexar à mensagem do
            modelo. Aceita um mediaId pré-carregado ou uma url pública.
      type: object
      title: LeadscoutOutboundTemplateRef
      description: Referencia o modelo aprovado pela Meta que abrirá a conversa.
    AgentOutboundFollowUp:
      properties:
        messageBody:
          type: string
          title: Message Body
          description: Corpo em texto simples da mensagem de acompanhamento.
          examples:
            - Just confirming we're still on for tomorrow at 10am.
        mediaIds:
          items:
            type: string
          type: array
          title: Media Identifiers
          description: >-
            Aceito, mas ainda não utilizado: os acompanhamentos são armazenados
            apenas como texto e os anexos não são enviados.
          examples:
            - []
            - - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
      type: object
      required:
        - messageBody
      title: AgentOutboundFollowUp
      description: >-
        Acompanhamento de texto armazenado na conversa logo após o modelo
        inicial.
    AgentOutboundContext:
      properties:
        notes:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Notes
          description: Notas em texto livre para o Agent, limitadas a 2000 caracteres.
          examples:
            - The Contact asked about pricing tiers last week.
            - null
        mediaIds:
          items:
            type: string
          type: array
          title: Media Identifiers
          description: >-
            Identificadores opcionais de arquivos pré-carregados armazenados na
            conversa como contexto para o Agent.
          examples:
            - []
            - - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
      type: object
      title: AgentOutboundContext
      description: >-
        Notas e mídias armazenadas na conversa como contexto para o Agent e os
        Bridge Users.
    OutboundConsentRequest:
      properties:
        status:
          $ref: '#/components/schemas/ConsentStatus'
          title: Status
          description: >-
            Estado de consentimento declarado pela empresa. Use GRANTED (com
            capturedAt) para consentimento explícito ou NOT_PROVIDED quando a
            empresa não tiver evidências a declarar.
          examples:
            - GRANTED
            - NOT_PROVIDED
        capturedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Captured At
          description: >-
            Data e hora ISO8601 (com milissegundos) em que a empresa obteve o
            consentimento. Obrigatório com status=GRANTED; null ou omissão são
            aceitos com status=NOT_PROVIDED.
          examples:
            - '2026-04-20T10:00:00.000Z'
            - null
      type: object
      required:
        - status
      title: OutboundConsentRequest
      description: >-
        Evidência de consentimento declarada pela empresa e registrada sem
        modificações na conversa.
    AgentOutboundHandoffOverride:
      properties:
        preAssignedUser:
          $ref: '#/components/schemas/AgentOutboundPreAssignedUser'
          title: Pre-assigned User
          description: >-
            Bridge User a ser atribuído como consultor quando o Agent transferir
            a conversa. Validado durante a solicitação: ela é rejeitada se o
            usuário não existir, pertencer a outro workspace ou tiver sido
            excluído.
          examples:
            - identifier: advisor@acme.com
              identifierType: EMAIL
      additionalProperties: false
      type: object
      required:
        - preAssignedUser
      title: AgentOutboundHandoffOverride
      description: >-
        Pré-atribui o Bridge User que recebe a transferência da conversa de
        saída.
    ConversationResponse:
      properties:
        id:
          type: string
          title: Identifier
          description: Identificador único da conversa (UUID v4).
          examples:
            - b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234
        workspaceId:
          type: string
          title: Workspace Identifier
          description: Identificador único do workspace (UUID v4).
          examples:
            - b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234
        participants:
          $ref: '#/components/schemas/ConversationParticipantsResponse'
          title: Participants
          description: Participantes da conversa.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Nome ou título opcional da conversa.
          examples:
            - Bridge Support Team
        status:
          anyOf:
            - $ref: '#/components/schemas/ConversationStatus'
            - type: 'null'
          title: Status
          description: >-
            Status atual da conversa: 'ACTIVE' para conversas visíveis e 'GHOST'
            para conversas invisíveis até a primeira interação.
          examples:
            - ACTIVE
        createdAt:
          type: string
          format: date-time
          title: Created At
          description: Data e hora de criação da conversa.
          examples:
            - '2003-04-10T09:00:00.000Z'
        updatedAt:
          type: string
          format: date-time
          title: Updated At
          description: Data e hora da última atualização da conversa.
          examples:
            - '2003-04-10T09:00:00.000Z'
      type: object
      required:
        - id
        - workspaceId
        - participants
        - createdAt
        - updatedAt
      title: ConversationResponse
      description: Corpo da resposta para os detalhes de uma conversa.
    ContactResponse:
      properties:
        id:
          type: string
          title: Identifier
          description: Identificador único do contato (UUID v4).
          examples:
            - b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234
        workspaceId:
          type: string
          title: Workspace Identifier
          description: Identificador único do workspace ao qual este contato pertence
          examples:
            - 92b2d4f3-81e1-4b61-a7ec-6f4ff3b58be5
        type:
          $ref: '#/components/schemas/ExternalUserType'
          title: Contact Type
          description: >-
            NORMAL quando todos os campos obrigatórios de identidade e atributos
            personalizados estão presentes; PARTIAL caso contrário.
          examples:
            - NORMAL
            - PARTIAL
        firstName:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
          description: Nome do contato.
          examples:
            - John
            - null
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
          description: Sobrenome do contato.
          examples:
            - Doe
            - null
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
          description: E-mail do contato.
          examples:
            - john.doe@example.com
            - null
        cellphone:
          anyOf:
            - type: string
              format: phone
            - type: 'null'
          title: Cellphone
          description: Número de celular do contato.
          examples:
            - '+14084029292'
            - null
        customAttributes:
          items:
            $ref: '#/components/schemas/CustomAttributeResponse'
          type: array
          title: Custom Attributes
          description: Lista de atributos personalizados de chave e valor.
        languageCode:
          anyOf:
            - $ref: '#/components/schemas/LanguageCode'
            - type: 'null'
          title: Language Code
          description: Código de idioma do usuário externo.
          examples:
            - EN
            - null
        ownerId:
          anyOf:
            - type: string
            - type: 'null'
          title: Owner Identifier
          description: >-
            ID do Bridge User proprietário do contato. Resolva-o com `GET
            /users/{userId}`.
          examples:
            - 37673840-6259-40f9-bbe5-a7db40f8e3cf
            - null
        createdAt:
          type: string
          title: Created At
          description: Data e hora de criação do contato.
          examples:
            - '2003-04-10T08:00:00.000Z'
        updatedAt:
          type: string
          title: Updated At
          description: Data e hora da última atualização do contato.
          examples:
            - '2003-04-10T08:00:00.000Z'
      type: object
      required:
        - id
        - workspaceId
        - type
        - createdAt
        - updatedAt
      title: ContactResponse
      description: Corpo da resposta para operações com contatos.
    AgentTemplateSent:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Template Identifier
          description: ID do modelo enviado.
          examples:
            - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
        name:
          type: string
          title: Template Name
          description: Nome do modelo despachado.
          examples:
            - leadscout_outbound_fb_v1
        messageId:
          anyOf:
            - type: string
            - type: 'null'
          title: Message Identifier
          description: >-
            ID da mensagem do Bridge referente ao modelo. Sempre presente; não é
            um `wamid` do WhatsApp.
          examples:
            - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
      type: object
      required:
        - name
      title: AgentTemplateSent
      description: Resumo do modelo armazenado para abrir a conversa.
    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: >-
            Tipo de mídia do cabeçalho. Deve corresponder ao tipo configurado
            para o modelo na Meta.
          examples:
            - IMAGE
            - VIDEO
        mediaId:
          anyOf:
            - type: string
            - type: 'null'
          title: Media Identifier
          description: >-
            UUID retornado por POST
            /bridge/api/v1/workspaces/{workspaceId}/files. Mutuamente exclusivo
            com url.
          examples:
            - null
            - 7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Source URL
          description: >-
            URL pública de origem obtida de forma assíncrona pelo serviço de
            download de arquivos por URL. Mutuamente exclusiva com mediaId.
          examples:
            - null
            - https://cdn.example.com/promo.jpg
      type: object
      required:
        - type
      title: OutboundTemplateMedia
      description: >-
        Mídia opcional de cabeçalho anexada à mensagem do modelo inicial.


        Forneça exatamente um: ``mediaId`` (UUID retornado por ``POST
        /bridge/api/v1/workspaces/{workspaceId}/files``) ou ``url`` (URL pública
        de origem obtida de forma assíncrona pelo serviço de download por URL).
    ConsentStatus:
      type: string
      enum:
        - GRANTED
        - NOT_PROVIDED
      title: ConsentStatus
    AgentOutboundPreAssignedUser:
      properties:
        identifier:
          type: string
          title: Identifier
          description: >-
            Valor que identifica o Bridge User, interpretado conforme
            identifierType.
          examples:
            - advisor@acme.com
            - usr_01HZ2K3J4M5N6P7Q8R9S0T1UV2
        identifierType:
          $ref: '#/components/schemas/InternalParticipantIdentifierType'
          title: Identifier Type
          description: >-
            Como resolver o identificador. ID busca pelo ID do Bridge User;
            EMAIL busca pelo e-mail.
          examples:
            - EMAIL
            - ID
      additionalProperties: false
      type: object
      required:
        - identifier
        - identifierType
      title: AgentOutboundPreAssignedUser
      description: Identifica o Bridge User que deve receber a transferência.
    ConversationParticipantsResponse:
      properties:
        externals:
          items:
            $ref: '#/components/schemas/ExternalParticipant'
          type: array
          title: Externals
          description: Lista de participantes externos.
        internals:
          items:
            $ref: '#/components/schemas/InternalParticipant'
          type: array
          title: Internals
          description: Lista de participantes internos.
      type: object
      required:
        - externals
        - internals
      title: ConversationParticipantsResponse
      description: Corpo da resposta para os participantes de uma conversa.
    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: Chave ou nome do atributo
        values:
          items:
            type: string
          type: array
          title: Values
          description: Valor do atributo
      type: object
      required:
        - key
      title: CustomAttributeResponse
      description: >-
        Corpo da resposta para atributos personalizados em operações com
        contatos.
    LanguageCode:
      type: string
      enum:
        - ES
        - EN
        - AF
        - SQ
        - AR
        - AZ
        - BN
        - BG
        - CA
        - ZH_CN
        - HR
        - CS
        - DA
        - NL
        - ET
        - FIL
        - FI
        - FR
        - KA
        - DE
        - EL
        - GU
        - HA
        - HE
        - HI
        - HU
        - ID
        - GA
        - IT
        - JA
        - KN
        - KK
        - RW_RW
        - KO
        - KY_KG
        - LO
        - LV
        - LT
        - MK
        - MS
        - ML
        - MR
        - NB
        - FA
        - PL
        - PT_BR
        - PA
        - RO
        - RU
        - SR
        - SK
        - SL
        - SW
        - SV
        - TA
        - TE
        - TH
        - TR
        - UK
        - UR
        - UZ
        - VI
        - ZU
      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: Valor do identificador do participante.
          examples:
            - ef7ee722-5f95-415a-9a98-81eeae178b11
        identifierType:
          type: string
          enum:
            - ID
            - EMAIL
            - PHONE
          title: Identifier Type
          description: >-
            Tipo de identificador de participantes externos (ID, EMAIL ou
            PHONE).
          examples:
            - EMAIL
            - PHONE
            - ID
        role:
          $ref: '#/components/schemas/UserType'
          title: Role
          description: Papel do participante na conversa.
          examples:
            - EXTERNAL
            - INTERNAL
        joinedAt:
          type: string
          format: date-time
          title: Joined At
          description: Data e hora em que o participante entrou na conversa.
          examples:
            - '2004-04-10T09:00:00.000Z'
        lastSeenAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Seen At
          description: Data e hora da última atividade observada do participante.
          examples:
            - null
            - '2004-04-10T09:00:00.000Z'
      type: object
      required:
        - identifier
        - identifierType
        - role
        - joinedAt
      title: Participant
      description: Objeto que representa o participante externo da conversa.
    InternalParticipant:
      properties:
        identifier:
          type: string
          title: Identifier
          description: Valor do identificador do participante.
          examples:
            - ef7ee722-5f95-415a-9a98-81eeae178b11
        identifierType:
          $ref: '#/components/schemas/InternalParticipantIdentifierType'
          title: Identifier Type
          description: Tipo de identificador de participantes internos (ID ou EMAIL).
          examples:
            - EMAIL
            - ID
        role:
          $ref: '#/components/schemas/UserType'
          title: Role
          description: Papel do participante na conversa.
          examples:
            - EXTERNAL
            - INTERNAL
        joinedAt:
          type: string
          format: date-time
          title: Joined At
          description: Data e hora em que o participante entrou na conversa.
          examples:
            - '2004-04-10T09:00:00.000Z'
        lastSeenAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Seen At
          description: Data e hora da última atividade observada do participante.
          examples:
            - null
            - '2004-04-10T09:00:00.000Z'
      type: object
      required:
        - identifier
        - identifierType
        - role
        - joinedAt
      title: Participant
      description: Objeto que representa o participante interno da conversa.
    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.