Skip to content

Templates

Create a template

Stores a template with status DRAFT. It is not submitted to Meta for approval; create and approve templates in WhatsApp Manager, then sync them. Only owners and admins signed in to the app can call it.

POST/api/v1/templates
  • Console only: owner or admin
  • Workspace: X-Tenant-ID

Headers

  • Cookiestringrequired

    The whatsappx_session cookie the app sets when you sign in. Browsers send it automatically; API keys are not accepted on this endpoint.

    Example
    whatsappx_session=…
  • X-Tenant-IDuuidrequired

    Workspace id. Required for session requests. You can pass ?tenant=<id> instead.

    Example
    8d0f6c2e-3b1a-4c55-9a7e-2f4b6d1e9c30

Body

application/json
  • namestringrequired

    Template name.

    Constraints
    Lower-case letter first, then lower-case letters, digits or _; 2–120 characters (^[a-z][a-z0-9_]+$).
    Example
    order_ready
  • bodystringrequired

    Template text.

    Constraints
    1–1024 characters.
    Example
    Hi {{1}}, your order {{2}} is ready for pickup.
  • categoryenumrequired

    Template category.

    Constraints
    MARKETING, UTILITY or AUTHENTICATION (upper case).
    Example
    UTILITY
  • languagestringrequired

    WhatsApp language code.

    Constraints
    Two or three lower-case letters, optionally followed by _ and a two-letter region, for example en, en_US, pt_BR or fil.
    Example
    en_US

Response

201 Createdapplication/json

  • iduuid

    Template id in whatsappx.si.

  • namestring

    Template name (lower case, digits and underscores).

  • bodystring

    Template body text.

  • categorystring

    MARKETING, UTILITY or AUTHENTICATION for templates created here; synced templates keep Meta’s category.

  • languagestring

    Language code, for example en_US.

  • statusstring

    DRAFT for templates created in whatsappx.si (they are not submitted to Meta). Synced templates carry the status Meta reports.

  • created_atinteger

    Creation time in Unix seconds.

Status codes

  • 201Created. The new draft.
  • 400Bad request. A field is missing or invalid, for example enter a template name, template name must start with a lowercase letter and use only lowercase letters, digits and underscores (for example order_confirmation), category must be UTILITY, MARKETING or AUTHENTICATION, language must be a WhatsApp language code such as en, en_US or pt_BR, enter the message body or message body must be at most 1024 characters; a template with the same name and language exists (a template named order_ready in en_US already exists); or the body is not JSON (invalid body).
  • 401Unauthorized. No signed-in session (unauthorized).
  • 403Forbidden. API keys can never call this endpoint (API keys cannot administer workspaces). A signed-in user who is not an owner or admin gets admin required; a user who is not a member of the workspace gets forbidden.
  • 500Server error. The template could not be saved.