curl --request POST \
--url https://app.kapso.ai/api/v1/whatsapp_templates \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data @- <<EOF
{
"template": {
"name": "welcome_message",
"language_code": "en_US",
"category": "UTILITY",
"components": [
{
"type": "BODY",
"text": "Welcome to our service! We're excited to have you on board."
}
]
}
}
EOF{
"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": "Invalid template",
"errors": [
"Name can't be blank",
"Language code is not valid"
]
}{
"status": "error",
"message": "Failed to create template: Internal Error"
}Create a new WhatsApp template
Creates a new draft template that can be later submitted to WhatsApp for approval.
When a whatsapp_config_id (or customer_id) is provided, the template is automatically associated with all production configs that share the same WhatsApp Business Account (WABA).
Note: You cannot associate templates with configs from different WABAs. Attempting to do so will return a 422 validation error.
curl --request POST \
--url https://app.kapso.ai/api/v1/whatsapp_templates \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data @- <<EOF
{
"template": {
"name": "welcome_message",
"language_code": "en_US",
"category": "UTILITY",
"components": [
{
"type": "BODY",
"text": "Welcome to our service! We're excited to have you on board."
}
]
}
}
EOF{
"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": "Invalid template",
"errors": [
"Name can't be blank",
"Language code is not valid"
]
}{
"status": "error",
"message": "Failed to create template: Internal Error"
}Authorizations
API key required for all endpoints
Body
Show child attributes
Show child attributes
Optional: Specific WhatsApp phone number configuration to associate with template. Templates can be associated with multiple phone numbers (WhatsApp configs). Association options:
- If whatsapp_config_id provided: associates with that specific phone number only
- If customer_id provided: associates with ALL production configs of that customer
- If neither provided: associates with ALL production configs of the project
Optional: Customer whose WhatsApp configs to associate with template. When provided, the template will be associated with ALL production WhatsApp configs (phone numbers) belonging to this customer, making it available for sending from any of them.
Response
Template created successfully
Show child attributes
Show child attributes

