> ## 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/pipeline-records, /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.
> Pipeline records are created only for an existing Contact (never upserted). POST /records, /move and /reopen require Idempotency-Key; PATCH, move and reopen take an optional expectedRevision in the body. Stage actions run every time a record enters a stage, including records created in bulk. Use /guides/pipeline-records and /webhooks/pipeline-records.
> 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.

# Send a template

> Send one WhatsApp provider template into an existing conversation, as one message read by every WhatsApp Contact of
the conversation. The sender is the API key, shown in Bridge with its sender name. To start a conversation with a
template, use `POST /bridge/api/v1/workspaces/{workspaceId}/conversations` with `onboardingTemplates`.

The conversation must be active, not handled by an Agent, and have a WhatsApp Contact. Send the template by
`template.id`, approved for the line and language of every WhatsApp Contact, with `template.parameters` keyed as
`GET /bridge/api/v1/workspaces/{workspaceId}/templates/{templateId}` returns them.

A marketing or utility template is refused while a Contact of the conversation is inside the workspace's promotional
cooldown: 409 `BRIDGE_CONVERSATION_0406`, with the wait in seconds in `Retry-After`. It also opens a conversation that
has no opening template yet. The `Idempotency-Key` header is required and kept for 24 hours: the same key with the
same send answers 201 with `Idempotent-Replayed: true` and sends nothing again. A 201 means Bridge stored the message
for sending; see [Responses and retries](/guides/responses).

