curl --request PATCH \
--url https://app.kapso.ai/api/v1/whatsapp_templates/{template_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"template": {
"parameter_format": "NAMED",
"components": [
{
"type": "BODY",
"text": "Hello {{customer_name}}, your appointment has been rescheduled to {{new_date}} at {{new_time}}. Please confirm your attendance.",
"example": {
"body_text_named_params": [
{
"param_name": "customer_name",
"example": "John"
},
{
"param_name": "new_date",
"example": "December 20th"
},
{
"param_name": "new_time",
"example": "3:00 PM"
}
]
}
}
]
}
}'
{
"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,
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "<string>",
"example": {},
"buttons": [
{}
]
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
Updates an existing draft template. Only draft templates can be updated.
curl --request PATCH \
--url https://app.kapso.ai/api/v1/whatsapp_templates/{template_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"template": {
"parameter_format": "NAMED",
"components": [
{
"type": "BODY",
"text": "Hello {{customer_name}}, your appointment has been rescheduled to {{new_date}} at {{new_time}}. Please confirm your attendance.",
"example": {
"body_text_named_params": [
{
"param_name": "customer_name",
"example": "John"
},
{
"param_name": "new_date",
"example": "December 20th"
},
{
"param_name": "new_time",
"example": "3:00 PM"
}
]
}
}
]
}
}'
{
"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,
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "<string>",
"example": {},
"buttons": [
{}
]
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
API key required for all endpoints
Template updated successfully
The response is of type object
.
Was this page helpful?