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

# Assistant WhatsApp Chat

> Start a WhatsApp conversation with a customer from the business side. This endpoint:
1. Validates that `from` is a WhatsApp number on your account whose messaging profile has this assistant configured
2. Creates a new `whatsapp_chat` conversation with the provided metadata
3. Asks the assistant to pick one of its approved WhatsApp templates and fill its variables from `content`
4. Sends the template from `from` to `to`
5. Returns the conversation ID and the message ID

When the customer replies, the reply is routed to the same conversation and the assistant answers within the 24-hour customer service window. The assistant needs a `whatsapp_template` tool with at least one approved template, data retention enabled and PII redaction disabled.



## OpenAPI

````yaml /openapi/source/external/inference/inference-embedding.json post /ai/assistants/{assistant_id}/chat/whatsapp
openapi: 3.1.0
info:
  version: 2.0.0
  title: Telnyx API
  x-latency-category: responsive
  x-endpoint-cost: light
  description: SIP trunking, SMS, MMS, Call Control and Telephony Data Services.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
    description: Version 2.0.0 of the Telnyx API
security:
  - bearerAuth: []
tags:
  - name: Chat
    description: Generate text with LLMs
  - name: Assistants
    description: Configure AI assistant specifications
  - name: Conversations
    description: Manage historical AI assistant conversations
  - name: File-based Text-to-Speech
    description: Turn audio into text or text into audio.
  - name: Embeddings
    description: Embed documents and perform text searches
  - name: Clusters
    description: Identify common themes and patterns in your embedded documents
  - name: Fine Tuning
    description: Customize LLMs for your unique needs
  - name: OpenAI Embeddings
    description: >-
      OpenAI-compatible embeddings endpoints for generating vector
      representations of text
