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

# Create WhatsApp template

> Submit a new template for review. Approval usually takes minutes; you'll see the status change in List WhatsApp templates.

Scope: `whatsapp:send`.

For a media header send `multipart/form-data` with the JSON above as a `data` field and the sample file as `headerSample` (JPEG/PNG, MP4 or PDF).

On the shared number, templates go to `in_review` first and are then submitted to Meta.



## OpenAPI

````yaml /openapi.json post /whatsapp/templates
openapi: 3.1.0
info:
  title: Messaly API
  version: 1.0.0
  description: >-
    SMS, WhatsApp, email, contacts and CRM for your business. Amounts are in
    KES. Authenticate with an API key (Settings → API keys). A key can be
    limited to scopes and to IP addresses; a key with no scopes can call every
    endpoint here.
servers:
  - url: https://app.telaven.com/api/v1
    description: Production
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: Account
    description: Wallet balance and SMS pricing.
  - name: SMS
    description: Send SMS and read messages and analytics.
  - name: SMS campaigns
    description: Create, schedule and send SMS campaigns to lists and tags.
  - name: Contacts
    description: Contacts and contact lists.
  - name: WhatsApp
    description: Send approved WhatsApp templates.
  - name: Email
    description: Email campaigns and unsubscribes.
  - name: CRM
    description: Deals, companies and pipelines.
paths:
  /whatsapp/templates:
    post:
      tags:
        - WhatsApp
      summary: Create WhatsApp template
      description: >-
        Submit a new template for review. Approval usually takes minutes; you'll
        see the status change in List WhatsApp templates.


        Scope: `whatsapp:send`.


        For a media header send `multipart/form-data` with the JSON above as a
        `data` field and the sample file as `headerSample` (JPEG/PNG, MP4 or
        PDF).


        On the shared number, templates go to `in_review` first and are then
        submitted to Meta.
      operationId: createWhatsappTemplate
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: order_ready
                  description: Lowercase letters, numbers and underscores.
                language:
                  type: string
                  example: en
                  description: Language code (default en).
                category:
                  type: string
                  example: utility
                  description: '`marketing` or `utility`.'
                components:
                  type: object
                  properties:
                    body:
                      type: object
                      properties:
                        text:
                          type: string
                          example: Hi {{1}}, order {{2}} is ready for pickup.
                          description: >-
                            Up to 1,024 characters. Variables are {{1}}, {{2}}…
                            or named, e.g. {{customer_name}}.
                        examples:
                          type: object
                          example:
                            '1': Jane
                            '2': A1042
                          description: >-
                            A sample value for every variable (Meta requires
                            them).
                      required:
                        - text
                    header:
                      type: object
                      description: >-
                        Optional. `{ format: "TEXT", text, example? }`, or `{
                        format: "IMAGE" | "VIDEO" | "DOCUMENT" }` with a sample
                        file sent as multipart.
                    footer:
                      type: string
                      description: Optional, up to 60 characters, no variables.
                    buttons:
                      type: array
                      items:
                        type: object
                      description: >-
                        Up to 10: `{ type: "QUICK_REPLY", text }`, `{ type:
                        "URL", text, url, urlExample? }` (one {{1}} at the end
                        of the URL), or `{ type: "PHONE_NUMBER", text, phone }`.
                  required: []
              required:
                - name
                - category
                - components
            example:
              name: order_ready
              language: en
              category: utility
              components:
                body:
                  text: Hi {{1}}, order {{2}} is ready for pickup.
                  examples:
                    '1': Jane
                    '2': A1042
                footer: Reply STOP to opt out
                buttons:
                  - type: URL
                    text: Track order
                    url: https://shop.example.com/o/{{1}}
                    urlExample: https://shop.example.com/o/A1042
      responses:
        '201':
          description: Success
          content:
            application/json:
              example:
                success: true
                data:
                  id: 7d2c…
                  name: order_ready
                  status: pending
                  rejectionReason: null
        '400':
          description: >-
            The template breaks one of Meta's rules (the error says which), the
            name is taken, or WhatsApp isn't connected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: No API key, or the key is wrong, disabled or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The key doesn't have the scope this endpoint needs, or it's used
            from an address its IP allowlist doesn't include.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            More than 120 requests in a minute with this key. Wait for the
            number of seconds in Retry-After.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >-
            Something went wrong on our side. Retry with backoff. A POST sent
            with an Idempotency-Key replays this same error for that key,
            because the request may have partly run: check the result before
            trying again with a new key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        code:
          type: string
          description: Machine-readable code where one exists, e.g. INSUFFICIENT_BALANCE.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Authorization: Bearer tlv_…'
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````

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