curl --location 'https://api.weya.live/backend/api/whatsapp/get-templates/6891f1d0c45d123456789abc' \
--header 'x-api-key: YOUR_API_KEY'
WhatsApp
Get WhatsApp Templates
List the message templates of a connected WhatsApp number, from AiSensy.
GET
/
api
/
whatsapp
/
get-templates
/
{phoneNumberId}
curl --location 'https://api.weya.live/backend/api/whatsapp/get-templates/6891f1d0c45d123456789abc' \
--header 'x-api-key: YOUR_API_KEY'
Overview
Fetch the message templates of one of your WhatsApp integrations live from AiSensy. The list is whatever AiSensy returns for the number, so its fields follow AiSensy’s template format.Prerequisites
- An API key for your workspace
- The integration ID (
_idfrom Get WhatsApp Numbers)
Request
curl --location 'https://api.weya.live/backend/api/whatsapp/get-templates/6891f1d0c45d123456789abc' \
--header 'x-api-key: YOUR_API_KEY'
Response
A successful request returnsstatus: true, the message Templates fetched successfully, and the templates in data.
Error Handling
Errors returnstatus: false, with the reason in errorMessage.
- 400 Bad Request –
Valid Phone Number ID is required. - 401 Unauthorized – Missing or invalid API key.
- 404 Not Found –
Whatsapp number not found: it doesn’t exist or wasn’t connected by the user who owns the API key. - 429 Too Many Requests – More than 1,000 WhatsApp requests in 15 minutes from your IP address.
- 500 Internal Server Error – Unexpected server error, or AiSensy couldn’t be reached.
Related endpoints:
GET /api/whatsapp/get-variable-by-template-id/{phoneNumberId}/{templateId}– the variables of a template.GET /api/whatsapp/get-all-templates– the templates saved with your WhatsApp agents.
Was this page helpful?

