> ## 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 two integration surfaces: the REST Integrations API for pushing data into Bridge, and webhooks for receiving events from Bridge.
> The API host is https://api-connect-us.bridge.new. Do not use any other host.
> Authenticate every API request with the x-api-key header. Bridge does not use bearer tokens or OAuth.
> Error codes follow the BRIDGE_<DOMAIN>_<NNNN> format, for example BRIDGE_CONVERSATION_0001. Never invent a code that is not listed on the error codes page.
> This documentation covers the Integrations API only. It does not describe the Bridge web application or its internal APIs.

# Discover a template's agnostic variable inventory

> Return a template's variables — agnostic `key`/`label`/`callerMustSupply`, never a Meta slot address or index.

`templateId` accepts either the template's `id` or its `name` — the send contract
(`POST .../leadscout/outbound`) identifies a template by `name`; this discovery endpoint
also accepts `id`, so a caller who only has one of the two can still look it up.

A variable with `callerMustSupply: true` has no declared source — the caller must include
its `key` in `parameters` when sending, or the send fails with a 422 naming that same `key`.
A variable with `callerMustSupply: false` is either resolved by Bridge on its own (e.g. the
recipient's first name) or already has a value the caller may optionally override.

Error codes:
- BRIDGE_CORE_0301: workspace in the path does not match the caller's own workspace (403)
- BRIDGE_TEMPLATE_0001: no PROVIDER_TEMPLATE found for this workspace and identifier — covers
  an unknown id/name, a template that belongs to another workspace, and a template that is
  not a PROVIDER_TEMPLATE, identically (404); this endpoint never confirms the existence of
  a template outside the caller's own workspace



## OpenAPI

````yaml /api-reference/openapi.yaml get /bridge/api/v1/workspaces/{workspaceId}/templates/{templateId}
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}/templates/{templateId}:
    get:
      tags:
        - Templates API
      summary: Discover a template's agnostic variable inventory
      description: >-
        Return a template's variables — agnostic
        `key`/`label`/`callerMustSupply`, never a Meta slot address or index.


        `templateId` accepts either the template's `id` or its `name` — the send
        contract

        (`POST .../leadscout/outbound`) identifies a template by `name`; this
        discovery endpoint

        also accepts `id`, so a caller who only has one of the two can still
        look it up.


        A variable with `callerMustSupply: true` has no declared source — the
        caller must include

        its `key` in `parameters` when sending, or the send fails with a 422
        naming that same `key`.

        A variable with `callerMustSupply: false` is either resolved by Bridge
        on its own (e.g. the

        recipient's first name) or already has a value the caller may optionally
        override.


        Error codes:

        - BRIDGE_CORE_0301: workspace in the path does not match the caller's
        own workspace (403)

        - BRIDGE_TEMPLATE_0001: no PROVIDER_TEMPLATE found for this workspace
        and identifier — covers
          an unknown id/name, a template that belongs to another workspace, and a template that is
          not a PROVIDER_TEMPLATE, identically (404); this endpoint never confirms the existence of
          a template outside the caller's own workspace
      operationId: >-
        get_template_discovery_bridge_api_v1_workspaces__workspaceId__templates__templateId__get
      parameters:
        - name: workspaceId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Unique identifier of the workspace (UUID v4).
            examples:
              - 5b1e3b8a-9e0a-4b7d-9d2a-3d2f1a5c8e11
            title: Workspaceid
          description: Unique identifier of the workspace (UUID v4).
        - name: templateId
          in: path
          required: true
          schema:
            type: string
            description: Template id or name — either identifies the same template.
            examples:
              - order_shipped_promo
              - f0000040-0000-4000-8000-000000000040
            title: Templateid
          description: Template id or name — either identifies the same template.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateDiscoveryResponse'
        '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
              schema:
                $ref: '#/components/schemas/Problem'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - x-api-key: []
components:
  schemas:
    TemplateDiscoveryResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the template.
          examples:
            - f0000040-0000-4000-8000-000000000040
        name:
          type: string
          title: Name
          description: Name of the template, used to identify it when sending.
          examples:
            - order_shipped_promo
        language:
          type: string
          title: Language
          description: Language of the resolved pivot (the template's default language).
          examples:
            - es
        variables:
          items:
            $ref: '#/components/schemas/TemplateVariableResponse'
          type: array
          title: Variables
          description: Agnostic inventory of this template's variables.
        driftWarning:
          $ref: '#/components/schemas/TemplateDriftWarningResponse'
          title: Drift warning
          description: >-
            Diagnostic-only declaration-vs-snapshot mismatch. Never blocks a
            send.
      type: object
      required:
        - id
        - name
        - language
        - driftWarning
      title: TemplateDiscoveryResponse
      description: >-
        Agnostic inventory of a template's variables, for a caller that must
        send it without knowing Meta's model.
      examples:
        - id: f0000040-0000-4000-8000-000000000040
          language: es
          name: order_shipped_promo
          variables:
            - callerMustSupply: false
              key: first_name
              label: Contact first name
            - callerMustSupply: false
              key: order_code
              label: Order code
            - callerMustSupply: false
              key: shipment_id
              label: Shipment ID
            - callerMustSupply: true
              key: promo_code
              label: Promo code
    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
    TemplateVariableResponse:
      properties:
        key:
          type: string
          title: Key
          description: Agnostic identifier for this variable, stable across providers.
          examples:
            - tracking_code
        label:
          type: string
          title: Label
          description: Human-readable label for this variable.
          examples:
            - Tracking code
        callerMustSupply:
          type: boolean
          title: Caller must supply
          description: >-
            Whether the caller must supply a value for this variable when
            sending the template (true when the template has no declared source
            for it — e.g. a promo code only the caller knows; false when Bridge
            resolves it on its own, e.g. from the recipient's profile).
          examples:
            - true
            - false
      type: object
      required:
        - key
        - label
        - callerMustSupply
      title: TemplateVariableResponse
      description: >-
        One template variable, identified by its agnostic key — no Meta slot
        address ever appears here.
      examples:
        - callerMustSupply: false
          key: first_name
          label: Contact first name
        - callerMustSupply: false
          key: tracking_code
          label: Tracking code
        - callerMustSupply: true
          key: promo_code
          label: Promo code
    TemplateDriftWarningResponse:
      properties:
        hasDrift:
          type: boolean
          title: Has drift
        stale:
          items:
            $ref: '#/components/schemas/TemplateVariableRef'
          type: array
          title: Stale
          description: Declared but no longer required by the snapshot.
        missingLabels:
          items:
            $ref: '#/components/schemas/TemplateVariableRef'
          type: array
          title: Missing labels
          description: Required by the snapshot but not yet declared.
      type: object
      required:
        - hasDrift
      title: TemplateDriftWarningResponse
      description: >-
        Diagnostic-only mismatch between the declared variables and what the
        Meta snapshot requires.


        Per the authority rule, this never affects whether a send succeeds — the
        snapshot alone

        decides that. It exists so a caller (or the console) can flag a template
        whose labels need

        refreshing after an edit made directly in WhatsApp Manager.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TemplateVariableRef:
      properties:
        key:
          type: string
          title: Key
          examples:
            - delivery_date
        label:
          type: string
          title: Label
          examples:
            - Delivery date
      type: object
      required:
        - key
        - label
      title: TemplateVariableRef
      description: A slot identified only by its agnostic key/label — no Meta slot address.
  securitySchemes:
    x-api-key:
      type: apiKey
      description: Copy the API key as provided by the Bridge Console.
      in: header
      name: x-api-key

````