Create a Template
POST https://api.beconversive.com/api/v2/templates
Creates a message template in the account. Returns the ID of the new template, which you can use to retrieve, update or delete it.
curl -X POST https://api.beconversive.com/api/v2/templates \-H "apiKey: <API_KEY>" \-H "Content-Type: application/json" \-d '{"name": "Welcome","text": "Hi, welcome!","type": "automation","channel": "sms","category": "only text"}'
200 Created
{"template_id": 102031}
Authentication
| Name | Type | Required | Description |
|---|---|---|---|
apiKey | string | Required | API key authentication via header. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Required | Template name. Letters, digits, _, spaces and -. Must start and end with a letter, digit or _. |
text | string | Required | Message text of the template. |
type | string or array | Required | automation, campaign or conversation. Pass one value or a list; the first is the primary type. |
channel | string | Required | Channel the template is for, e.g. sms, whatsapp, rcs. Cannot be changed later. |
category | string | Required | only text, media message or rich media. |
label | string | Optional | Label name or ID. A new label is created if the name does not exist. |
integration | string | Optional | Integration the template belongs to, e.g. hubspot, salesforce, activecampaign, conversive. |
record_type | string | Required with integration | Required when integration is set. The integrationโs record type, e.g. contacts, leads. |
content | object | Optional | Channel content for WhatsApp and RCS templates. |
template_folder_id | integer | Optional | Folder to place the template in. |
Response
| Name | Type | Description |
|---|---|---|
template_id | integer | ID of the new template. |
Errors
| Status | Error | Description |
|---|---|---|
| 400 Bad Request | MISSING-RECORD-TYPE | integration was sent without record_type. |
| 400 Bad Request | BAD-TEMPLATE-NAME | The name contains characters that are not allowed. |
| 401 Unauthorized | NO-API-KEY / FORBIDDEN-API-KEY | The API key is missing or not valid. |
| 403 Forbidden | โ | More than 25 requests in a minute. Wait a minute and retry. |
