Endpoint
POST /api/v1/templates
Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Name of the template |
type | enum | yes | text, image, video, audio, document |
body | string | yes if type=text | Contenu avec placeholders |
mediaUrl | string | yes si template media | Public media URL |
Success response 201
{
"data": {
"id": "tmpl_uuid",
"name": "Relance panier",
"type": "text",
"body": "Hello {{contact.firstName}}",
"mediaUrl": null,
"variables": ["contact.firstName"]
}
}
Common errors
| HTTP | Code | When |
|---|---|---|
400 | VALIDATION_ERROR | Invalid body |
400 | TEMPLATE_INVALID | Placeholder invalid |