Every 4xx error code is listed under the responses. What to do for each one:
[Send a template](/guides/send-template#if-the-request-is-rejected).



## OpenAPI

````yaml /api-reference/openapi.yaml post /bridge/api/v1/workspaces/{workspaceId}/conversations/{conversationId}/send-template
openapi: 3.1.0
info:
  title: Bridge API
  summary: Bridge API specification for chat system management.
  description: >-
    Bridge REST Integrations API specification for managing contacts,
    conversations, messages, files, custom attributes, provider channels,
    templates, internal users, and Agents.


    Webhooks are documented separately at https://docs.bridge.new/webhooks; this
    OpenAPI contains REST endpoints only.


    **Multi-Tenant Architecture**: Resource operations are scoped to a specific
    workspace using workspaceId. The health check does not have a workspace
    path.
  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}/conversations/{conversationId}/send-template:
    post:
      tags:
        - Conversations API
      summary: Send a template
      description: >-
        Send one WhatsApp provider template into an existing conversation, as
        one message read by every WhatsApp Contact of

        the conversation. The sender is the API key, shown in Bridge with its
        sender name. To start a conversation with a

        template, use `POST
        /bridge/api/v1/workspaces/{workspaceId}/conversations` with
        `onboardingTemplates`.


        The conversation must be active, not handled by an Agent, and have a
        WhatsApp Contact. Send the template by

        `template.id`, approved for the line and language of every WhatsApp
        Contact, with `template.parameters` keyed as

        `GET /bridge/api/v1/workspaces/{workspaceId}/templates/{templateId}`
        returns them.


        A marketing or utility template is refused while a Contact of the
        conversation is inside the workspace's promotional

        cooldown: 409 `BRIDGE_CONVERSATION_0406`, with the wait in seconds in
        `Retry-After`. It also opens a conversation that

        has no opening template yet. The `Idempotency-Key` header is required
        and kept for 24 hours: the same key with the

        same send answers 201 with `Idempotent-Replayed: true` and sends nothing
        again. A 201 means Bridge stored the message

        for sending; see [Responses and retries](/guides/responses).


        Every 4xx error code is listed under the responses. What to do for each
        one:

        [Send a template](/guides/send-template#if-the-request-is-rejected).
      operationId: >-
        send_template_bridge_api_v1_workspaces__workspaceId__conversations__conversationId__send_template_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: conversationId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Unique identifier of the conversation (UUID v4).
            examples:
              - 4e362e2b-67b2-4a7e-a9df-e9ecf9141be8
            title: Conversationid
          description: Unique identifier of the conversation (UUID v4).
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 255
            description: >-
              Required. A key you choose for each send, 1 to 255 characters,
              such as your system's operation id. Send the same key to retry
              that send: for 24 hours Bridge answers with the message the first
              request stored instead of sending again.
            examples:
              - erp-order-981-shipped
            title: Idempotency-Key
          description: >-
            Required. A key you choose for each send, 1 to 255 characters, such
            as your system's operation id. Send the same key to retry that send:
            for 24 hours Bridge answers with the message the first request
            stored instead of sending again.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendTemplateRequest'
              description: >-
                Request body to send a provider template into an existing
                conversation.
      responses:
        '201':
          description: >-
            Bridge stored the message for sending, or an earlier request with
            the same `Idempotency-Key` did. See [Responses and
            retries](/guides/responses).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendTemplateResponse'
          headers:
            Idempotent-Replayed:
              description: >-
                `true` when the message comes from a previous request with the
                same key.
              schema:
                type: string
                enum:
                  - 'true'
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                PRELOAD_FILE_IS_PENDING:
                  value:
                    title: Preload file is pending
                    status: 400
                    code: BRIDGE_PRELOAD_FILE_0002 | PRELOAD_FILE_IS_PENDING
                PROVIDER_TEMPLATE_NOT_APPROVED:
                  value:
                    title: Provider Template Not Approved
                    status: 400
                    code: BRIDGE_TEMPLATE_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:
                PROVIDER_TEMPLATE_NOT_FOUND:
                  value:
                    title: Provider Template Not Found
                    status: 404
                    code: BRIDGE_TEMPLATE_0001
                PRELOAD_FILE_NOT_FOUND:
                  value:
                    title: Preload file was not found
                    status: 404
                    code: BRIDGE_PRELOAD_FILE_0001 | PRELOAD_FILE_NOT_FOUND
                CONVERSATION_NOT_FOUND:
                  value:
                    title: Conversation Not Found
                    status: 404
                    code: BRIDGE_CONVERSATION_0001
              schema:
                $ref: '#/components/schemas/Problem'
        '409':
          description: Conflict
          content:
            application/json:
              examples:
                IDEMPOTENCY_REQUEST_IN_PROGRESS:
                  value:
                    title: Idempotency Request In Progress
                    status: 409
                    code: BRIDGE_CORE_1201
                CONVERSATION_IS_RELEASED:
                  value:
                    title: Conversation Is Released
                    status: 409
                    code: BRIDGE_CONVERSATION_0007
                CONVERSATION_CONTROLLED_BY_AGENT:
                  value:
                    title: Conversation Controlled By Agent
                    status: 409
                    code: BRIDGE_CONVERSATION_0011
                CONVERSATION_NOT_ACTIVE:
                  value:
                    title: Conversation Not Active
                    status: 409
                    code: BRIDGE_CONVERSATION_0004
                TEMPLATE_COOLDOWN_ACTIVE:
                  value:
                    title: Template Cooldown Active
                    status: 409
                    code: BRIDGE_CONVERSATION_0406
                ONBOARDING_REQUIRED:
                  value:
                    title: Onboarding Required
                    status: 409
                    code: BRIDGE_CONVERSATION_0609
                OPENING_TEMPLATE_IN_FLIGHT:
                  value:
                    title: Opening Template In Flight
                    status: 409
                    code: BRIDGE_CONVERSATION_0613
              schema:
                $ref: '#/components/schemas/Problem'
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying. Present when the cooldown
                refuses the send (`BRIDGE_CONVERSATION_0406`).
              schema:
                type: integer
                minimum: 1
        '422':
          description: Unprocessable Content
          content:
            application/json:
              examples:
                INVALID_FIELD_FORMAT:
                  value:
                    title: Invalid Field Format
                    status: 422
                    code: BRIDGE_CORE_0101
                IDEMPOTENCY_KEY_REUSED:
                  value:
                    title: Idempotency Key Reused
                    status: 422
                    code: BRIDGE_CORE_1202
                EXTERNAL_PARTICIPANTS_REQUIRED:
                  value:
                    title: External Participants Required
                    status: 422
                    code: BRIDGE_CONVERSATION_0201
                CONTACT_SEND_REJECTED:
                  value:
                    title: Consent Contact Send Rejected
                    status: 422
                    code: BRIDGE_COMMERCIAL_CONSENT_0203
                PROVIDER_TEMPLATE_MISSING_VARIABLES:
                  value:
                    title: Provider Template Missing Variables
                    status: 422
                    code: BRIDGE_TEMPLATE_0007
                PROVIDER_TEMPLATE_UNKNOWN_VARIABLES:
                  value:
                    title: Provider Template Unknown Variables
                    status: 422
                    code: BRIDGE_TEMPLATE_0010
                PROVIDER_TEMPLATE_INVALID_VARIABLE_VALUES:
                  value:
                    title: Provider Template Invalid Variable Values
                    status: 422
                    code: BRIDGE_TEMPLATE_0009
                PROVIDER_TEMPLATE_HEADER_MEDIA_NOT_ACCEPTED:
                  value:
                    title: Provider Template Header Media Not Accepted
                    status: 422
                    code: BRIDGE_TEMPLATE_0011
                PROVIDER_TEMPLATE_HEADER_MEDIA_MISMATCH:
                  value:
                    title: Provider Template Header Media Mismatch
                    status: 422
                    code: BRIDGE_TEMPLATE_0012
                PROVIDER_TEMPLATE_HEADER_MEDIA_REQUIRED:
                  value:
                    title: Provider Template Header Media Required
                    status: 422
                    code: BRIDGE_TEMPLATE_0013
              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:
    SendTemplateRequest:
      properties:
        template:
          $ref: '#/components/schemas/SendTemplateRef'
          title: Template
          description: The provider template to send and the values of its variables.
      additionalProperties: false
      type: object
      required:
        - template
      title: SendTemplateRequest
      description: Request body to send a provider template into an existing conversation.
    SendTemplateResponse:
      properties:
        conversationId:
          type: string
          title: Conversation Identifier
          description: Identifier of the conversation the template was sent into.
          examples:
            - 7d4a1f2e-3b5c-4d6e-8f9a-0b1c2d3e4f5a
        messageId:
          type: string
          title: Message Identifier
          description: >-
            Identifier of the message Bridge stored for the template. It is one
            message, read by every WhatsApp Contact of the conversation.
          examples:
            - b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234
        templateId:
          type: string
          title: Template Identifier
          description: Identifier of the template that was sent.
          examples:
            - 4061e74e-f6fe-4072-a760-3aec0b64f7a6
        templateName:
          type: string
          title: Template Name
          description: Name of the template that was sent.
          examples:
            - order_shipped_promo
      type: object
      required:
        - conversationId
        - messageId
        - templateId
        - templateName
      title: SendTemplateResponse
      description: >-
        The message Bridge stored for sending the template into the
        conversation.
    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.
    SendTemplateRef:
      properties:
        id:
          type: string
          maxLength: 255
          minLength: 1
          title: Template Identifier
          description: >-
            Required. Identifier of the provider template, as `id` returns it in
            `GET
            /bridge/api/v1/workspaces/{workspaceId}/templates/{templateId}`. A
            blank `id`, or one that matches no provider template of the
            workspace, fails: 422 for a blank one and 404 `BRIDGE_TEMPLATE_0001`
            for an unknown one. The request takes no template `name`.
          examples:
            - 4061e74e-f6fe-4072-a760-3aec0b64f7a6
        parameters:
          additionalProperties:
            type: string
            maxLength: 1024
          propertyNames:
            maxLength: 128
          type: object
          maxProperties: 50
          title: Template Parameters
          description: >-
            Values for the template's variables, keyed by the variable `key`
            that `GET
            /bridge/api/v1/workspaces/{workspaceId}/templates/{templateId}`
            returns. Variables marked `callerMustSupply: true` are required: a
            missing or blank one fails with 422 `BRIDGE_TEMPLATE_0007`. The
            others are optional, and a value sent for one replaces the
            per-Contact value for every Contact in the conversation. A key that
            is not a variable of the template, or any key when the template
            takes no parameters, fails with 422 `BRIDGE_TEMPLATE_0010`. A value
            that breaks WhatsApp's rules fails with 422 `BRIDGE_TEMPLATE_0009`.
            Absent and `{}` are the same request. At most 50 parameters, with
            keys up to 128 characters and each value up to 1,024 characters.
          examples:
            - delivery_date: 3 de octubre
              order_number: A-10492
        media:
          anyOf:
            - $ref: '#/components/schemas/SendTemplateMedia'
            - type: 'null'
          title: Header Media
          description: >-
            The file to send as the template's header (the image, video, GIF or
            PDF document shown at the top of the message), in place of the
            header configured on the template. Send its `type` and either
            `mediaId` (upload it first with `POST
            /bridge/api/v1/workspaces/{workspaceId}/files`; see [Send an
            attachment](/guides/send-attachments)) or `url`. With `url`, Bridge
            downloads the file asynchronously: the result of the download is not
            part of the 201 response, and a download that fails is not reported
            in it. Omit `media` and the header configured on the template goes
            out. Fails with 422 `BRIDGE_TEMPLATE_0011` when the template has no
            media header, and with 422 `BRIDGE_TEMPLATE_0012` when `type` (or
            the type of the uploaded file) is not the type of the header. A
            `mediaId` that is not a file of the workspace fails with 404
            `BRIDGE_PRELOAD_FILE_0001 | PRELOAD_FILE_NOT_FOUND`, and one that is
            not usable yet (still uploading, or its upload was cancelled) with
            400 `BRIDGE_PRELOAD_FILE_0002 | PRELOAD_FILE_IS_PENDING`. A template
            with a media header (image, video, GIF or document) that has no file
            configured on it needs `media`: without it the request fails with
            422 `BRIDGE_TEMPLATE_0013`. WhatsApp can still refuse a file larger
            than its limits for a header after the 201.
      additionalProperties: false
      type: object
      required:
        - id
      title: SendTemplateRef
      description: >-
        The provider template to send, found by its `id`, and the values of its
        variables.
    SendTemplateMedia:
      properties:
        type:
          $ref: '#/components/schemas/HeaderFileType'
          title: Media Type
          description: >-
            The kind of file: `IMAGE`, `VIDEO`, `GIF` or `DOCUMENT`. It must be
            the type of the template's header (the file shown at the top of the
            message), in the template's language and in the language of each
            Contact, or the request fails with 422 `BRIDGE_TEMPLATE_0012`. With
            `mediaId`, the uploaded file must have that type too. A `DOCUMENT`
            header must be a PDF: an uploaded file of another document format
            fails with 422 `BRIDGE_TEMPLATE_0012`, and a `url` that is not a PDF
            is not checked before the download.
          examples:
            - IMAGE
        mediaId:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Media Identifier
          description: >-
            The `mediaId` that `POST
            /bridge/api/v1/workspaces/{workspaceId}/files` returned for the
            file, once its upload finished. The file must belong to the
            workspace. Send `mediaId` or `url`, not both.
          examples:
            - 9b2f6a52-1f3c-4a53-8f58-3c6a2e7d1b10
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Media URL
          description: >-
            A public `https` URL of the file. Bridge downloads it
            asynchronously: the result of the download is not part of the 201
            response, so a download that fails is not reported in it. Send
            `mediaId` or `url`, not both.
          examples:
            - https://cdn.example.com/promo/spring-sale.png
      additionalProperties: false
      type: object
      required:
        - type
      title: SendTemplateMedia
      description: >-
        The image, video, GIF or PDF document to show at the top of the template
        message: its `type` and exactly one source.


        The source is `mediaId` (a file already uploaded to Bridge) or `url` (a
        file Bridge downloads).
    HeaderFileType:
      type: string
      enum:
        - IMAGE
        - VIDEO
        - GIF
        - DOCUMENT
      title: HeaderFileType
  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.