> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inbox.adraa.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit a WhatsApp template

> Submits a new message template for WhatsApp approval using a connected account in your workspace. Supports utility and marketing templates with a text body, optional text header/footer, and quick reply, website, or phone buttons. Approval is asynchronous; a successful submission does not mean the template is approved and does not send a message. Check its status under Settings → Templates. GET /api/v1/whatsapp/templates lists approved templates only.

For a dynamic website button, end the URL with {{1}} and provide one full example URL with a sample value in place of the placeholder. When sending the approved template, use buttonParameters with subtype url to supply the variable suffix. Authentication templates and media headers are not supported by this submission endpoint.

Rate limit: 30 requests per minute per IP.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/whatsapp/templates
openapi: 3.1.0
info:
  title: Adraa Inbox API
  description: >-
    Public REST API for Adraa Inbox. Assign agents to conversations and send
    messages from your own systems. Authenticate every request with a workspace
    API token.
  version: 1.0.0
  contact:
    email: support@adraa.ai
servers:
  - url: https://api.inbox.adraa.ai
    description: Production
security:
  - apiToken: []
paths:
  /api/v1/whatsapp/templates:
    post:
      summary: Submit a WhatsApp template
      description: >-
        Submits a new message template for WhatsApp approval using a connected
        account in your workspace. Supports utility and marketing templates with
        a text body, optional text header/footer, and quick reply, website, or
        phone buttons. Approval is asynchronous; a successful submission does
        not mean the template is approved and does not send a message. Check its
        status under Settings → Templates. GET /api/v1/whatsapp/templates lists
        approved templates only.


        For a dynamic website button, end the URL with {{1}} and provide one
        full example URL with a sample value in place of the placeholder. When
        sending the approved template, use buttonParameters with subtype url to
        supply the variable suffix. Authentication templates and media headers
        are not supported by this submission endpoint.


        Rate limit: 30 requests per minute per IP.
      operationId: createWhatsappTemplate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - category
                - bodyText
              properties:
                from:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: >-
                    Connected WhatsApp account ID, phone number ID, or business
                    phone number. Required when multiple accounts are connected;
                    omitted when exactly one is connected.
                  example: '+15551230000'
                name:
                  type: string
                  minLength: 3
                  maxLength: 512
                  pattern: ^[a-z0-9_]+$
                  description: >-
                    Template name using lowercase letters, numbers, and
                    underscores. Include at least one letter or number.
                  example: order_tracking_update
                category:
                  type: string
                  enum:
                    - UTILITY
                    - MARKETING
                  description: Template category submitted for approval.
                  example: UTILITY
                language:
                  type: string
                  minLength: 2
                  maxLength: 16
                  default: en_US
                  description: WhatsApp template language code.
                  example: en_US
                bodyText:
                  type: string
                  minLength: 10
                  maxLength: 1024
                  description: >-
                    Customer message, with at least two words. Numbered
                    placeholders such as {{1}} require matching sample values in
                    bodyExamples.
                  example: >-
                    Hello {{1}}, your order {{2}} has shipped. Track its
                    delivery below.
                bodyExamples:
                  type: array
                  maxItems: 20
                  default: []
                  description: >-
                    Sample values for every numbered body placeholder, in order.
                    Values required by the body must not be empty. These are
                    approval samples, not recipient data.
                  items:
                    type: string
                    maxLength: 256
                  example:
                    - Sara
                    - A-100
                headerText:
                  type: string
                  maxLength: 60
                  description: Optional text header. Media headers are not supported.
                  example: Order update
                footerText:
                  type: string
                  maxLength: 60
                  description: Optional footer text.
                  example: Thank you for shopping with us
                buttons:
                  type: array
                  maxItems: 10
                  default: []
                  description: >-
                    Quick reply, website, or phone buttons. Each button must
                    have unique text.
                  items:
                    oneOf:
                      - type: object
                        required:
                          - type
                          - text
                        properties:
                          type:
                            type: string
                            const: QUICK_REPLY
                          text:
                            type: string
                            minLength: 1
                            maxLength: 25
                            description: >-
                              Text shown on the button. Button texts must be
                              unique within a template.
                      - type: object
                        required:
                          - type
                          - text
                          - url
                        properties:
                          type:
                            type: string
                            const: URL
                          text:
                            type: string
                            minLength: 1
                            maxLength: 25
                            description: >-
                              Text shown on the button. Button texts must be
                              unique within a template.
                          url:
                            type: string
                            maxLength: 2000
                            description: >-
                              HTTP or HTTPS website URL. For a dynamic URL, use
                              exactly one {{1}} placeholder at the end.
                            example: https://shop.example.com/orders/{{1}}
                          example:
                            type: array
                            maxItems: 1
                            description: >-
                              Required for a dynamic URL: one full HTTP or HTTPS
                              sample URL with {{1}} replaced by a non-empty
                              value, preserving the fixed URL prefix.
                            items:
                              type: string
                              format: uri
                              maxLength: 2000
                            example:
                              - https://shop.example.com/orders/A-100
                      - type: object
                        required:
                          - type
                          - text
                          - phone_number
                        properties:
                          type:
                            type: string
                            const: PHONE_NUMBER
                          text:
                            type: string
                            minLength: 1
                            maxLength: 25
                            description: >-
                              Text shown on the button. Button texts must be
                              unique within a template.
                          phone_number:
                            type: string
                            minLength: 7
                            maxLength: 20
                            description: Phone number called when the button is tapped.
                            example: '+15551230000'
            example:
              from: '+15551230000'
              name: order_tracking_update
              category: UTILITY
              language: en_US
              bodyText: >-
                Hello {{1}}, your order {{2}} has shipped. Track its delivery
                below.
              bodyExamples:
                - Sara
                - A-100
              buttons:
                - type: URL
                  text: Track order
                  url: https://shop.example.com/orders/{{1}}
                  example:
                    - https://shop.example.com/orders/A-100
      responses:
        '201':
          description: >-
            Template submitted to the connected WhatsApp provider. Approval may
            still be pending.
          content:
            application/json:
              schema:
                type: object
                required:
                  - template
                properties:
                  template:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Provider template ID.
                      status:
                        type: string
                        description: Provider approval status at submission time.
                        example: PENDING
                      category:
                        type: string
                        description: Category returned by the provider.
                        example: UTILITY
              example:
                template:
                  id: '123456789012345'
                  status: PENDING
                  category: UTILITY
        '400':
          description: >-
            Invalid template content, no connected WhatsApp account, unknown or
            ambiguous from, or provider submission failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: WHATSAPP_SENDER_AMBIGUOUS
                  message: Multiple WhatsApp numbers are connected; specify "from"
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          description: Rate limit exceeded. Back off and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
            message:
              type: string
              description: Human-readable explanation.
            details:
              description: Field-level details for validation errors.
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
  responses:
    Unauthorized:
      description: Missing, invalid, or revoked API token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_API_TOKEN
              message: Invalid or revoked API token
  securitySchemes:
    apiToken:
      type: http
      scheme: bearer
      description: >-
        Workspace API token created in Settings → API. Tokens start with
        `adraa_`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.