curl --request PATCH \
--url https://app.kapso.ai/api/v1/whatsapp_templates/{template_id}/meta \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"template": {
"components": [
{
"type": "BODY",
"text": "Updated body text with {{1}} value",
"example": {
"body_text": [
[
"Example"
]
]
}
}
]
}
}
'
{
"data": {
"id": "template-123abc",
"name": "appointment_reminder",
"language_code": "en_US",
"category": "UTILITY",
"status": "approved",
"content": "Hello {{1}}, your appointment is confirmed for {{2}}.",
"parameter_count": 2,
"business_account_id": "123456789012345",
"whatsapp_config_ids": [
"config-123abc",
"config-456def"
],
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "<string>",
"example": {},
"buttons": [
{}
]
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "Resource not found",
"status": 404,
"message": "The requested resource could not be found"
}{
"error": "Resource not found",
"status": 404,
"message": "The requested resource could not be found"
}{
"error": "Cannot edit the category of an approved template",
"errors": [
"Invalid template component structure"
]
}{
"status": "error",
"message": "Failed to edit template: Internal Error"
}WhatsApp Templates
Edit a WhatsApp template on Meta
Edits a WhatsApp template via Meta’s Graph API and updates the local record.
- Allowed statuses: approved, rejected, or disabled
- Editable fields: category, components, time_to_live
- Category cannot be changed for approved templates
Returns the updated template on success.
PATCH
/
whatsapp_templates
/
{template_id}
/
meta
curl --request PATCH \
--url https://app.kapso.ai/api/v1/whatsapp_templates/{template_id}/meta \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"template": {
"components": [
{
"type": "BODY",
"text": "Updated body text with {{1}} value",
"example": {
"body_text": [
[
"Example"
]
]
}
}
]
}
}
'
{
"data": {
"id": "template-123abc",
"name": "appointment_reminder",
"language_code": "en_US",
"category": "UTILITY",
"status": "approved",
"content": "Hello {{1}}, your appointment is confirmed for {{2}}.",
"parameter_count": 2,
"business_account_id": "123456789012345",
"whatsapp_config_ids": [
"config-123abc",
"config-456def"
],
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "<string>",
"example": {},
"buttons": [
{}
]
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "Resource not found",
"status": 404,
"message": "The requested resource could not be found"
}{
"error": "Resource not found",
"status": 404,
"message": "The requested resource could not be found"
}{
"error": "Cannot edit the category of an approved template",
"errors": [
"Invalid template component structure"
]
}{
"status": "error",
"message": "Failed to edit template: Internal Error"
}
