Create a template
curl --request POST \
--url https://api.getreply.in/v1/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "order_ready",
"language": "en",
"category": "utility"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: 'order_ready', language: 'en', category: 'utility'})
};
fetch('https://api.getreply.in/v1/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getreply.in/v1/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'order_ready',
'language' => 'en',
'category' => 'utility'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.getreply.in/v1/templates"
payload = {
"name": "order_ready",
"language": "en",
"category": "utility"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"name": "<string>",
"language": "<string>",
"category": "<string>",
"status": "approved",
"rejection_reason": "<string>",
"quality": "<string>",
"header_type": "<string>",
"header_text": "<string>",
"body": "<string>",
"footer": "<string>",
"variables": 123,
"buttons": [
{}
]
}Templates
Create a template
Creates a template and sends it for review — the same rules as in the app. It starts as pending.
Permission: A Full key.
POST
/
v1
/
templates
Create a template
curl --request POST \
--url https://api.getreply.in/v1/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "order_ready",
"language": "en",
"category": "utility"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: 'order_ready', language: 'en', category: 'utility'})
};
fetch('https://api.getreply.in/v1/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getreply.in/v1/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'order_ready',
'language' => 'en',
'category' => 'utility'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.getreply.in/v1/templates"
payload = {
"name": "order_ready",
"language": "en",
"category": "utility"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"name": "<string>",
"language": "<string>",
"category": "<string>",
"status": "approved",
"rejection_reason": "<string>",
"quality": "<string>",
"header_type": "<string>",
"header_text": "<string>",
"body": "<string>",
"footer": "<string>",
"variables": 123,
"buttons": [
{}
]
}Authorizations
Your API key, e.g. gr_live_…
Headers
Your own unique id for this request (at most 255 characters). The same id and body within 24 hours answers the first answer again — never a second send or charge.
Maximum string length:
255Body
application/json
Lowercase letters, numbers and underscores.
A language code, e.g. en.
Available options:
marketing, utility, authentication Show child attributes
Show child attributes
A sample for each variable, e.g. {"body:name": "Rohan"}.
Show child attributes
Show child attributes
Authentication options.