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

# Create a template

> Creates a template and, with `submit: true`, submits it to Meta for review. Names must be lowercase snake case and unique per language.

**Required scope:** `templates:write`



## OpenAPI

````yaml /api-reference/openapi.json post /v1/templates
openapi: 3.1.0
info:
  title: LazyApp API
  version: v1
  description: >-
    One WhatsApp API for developers, SaaS platforms and businesses.


    Every endpoint is Bearer-authenticated with a LazyApp API key, returns JSON,
    and is scoped to the workspace and mode (`live` or `test`) the key belongs
    to.


    Live keys need the Pro plan. A live key on a workspace below Pro gets `402`
    with `code: plan_limit_reached` on every request. Test keys work on every
    plan, so you can build against the test number before you upgrade.


    LazyApp adds 0% to Meta's message rates. Meta bills each message to the
    business's own Meta payment method; your LazyApp plan is billed separately.
  contact:
    name: LazyApp support
    url: https://lazyapp.in
servers:
  - url: https://lazyapp.in
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Messages
    description: Send and schedule WhatsApp messages.
  - name: Contacts
    description: The people you message, and their identifiers.
  - name: Conversations
    description: Threads and their message history.
  - name: Calls
    description: WhatsApp call history for the workspace.
  - name: Templates
    description: Create, submit and sync message templates.
  - name: Media
    description: Upload, retrieve and delete media.
  - name: Broadcasts
    description: Template sends to many contacts at once.
  - name: Events
    description: Say what happened; LazyApp picks the template.
  - name: Flows
    description: WhatsApp Flows and their responses.
  - name: Webhooks
    description: Register endpoints and inspect deliveries.
  - name: Workflows
    description: Automations and their executions.
  - name: Verify
    description: One-time passcodes over WhatsApp.
  - name: Capabilities
    description: What each connected number supports.
  - name: Catalog
    description: Proxy Meta Commerce catalog products for a connection.
  - name: Platform
    description: Manage customers if you run a platform on LazyApp.
  - name: Meta-compatible proxy
    description: Drop-in endpoints for existing Cloud API integrations.
  - name: Connections
    description: >-
      Your WhatsApp numbers and the account behind them: health, limits,
      registration, display name, blue tick, QR codes, conversation starters,
      opt-in links, business profile and blocked users.
  - name: Billing
    description: >-
      Meta's message rates, which LazyApp passes on with 0% added, and the
      billing facts behind them.
  - name: Analytics
    description: Workspace messaging aggregates.
  - name: Groups
    description: WhatsApp group chats on a connection Meta has enabled.
  - name: Funding
    description: Local funding status and recorded WhatsApp charges.
  - name: Connections
    description: 'WhatsApp connections: block users, business profile, insights.'
  - name: Payments
    description: >-
      WhatsApp payments in India: ask for payment, follow it, update the order
      and refund.
