HostMentor Docs

List templates

GET/{waba_id}/message_templates

Returns your templates, newest first, with their status and content. Use status to list only templates you can send (APPROVED), and fields to return only what you need.

Results come in pages. When paging.cursors.after is present, pass it as after to get the next page.

Authorization

apiKey
apikey<token>

Your HostMentor API key, from the dashboard under Messaging → WhatsApp → API keys.

In: header

Path Parameters

waba_id*string

ID of your WhatsApp Business Account (whatsapp_business_account_id in List your phone numbers).

Query Parameters

status?string

Only templates with this status.

Value in

  • "PENDING"
  • "APPROVED"
  • "REJECTED"
  • "PAUSED"
  • "DISABLED"
  • "IN_APPEAL"
  • "PENDING_DELETION"
fields?string

Comma-separated fields to return, such as name,status,language. Leave it out to get everything.

limit?integer

Templates per page.

after?string

Cursor for the next page, from paging.cursors.after.

before?string

Cursor for the previous page, from paging.cursors.before.

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://wa.hostmentor.com/v3/105954558954427/message_templates?fields=name%2Cstatus%2Clanguage%2Ccategory&limit=25" \  -H "apikey: YOUR_API_KEY"
{  "data": [    {      "id": "594425479261596",      "name": "order_shipped",      "language": "en",      "status": "APPROVED",      "category": "UTILITY",      "components": [        {          "type": "BODY",          "text": "Hi {{1}}, your order {{2}} has shipped.",          "example": {            "body_text": [              [                "Priya",                "#1042"              ]            ]          }        }      ]    },    {      "id": "594425479261597",      "name": "diwali_offer",      "language": "en",      "status": "REJECTED",      "category": "MARKETING",      "rejected_reason": "INCORRECT_CATEGORY",      "components": [        {          "type": "BODY",          "text": "Get 30% off everything this Diwali!"        }      ]    }  ],  "paging": {    "cursors": {      "before": "QVFIUmxtNVRpSjJ",      "after": "QVFIUlZAPOEdrMVJ"    }  }}