curl --request POST \
--url https://app.thinnest.ai/api/v1/sms/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "booking_link",
"body": "Hi {#var#}, thanks for calling Acme Clinic. Book your visit here: {#var#}",
"dltTemplateId": "1207169876543210987",
"category": "service_implicit"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'booking_link',
body: JSON.stringify('Hi {#var#}, thanks for calling Acme Clinic. Book your visit here: {#var#}'),
dltTemplateId: '1207169876543210987',
category: 'service_implicit'
})
};
fetch('https://app.thinnest.ai/api/v1/sms/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/sms/templates"
payload = {
"name": "booking_link",
"body": "Hi {#var#}, thanks for calling Acme Clinic. Book your visit here: {#var#}",
"dltTemplateId": "1207169876543210987",
"category": "service_implicit"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "8d2e4f6a-1b3c-4d5e-9f70-a1b2c3d4e5f6",
"name": "booking_link",
"body": "Hi {#var#}, thanks for calling Acme Clinic. Book your visit here: {#var#}",
"dltTemplateId": "1207169876543210987",
"providerTemplateId": null,
"category": "service_implicit",
"agentMaySend": true
}Add SMS Template
Adds a template exactly as it was approved on your DLT portal, with {#var#} wherever the text changes. Each {#var#} takes at most 30 characters when sent. Promotional templates are not accepted: an agent may only send transactional or service messages. MSG91 and Fast2SMS send by their own template id, so with them providerTemplateId is required. Needs a full key.
curl --request POST \
--url https://app.thinnest.ai/api/v1/sms/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "booking_link",
"body": "Hi {#var#}, thanks for calling Acme Clinic. Book your visit here: {#var#}",
"dltTemplateId": "1207169876543210987",
"category": "service_implicit"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'booking_link',
body: JSON.stringify('Hi {#var#}, thanks for calling Acme Clinic. Book your visit here: {#var#}'),
dltTemplateId: '1207169876543210987',
category: 'service_implicit'
})
};
fetch('https://app.thinnest.ai/api/v1/sms/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/sms/templates"
payload = {
"name": "booking_link",
"body": "Hi {#var#}, thanks for calling Acme Clinic. Book your visit here: {#var#}",
"dltTemplateId": "1207169876543210987",
"category": "service_implicit"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "8d2e4f6a-1b3c-4d5e-9f70-a1b2c3d4e5f6",
"name": "booking_link",
"body": "Hi {#var#}, thanks for calling Acme Clinic. Book your visit here: {#var#}",
"dltTemplateId": "1207169876543210987",
"providerTemplateId": null,
"category": "service_implicit",
"agentMaySend": true
}Authorizations
Headers
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.
"org_3fKq9TzQ1mN8vB2xR7cLpA"
Body
Response
Added.