paths:
  /v1/templates:
    post:
      tags:
        - Templates
      summary: Create a template
      description: >-
        Creates a template and, with `submit: true`, submits it to Meta for
        review. Names must be lowercase snake case and unique per language.


        **Required scope:** `templates:write`
      parameters:
        - name: Idempotency-Key
          in: header
          description: >-
            Optional. Makes this write safe to retry: the same key replays the
            first response instead of acting twice.
          schema:
            type: string
            maxLength: 255
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 512
                  pattern: ^[a-z0-9_]+$
                language:
                  type: string
                  maxLength: 16
                category:
                  type: string
                  enum:
                    - AUTHENTICATION
                    - UTILITY
                    - MARKETING
                body_text:
                  type: string
                  maxLength: 1024
                  description: Use `{{1}}`-style placeholders.
                body_examples:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                    maxLength: 255
                footer_text:
                  type: string
                  maxLength: 60
                header:
                  type: object
                  properties:
                    format:
                      type: string
                      enum:
                        - NONE
                        - TEXT
                        - IMAGE
                        - VIDEO
                        - GIF
                        - DOCUMENT
                        - LOCATION
                        - PRODUCT
                      description: >-
                        `GIF` is an MP4 of up to 3.5 MB and marketing only.
                        `PRODUCT` is for catalog templates.
                    text:
                      type: string
                      maxLength: 60
                    examples:
                      type: array
                      maxItems: 1
                      items:
                        type: string
                        maxLength: 120
                      description: Sample for a `{{1}}` in a text header.
                    example_handle:
                      type: string
                      maxLength: 1024
                      description: >-
                        From `POST /v1/templates/media`: the sample Meta reviews
                        for an image, video, GIF or document header. GIF is
                        marketing only.
                    example_url:
                      type: string
                      format: uri
                      maxLength: 2000
                      description: >-
                        Instead of `example_handle`: a public https URL LazyApp
                        fetches and uploads as the review sample. JPEG, PNG, MP4
                        or PDF up to 16 MB (an MP4 up to 3.5 MB for `GIF`).
                buttons:
                  type: array
                  maxItems: 10
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - QUICK_REPLY
                          - URL
                          - PHONE_NUMBER
                          - OTP
                          - FLOW
                          - COPY_CODE
                          - CATALOG
                          - MPM
                          - SPM
                          - VOICE_CALL
                      text:
                        type: string
                        maxLength: 25
                      url:
                        type: string
                        maxLength: 2000
                        description: >-
                          Must be https. A trailing `{{1}}` makes the end of the
                          link a send-time value.
                      examples:
                        type: array
                        maxItems: 1
                        items:
                          type: string
                          maxLength: 2000
                        description: A full sample link for a dynamic URL.
                      example:
                        type: string
                        maxLength: 20
                        description: Sample coupon code for `COPY_CODE`.
                      phone_number:
                        type: string
                        maxLength: 32
                      flow_id:
                        type: string
                        maxLength: 64
                      ttl_minutes:
                        type: integer
                        minimum: 1440
                        maximum: 43200
                        description: >-
                          `VOICE_CALL` only: how long the Call on WhatsApp
                          button works after delivery. Meta defaults to 7 days.
                      app_deep_link:
                        type: object
                        description: >-
                          Marketing URL buttons only: open your Android app
                          first, falling back to the Play Store or the URL.
                        properties:
                          android_deep_link:
                            type: string
                            maxLength: 2000
                          android_fallback_playstore_url:
                            type: string
                            maxLength: 2000
                    required:
                      - type
                submit:
                  type: boolean
                  description: Submit to Meta immediately.
                parameter_format:
                  type: string
                  enum:
                    - POSITIONAL
                    - NAMED
                  description: '`NAMED` uses `{{first_name}}`-style variables.'
                library_template_name:
                  type: string
                  maxLength: 512
                  pattern: ^[a-z0-9_]+$
                  description: >-
                    Clone a ready-made template from `GET /v1/templates/library`
                    instead of writing `body_text`.
                limited_time_offer:
                  type: object
                  properties:
                    text:
                      type: string
                      maxLength: 16
                    has_expiration:
                      type: boolean
                authentication:
                  type: object
                  properties:
                    add_security_recommendation:
                      type: boolean
                    code_expiration_minutes:
                      type: integer
                      minimum: 1
                      maximum: 90
                carousel_cards:
                  type: array
                  maxItems: 10
                  items:
                    type: object
                    properties:
                      header_format:
                        type: string
                        enum:
                          - IMAGE
                          - VIDEO
                          - PRODUCT
                      example_handle:
                        type: string
                        maxLength: 1024
                        description: >-
                          From `POST /v1/templates/media`. Not used for
                          `PRODUCT` cards.
                      body_text:
                        type: string
                        maxLength: 160
                      buttons:
                        type: array
                        maxItems: 2
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - QUICK_REPLY
                                - URL
                                - PHONE_NUMBER
                                - SPM
                            text:
                              type: string
                              maxLength: 25
                            url:
                              type: string
                              maxLength: 2000
                            examples:
                              type: array
                              maxItems: 1
                              items:
                                type: string
                            phone_number:
                              type: string
                              maxLength: 20
                          required:
                            - type
                      example_url:
                        type: string
                        format: uri
                        maxLength: 2000
                        description: >-
                          Instead of `example_handle`: a public https URL of the
                          card's sample image or video.
                  description: >-
                    Media carousels take 2 to 10 cards; product carousels
                    exactly 2 when created. Every card has the same button
                    types.
                message_send_ttl_seconds:
                  type: integer
                  minimum: -1
                  maximum: 2592000
                  description: >-
                    How long WhatsApp keeps trying to deliver. Authentication
                    30–900, utility 30–43200, marketing 43200–2592000. `-1`
                    means 30 days (authentication and utility only).
                call_permission_request:
                  type: boolean
                  description: >-
                    Marketing or utility: ask the customer for permission to
                    call them. Body only, no buttons.
                cta_url_link_tracking_opted_out:
                  type: boolean
                  description: 'Marketing: turn off Meta''s click tracking for URL buttons.'
                creative_features:
                  type: object
                  additionalProperties:
                    type: string
                    enum:
                      - OPT_IN
                      - OPT_OUT
                  description: >-
                    Marketing: Meta's automatic creative improvements, such as
                    `image_animation` or `add_text_overlay`.
                max_price:
                  type: object
                  description: >-
                    Marketing only, after the max price agreement is accepted.
                    Clear it by sending `null` for both fields.
                  properties:
                    bid_amount:
                      type: integer
                      minimum: 1
                      nullable: true
                      description: >-
                        The most you pay per 1,000 delivered messages, in minor
                        units of your WhatsApp account currency.
                    country_multipliers:
                      type: object
                      nullable: true
                      additionalProperties:
                        type: number
                        exclusiveMinimum: 0
                      description: Two-letter country code to a multiplier of `bid_amount`.
              required:
                - name
                - language
                - category
              description: '`body_text` is required unless `library_template_name` is set.'
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          $ref: '#/components/responses/PlanLimitReached'
        '403':
          description: >-
            The key lacks the required scope, or is restricted from this phone
            number.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Template:
      type: object
      properties:
        uuid:
          type: string
        name:
          type: string
        language:
          type: string
        category:
          type: string
          enum:
            - AUTHENTICATION
            - UTILITY
            - MARKETING
        status:
          type: string
          enum:
            - draft
            - submitting
            - pending
            - approved
            - rejected
            - paused
            - disabled
            - archived
            - deleted
        body_text:
          type: string
        body_examples:
          type: array
          items:
            type: string
        header:
          type: object
          properties: {}
        footer_text:
          type: string
          nullable: true
        buttons:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - QUICK_REPLY
                  - URL
                  - PHONE_NUMBER
                  - OTP
                  - FLOW
                  - COPY_CODE
                  - CATALOG
                  - MPM
                  - SPM
                  - VOICE_CALL
              text:
                type: string
                maxLength: 25
              url:
                type: string
                maxLength: 2000
                description: >-
                  Must be https. A trailing `{{1}}` makes the end of the link a
                  send-time value.
              examples:
                type: array
                maxItems: 1
                items:
                  type: string
                  maxLength: 2000
                description: A full sample link for a dynamic URL.
              example:
                type: string
                maxLength: 20
                description: Sample coupon code for `COPY_CODE`.
              phone_number:
                type: string
                maxLength: 32
              flow_id:
                type: string
                maxLength: 64
              ttl_minutes:
                type: integer
                minimum: 1440
                maximum: 43200
                description: >-
                  `VOICE_CALL` only: how long the Call on WhatsApp button works
                  after delivery. Meta defaults to 7 days.
              app_deep_link:
                type: object
                description: >-
                  Marketing URL buttons only: open your Android app first,
                  falling back to the Play Store or the URL.
                properties:
                  android_deep_link:
                    type: string
                    maxLength: 2000
                  android_fallback_playstore_url:
                    type: string
                    maxLength: 2000
            required:
              - type
        rejection_reason:
          type: string
          nullable: true
        quality_score:
          type: string
          nullable: true
        provider_template_id:
          type: string
          nullable: true
        submitted_at:
          type: string
          format: date-time
          nullable: true
        approved_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
          nullable: true
        carousel_cards:
          type: array
          items:
            type: object
            properties:
              header_format:
                type: string
                enum:
                  - IMAGE
                  - VIDEO
                  - PRODUCT
              example_handle:
                type: string
                maxLength: 1024
                description: From `POST /v1/templates/media`. Not used for `PRODUCT` cards.
              body_text:
                type: string
                maxLength: 160
              buttons:
                type: array
                maxItems: 2
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - QUICK_REPLY
                        - URL
                        - PHONE_NUMBER
                        - SPM
                    text:
                      type: string
                      maxLength: 25
                    url:
                      type: string
                      maxLength: 2000
                    examples:
                      type: array
                      maxItems: 1
                      items:
                        type: string
                    phone_number:
                      type: string
                      maxLength: 20
                  required:
                    - type
        limited_time_offer:
          type: object
          nullable: true
        call_permission_request:
          type: boolean
        message_send_ttl_seconds:
          type: integer
          nullable: true
        cta_url_link_tracking_opted_out:
          type: boolean
          nullable: true
        marketing_options:
          type: object
          nullable: true
          description: Creative features and max price as last submitted.
        source:
          type: string
          nullable: true
          description: >-
            Set when Meta generated the template (for example from Direct Send).
            Such templates cannot be edited or deleted here.
        sub_category:
          type: string
          nullable: true
        pending_category:
          type: string
          nullable: true
          description: The category Meta will move this template to.
        template_group:
          type: string
          nullable: true
          description: uuid of the template group.
        send_features:
          type: array
          items:
            type: object
            properties: {}
          description: >-
            Extra inputs a send needs, such as `cards`, `coupon_code` or
            `voice_call`.
        rejection_reason_text:
          type: string
          nullable: true
    Error:
      type: object
      properties:
        message:
          type: string
          description: Human-readable description of what went wrong.
        code:
          type: string
          description: >-
            Stable machine-readable reason, when the failure is one a client can
            branch on.
      required:
        - message
    ValidationError:
      type: object
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Field name to list of failures.
      required:
        - message
  responses:
    PlanLimitReached:
      description: >-
        The workspace's plan does not allow this. A live key on a workspace
        below Pro gets this on every request, because the live API is a Pro
        feature. Upgrade in **Billing** to use live keys. Test keys are never
        limited, on any plan.


        `code` is always `plan_limit_reached`. Show `message` to the person: it
        names the plan to move to.


        Other plan limits use the same code in the console, but the API reports
        them differently today: a broadcast larger than the month's remaining
        Live broadcast sends is refused with `422` and the reason in `message`,
        and connecting a number beyond the plan's number capacity fails
        validation (`422`) on `phone_number_id`.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: >-
                  A sentence you can show to the person. Says which plan to move
                  to.
              code:
                type: string
                enum:
                  - plan_limit_reached
            required:
              - message
              - code
          example:
            message: >-
              The API is on the Pro plan. Upgrade in Billing to use live keys.
              Test keys keep working.
            code: plan_limit_reached
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your API key, e.g. `sk_live_...` or `sk_test_...`.

````

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