Templates
7 endpoints

Templates API

Read your Meta-approved templates, save drafts, submit templates for approval, browse the template library and find files in your media library.

Badges:
Read onlyWrites dataSends to WhatsAppDestructive
GET/v1/templates#

List message templates

Read only

WhatsApp message templates registered with Meta, with status, body and the placeholders each needs. Only APPROVED templates can be sent. For one template's buttons and rejection reason use GET /v1/templates/{template_name}/{language_code}.

Permission: templates:view

Query parameters (5)

  • status

    "APPROVED" | "PENDING" | "REJECTED" | "PAUSED" | "DISABLED"

    No extra notes.
  • category

    "MARKETING" | "UTILITY" | "AUTHENTICATION"

    No extra notes.
  • query

    string

    Substring of the template name or body.
  • cursor

    string

    next_cursor from the previous page; omit for the first page. Keep the other filters the same; the page size stays as on the first page.
  • page_size

    integer

    Rows per page, 1-100. Default 20.Default 20
bashGET /v1/templates
curl "https://backend.sheetwa.com/v1/templates?page_size=20" \
  -H "Authorization: Bearer $SHEETWA_API_KEY"
POST/v1/templates/submit#

Submit a template to Meta for approval

Sends to WhatsApp

Sends a WhatsApp template to Meta for approval. Pass draft_id alone for a saved draft, or the full fields. Approval takes minutes to hours; the template can be sent only once GET /v1/templates/{template_name}/{language_code} shows APPROVED. Owner or admin keys only.

Permission: templates:change

Body parameters (11)

  • template_name

    string

    Template name as registered with Meta: lowercase snake case.
  • language_code

    string

    Template language code, e.g. en_US, en, hi.
  • category

    "MARKETING" | "UTILITY" | "AUTHENTICATION"

    MARKETING for promotions, UTILITY for transactional updates, AUTHENTICATION for codes.
  • body

    string

    Message body. Positional placeholders {{1}}, {{2}}… in order; no placeholder at the very start or end.
  • header_text

    string

    Short text header. Give this or header_format, not both.
  • header_format

    "IMAGE" | "VIDEO" | "DOCUMENT"

    Media header type; pair with header_media_asset_id.
  • header_media_asset_id

    string

    A media_asset_id from GET /v1/media, used as the header sample.
  • footer_text

    string

    No extra notes.
  • quick_reply_buttons

    string[]

    Up to 3 button labels, 25 characters each.
  • url_button

    object

    One link button: label and https URL.
  • draft_id

    string

    A draft_id from GET /v1/template-drafts; give it alone to submit that draft.
bashPOST /v1/templates/submit
curl -X POST "https://backend.sheetwa.com/v1/templates/submit" \
  -H "Authorization: Bearer $SHEETWA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "draft_id": "DRAFT_ID"
  }'
Read only

One WhatsApp template: body, placeholders, buttons, status and rejection reason; a rejected one also lists the workspace's other rejected templates (other_rejected_templates). Check placeholders before POST /v1/messages, POST /v1/chats/{chat_id}/reply-template or a template POST /v1/broadcasts.

Permission: templates:view

Path parameters (2)

  • template_namerequired

    string

    Template name as registered with Meta: lowercase snake case.
  • language_coderequired

    string

    Template language code, e.g. en_US, en, hi.
bashGET /v1/templates/{template_name}/{language_code}
curl "https://backend.sheetwa.com/v1/templates/order_update/en" \
  -H "Authorization: Bearer $SHEETWA_API_KEY"
GET/v1/template-drafts#

List template drafts

Read only

WhatsApp template drafts saved in SheetWA and not yet sent to Meta. Submit one with POST /v1/templates/submit.

Permission: templates:view

Query parameters (2)

  • cursor

    string

    next_cursor from the previous page; omit for the first page. Keep the other filters the same; the page size stays as on the first page.
  • page_size

    integer

    Rows per page, 1-100. Default 20.Default 20
bashGET /v1/template-drafts
curl "https://backend.sheetwa.com/v1/template-drafts?page_size=20" \
  -H "Authorization: Bearer $SHEETWA_API_KEY"
POST/v1/template-drafts#

Save a template draft

Writes data

Saves a WhatsApp template draft in SheetWA for a person to review; nothing goes to Meta. Pass draft_id to change an existing draft. Body placeholders are positional: {{1}}, {{2}}. Header media ids come from GET /v1/media.

Permission: templates:change

Body parameters (11)

  • template_namerequired

    string

    Template name as registered with Meta: lowercase snake case.
  • language_coderequired

    string

    Template language code, e.g. en_US, en, hi.
  • categoryrequired

    "MARKETING" | "UTILITY" | "AUTHENTICATION"

    MARKETING for promotions, UTILITY for transactional updates, AUTHENTICATION for codes.
  • bodyrequired

    string

    Message body. Positional placeholders {{1}}, {{2}}… in order; no placeholder at the very start or end.
  • header_text

    string

    Short text header. Give this or header_format, not both.
  • header_format

    "IMAGE" | "VIDEO" | "DOCUMENT"

    Media header type; pair with header_media_asset_id.
  • header_media_asset_id

    string

    A media_asset_id from GET /v1/media, used as the header sample.
  • footer_text

    string

    No extra notes.
  • quick_reply_buttons

    string[]

    Up to 3 button labels, 25 characters each.
  • url_button

    object

    One link button: label and https URL.
  • draft_id

    string

    A draft_id from GET /v1/template-drafts, to change that draft.
bashPOST /v1/template-drafts
curl -X POST "https://backend.sheetwa.com/v1/template-drafts" \
  -H "Authorization: Bearer $SHEETWA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template_name": "order_update",
    "language_code": "en",
    "category": "UTILITY",
    "body": "Hi {{1}}, your order {{2}} has shipped."
  }'
GET/v1/template-library#

Search ready-made templates

Read only

Ready-made WhatsApp template ideas from Meta's utility library and SheetWA's community library, by words, category and industry. Use one as the start for POST /v1/template-drafts. Read-only; importing is done in the dashboard.

Permission: templates:view

Query parameters (6)

  • query

    string

    Words matched against title, body, use case and industry.
  • source

    "meta" | "community" | "both"

    No extra notes.Default "both"
  • category

    "MARKETING" | "UTILITY" | "AUTHENTICATION"

    No extra notes.
  • industry

    string

    e.g. retail, education.
  • cursor

    string

    next_cursor from the previous page; omit for the first page. Keep the other filters the same; the page size stays as on the first page.
  • page_size

    integer

    Rows per page, 1-100. Default 20.Default 20
bashGET /v1/template-library
curl "https://backend.sheetwa.com/v1/template-library?page_size=20" \
  -H "Authorization: Bearer $SHEETWA_API_KEY"
GET/v1/media#

List uploaded media

Read only

Files in the workspace's WhatsApp media library: images, videos, documents, audio. Pass a media_asset_id to POST /v1/template-drafts as a header or to POST /v1/broadcasts as the file. Uploading is done in the dashboard.

Permission: any key

Query parameters (4)

  • media_type

    "image" | "video" | "document" | "audio"

    No extra notes.
  • query

    string

    Start of the file name.
  • cursor

    string

    next_cursor from the previous page; omit for the first page. Keep the other filters the same; the page size stays as on the first page.
  • page_size

    integer

    Rows per page, 1-100. Default 20.Default 20
bashGET /v1/media
curl "https://backend.sheetwa.com/v1/media?page_size=20" \
  -H "Authorization: Bearer $SHEETWA_API_KEY"