paths:
  /ai/assistants/{assistant_id}/chat/whatsapp:
    post:
      tags:
        - Assistants
      summary: Assistant WhatsApp Chat
      description: >-
        Start a WhatsApp conversation with a customer from the business side.
        This endpoint:

        1. Validates that `from` is a WhatsApp number on your account whose
        messaging profile has this assistant configured

        2. Creates a new `whatsapp_chat` conversation with the provided metadata

        3. Asks the assistant to pick one of its approved WhatsApp templates and
        fill its variables from `content`

        4. Sends the template from `from` to `to`

        5. Returns the conversation ID and the message ID


        When the customer replies, the reply is routed to the same conversation
        and the assistant answers within the 24-hour customer service window.
        The assistant needs a `whatsapp_template` tool with at least one
        approved template, data retention enabled and PII redaction disabled.
      operationId: assistant_whatsapp_chat_assistants__assistant_id__chat_whatsapp_post
      parameters:
        - name: assistant_id
          in: path
          description: >-
            Unique identifier of the assistant. Must be the assistant configured
            on the messaging profile of the `from` number.
          required: true
          schema:
            type: string
            title: Assistant Id
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssistantWhatsappChatReq'
            example:
              from: '+13125550001'
              to: '+13125550002'
              content: Send the login verification code 482913 to the customer.
              conversation_metadata:
                order_id: A1
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssistantWhatsappChatResponse'
              example:
                conversation_id: 59f1f39e-180c-4f5d-81e9-393b46ca4077
                message_id: 4031a0e8-f724-4e22-a086-0f18720ac829
          headers:
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
        '400':
          description: >-
            Bad Request. Missing required fields or a reserved
            `conversation_metadata` key, or the assistant is not the one
            configured on the messaging profile of `from` (10015). Invalid JSON
            (10023). A field of the wrong type, for example a non-string `from`,
            `to` or `content`, or a `conversation_metadata` value that is not a
            string, integer or boolean (10026). `from` is not a valid WhatsApp
            number on a messaging profile (40305). `to` is not a valid E.164
            number or BSUID (40310). Invalid, duplicate, empty, malformed, or
            overlong Idempotency-Key headers are rejected by Edge with HTTP 400
            and error code 10015.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication Failed (10009). The API key is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden. The `from` number is not associated with your account
            (10010), messaging is disabled on the account (40314), or the
            account is inactive (20012), blocked (20013) or unverified (20014).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found (10005). The assistant does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            Conflict. The messaging profile of `from` is disabled (40312), or a
            request with the same Idempotency-Key is still being processed
            (10036), in which case retry later with the same key and request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                errors:
                  - code: '10036'
                    title: Resource is being processed
                    detail: >-
                      A request with this Idempotency-Key is already being
                      processed.
                    source:
                      pointer: /header/Idempotency-Key
        '413':
          description: >-
            Payload Too Large. A request sent with an Idempotency-Key whose body
            exceeds the endpoint's Edge replay-protection limit (256 KB) is
            rejected before it reaches the service. Requests sent without the
            header are not subject to this limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Unprocessable Entity (10027). The assistant did not return a
            WhatsApp template, or its privacy settings do not allow storing
            conversations. Reusing an Idempotency-Key with a different request
            body also returns 422 with error code 10027.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: >-
            Service Unavailable (10037). The assistant could not be looked up,
            the conversation could not be started, or the template could not be
            sent. Retry the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Optional opaque, unquoted key for safely retrying the same logical
        request. Keys must contain 1 to 255 letters, numbers, hyphens, or
        underscores. Generate a unique UUID v4 for each operation and reuse it
        only when retrying that operation with the same request. Invalid
        headers—including duplicate, empty, malformed, or overlong values—return
        400 with error code 10015. A request already in progress with the same
        key returns 409; reusing the key with a different request returns 422.
        Only successful responses are replayed, for up to 24 hours. Do not
        include sensitive data in the key.
      schema:
        type: string
        minLength: 1
        maxLength: 255
        pattern: ^[A-Za-z0-9_-]{1,255}$
      example: 8e03978e-40d5-43e8-bc93-6894a57f9326
  schemas:
    AssistantWhatsappChatReq:
      properties:
        from:
          type: string
          title: From
          description: >-
            WhatsApp number on your account to send from, in E.164 format. Its
            messaging profile must have this assistant configured.
        to:
          type: string
          title: To
          description: >-
            Customer to message, as an E.164 phone number or a WhatsApp
            business-scoped user ID (BSUID).
        content:
          type: string
          title: Content
          description: >-
            Instruction for the assistant, including the values for the template
            variables, e.g. `Send the login verification code 482913 to the
            customer.`
        conversation_metadata:
          title: Conversation Metadata
          description: >-
            Metadata stored on the conversation. Keys starting with `telnyx_`
            and the `assistant_id` key are reserved.
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
          type: object
      type: object
      required:
        - from
        - to
        - content
      title: AssistantWhatsappChatReq
    AssistantWhatsappChatResponse:
      properties:
        conversation_id:
          title: Conversation Id
          type: string
          description: ID of the conversation created for this WhatsApp chat.
        message_id:
          title: Message Id
          type: string
          description: ID of the WhatsApp template message that was sent.
      type: object
      required:
        - conversation_id
        - message_id
      title: AssistantWhatsappChatResponse
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorObject'
      required:
        - errors
    ErrorObject:
      type: object
      properties:
        code:
          type: string
          description: >-
            Telnyx error code. Edge idempotency errors use 10015, 10027, or
            10036; idempotency protection outages use 10016; replay-cap 413s
            surface 10007. Fallback 404/500 responses from the framework may use
            string status codes ('404', '500') instead.
          enum:
            - '10007'
            - '10015'
            - '10016'
            - '10027'
            - '10036'
            - '404'
            - '500'
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              type: string
      required:
        - code
        - title
  headers:
    IdempotentReplayed:
      description: >-
        Present with value `true` when Edge replayed a stored successful
        response for the supplied Idempotency-Key. Omitted for first-time
        requests and error responses.
      schema:
        type: boolean
        enum:
          - true
        example: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````