curl --request POST \
--url https://lazyapp.in/v1/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"language": "<string>",
"body_text": "<string>",
"body_examples": [
"<string>"
],
"footer_text": "<string>",
"header": {
"text": "<string>",
"examples": [
"<string>"
],
"example_handle": "<string>",
"example_url": "<string>"
},
"buttons": [
{
"text": "<string>",
"url": "<string>",
"examples": [
"<string>"
],
"example": "<string>",
"phone_number": "<string>",
"flow_id": "<string>",
"ttl_minutes": 22320,
"app_deep_link": {
"android_deep_link": "<string>",
"android_fallback_playstore_url": "<string>"
}
}
],
"submit": true,
"library_template_name": "<string>",
"limited_time_offer": {
"text": "<string>",
"has_expiration": true
},
"authentication": {
"add_security_recommendation": true,
"code_expiration_minutes": 45
},
"carousel_cards": [
{
"example_handle": "<string>",
"body_text": "<string>",
"buttons": [
{
"text": "<string>",
"url": "<string>",
"examples": [
"<string>"
],
"phone_number": "<string>"
}
],
"example_url": "<string>"
}
],
"message_send_ttl_seconds": 1295999,
"call_permission_request": true,
"cta_url_link_tracking_opted_out": true,
"creative_features": {},
"max_price": {
"bid_amount": 2,
"country_multipliers": {}
}
}
'import requests
url = "https://lazyapp.in/v1/templates"
payload = {
"name": "<string>",
"language": "<string>",
"body_text": "<string>",
"body_examples": ["<string>"],
"footer_text": "<string>",
"header": {
"text": "<string>",
"examples": ["<string>"],
"example_handle": "<string>",
"example_url": "<string>"
},
"buttons": [
{
"text": "<string>",
"url": "<string>",
"examples": ["<string>"],
"example": "<string>",
"phone_number": "<string>",
"flow_id": "<string>",
"ttl_minutes": 22320,
"app_deep_link": {
"android_deep_link": "<string>",
"android_fallback_playstore_url": "<string>"
}
}
],
"submit": True,
"library_template_name": "<string>",
"limited_time_offer": {
"text": "<string>",
"has_expiration": True
},
"authentication": {
"add_security_recommendation": True,
"code_expiration_minutes": 45
},
"carousel_cards": [
{
"example_handle": "<string>",
"body_text": "<string>",
"buttons": [
{
"text": "<string>",
"url": "<string>",
"examples": ["<string>"],
"phone_number": "<string>"
}
],
"example_url": "<string>"
}
],
"message_send_ttl_seconds": 1295999,
"call_permission_request": True,
"cta_url_link_tracking_opted_out": True,
"creative_features": {},
"max_price": {
"bid_amount": 2,
"country_multipliers": {}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
language: '<string>',
body_text: '<string>',
body_examples: ['<string>'],
footer_text: '<string>',
header: {
text: '<string>',
examples: ['<string>'],
example_handle: '<string>',
example_url: '<string>'
},
buttons: [
{
text: '<string>',
url: '<string>',
examples: ['<string>'],
example: '<string>',
phone_number: '<string>',
flow_id: '<string>',
ttl_minutes: 22320,
app_deep_link: {android_deep_link: '<string>', android_fallback_playstore_url: '<string>'}
}
],
submit: true,
library_template_name: '<string>',
limited_time_offer: {text: '<string>', has_expiration: true},
authentication: {add_security_recommendation: true, code_expiration_minutes: 45},
carousel_cards: [
{
example_handle: '<string>',
body_text: '<string>',
buttons: [
{
text: '<string>',
url: '<string>',
examples: ['<string>'],
phone_number: '<string>'
}
],
example_url: '<string>'
}
],
message_send_ttl_seconds: 1295999,
call_permission_request: true,
cta_url_link_tracking_opted_out: true,
creative_features: {},
max_price: {bid_amount: 2, country_multipliers: {}}
})
};
fetch('https://lazyapp.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://lazyapp.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' => '<string>',
'language' => '<string>',
'body_text' => '<string>',
'body_examples' => [
'<string>'
],
'footer_text' => '<string>',
'header' => [
'text' => '<string>',
'examples' => [
'<string>'
],
'example_handle' => '<string>',
'example_url' => '<string>'
],
'buttons' => [
[
'text' => '<string>',
'url' => '<string>',
'examples' => [
'<string>'
],
'example' => '<string>',
'phone_number' => '<string>',
'flow_id' => '<string>',
'ttl_minutes' => 22320,
'app_deep_link' => [
'android_deep_link' => '<string>',
'android_fallback_playstore_url' => '<string>'
]
]
],
'submit' => true,
'library_template_name' => '<string>',
'limited_time_offer' => [
'text' => '<string>',
'has_expiration' => true
],
'authentication' => [
'add_security_recommendation' => true,
'code_expiration_minutes' => 45
],
'carousel_cards' => [
[
'example_handle' => '<string>',
'body_text' => '<string>',
'buttons' => [
[
'text' => '<string>',
'url' => '<string>',
'examples' => [
'<string>'
],
'phone_number' => '<string>'
]
],
'example_url' => '<string>'
]
],
'message_send_ttl_seconds' => 1295999,
'call_permission_request' => true,
'cta_url_link_tracking_opted_out' => true,
'creative_features' => [
],
'max_price' => [
'bid_amount' => 2,
'country_multipliers' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lazyapp.in/v1/templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"body_text\": \"<string>\",\n \"body_examples\": [\n \"<string>\"\n ],\n \"footer_text\": \"<string>\",\n \"header\": {\n \"text\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"example_handle\": \"<string>\",\n \"example_url\": \"<string>\"\n },\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"example\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"flow_id\": \"<string>\",\n \"ttl_minutes\": 22320,\n \"app_deep_link\": {\n \"android_deep_link\": \"<string>\",\n \"android_fallback_playstore_url\": \"<string>\"\n }\n }\n ],\n \"submit\": true,\n \"library_template_name\": \"<string>\",\n \"limited_time_offer\": {\n \"text\": \"<string>\",\n \"has_expiration\": true\n },\n \"authentication\": {\n \"add_security_recommendation\": true,\n \"code_expiration_minutes\": 45\n },\n \"carousel_cards\": [\n {\n \"example_handle\": \"<string>\",\n \"body_text\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"phone_number\": \"<string>\"\n }\n ],\n \"example_url\": \"<string>\"\n }\n ],\n \"message_send_ttl_seconds\": 1295999,\n \"call_permission_request\": true,\n \"cta_url_link_tracking_opted_out\": true,\n \"creative_features\": {},\n \"max_price\": {\n \"bid_amount\": 2,\n \"country_multipliers\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://lazyapp.in/v1/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"body_text\": \"<string>\",\n \"body_examples\": [\n \"<string>\"\n ],\n \"footer_text\": \"<string>\",\n \"header\": {\n \"text\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"example_handle\": \"<string>\",\n \"example_url\": \"<string>\"\n },\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"example\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"flow_id\": \"<string>\",\n \"ttl_minutes\": 22320,\n \"app_deep_link\": {\n \"android_deep_link\": \"<string>\",\n \"android_fallback_playstore_url\": \"<string>\"\n }\n }\n ],\n \"submit\": true,\n \"library_template_name\": \"<string>\",\n \"limited_time_offer\": {\n \"text\": \"<string>\",\n \"has_expiration\": true\n },\n \"authentication\": {\n \"add_security_recommendation\": true,\n \"code_expiration_minutes\": 45\n },\n \"carousel_cards\": [\n {\n \"example_handle\": \"<string>\",\n \"body_text\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"phone_number\": \"<string>\"\n }\n ],\n \"example_url\": \"<string>\"\n }\n ],\n \"message_send_ttl_seconds\": 1295999,\n \"call_permission_request\": true,\n \"cta_url_link_tracking_opted_out\": true,\n \"creative_features\": {},\n \"max_price\": {\n \"bid_amount\": 2,\n \"country_multipliers\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"body_text\": \"<string>\",\n \"body_examples\": [\n \"<string>\"\n ],\n \"footer_text\": \"<string>\",\n \"header\": {\n \"text\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"example_handle\": \"<string>\",\n \"example_url\": \"<string>\"\n },\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"example\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"flow_id\": \"<string>\",\n \"ttl_minutes\": 22320,\n \"app_deep_link\": {\n \"android_deep_link\": \"<string>\",\n \"android_fallback_playstore_url\": \"<string>\"\n }\n }\n ],\n \"submit\": true,\n \"library_template_name\": \"<string>\",\n \"limited_time_offer\": {\n \"text\": \"<string>\",\n \"has_expiration\": true\n },\n \"authentication\": {\n \"add_security_recommendation\": true,\n \"code_expiration_minutes\": 45\n },\n \"carousel_cards\": [\n {\n \"example_handle\": \"<string>\",\n \"body_text\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"phone_number\": \"<string>\"\n }\n ],\n \"example_url\": \"<string>\"\n }\n ],\n \"message_send_ttl_seconds\": 1295999,\n \"call_permission_request\": true,\n \"cta_url_link_tracking_opted_out\": true,\n \"creative_features\": {},\n \"max_price\": {\n \"bid_amount\": 2,\n \"country_multipliers\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"name": "<string>",
"language": "<string>",
"category": "AUTHENTICATION",
"status": "draft",
"body_text": "<string>",
"body_examples": [
"<string>"
],
"header": {},
"footer_text": "<string>",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "<string>",
"url": "<string>",
"examples": [
"<string>"
],
"example": "<string>",
"phone_number": "<string>",
"flow_id": "<string>",
"ttl_minutes": 22320,
"app_deep_link": {
"android_deep_link": "<string>",
"android_fallback_playstore_url": "<string>"
}
}
],
"rejection_reason": "<string>",
"quality_score": "<string>",
"provider_template_id": "<string>",
"submitted_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"carousel_cards": [
{
"header_format": "IMAGE",
"example_handle": "<string>",
"body_text": "<string>",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "<string>",
"url": "<string>",
"examples": [
"<string>"
],
"phone_number": "<string>"
}
]
}
],
"limited_time_offer": {},
"call_permission_request": true,
"message_send_ttl_seconds": 123,
"cta_url_link_tracking_opted_out": true,
"marketing_options": {},
"source": "<string>",
"sub_category": "<string>",
"pending_category": "<string>",
"template_group": "<string>",
"send_features": [
{}
],
"rejection_reason_text": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "The API is on the Pro plan. Upgrade in Billing to use live keys. Test keys keep working.",
"code": "plan_limit_reached"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>"
}Create a template
Creates a template and, with submit: true, submits it to Meta for review. Names must be lowercase snake case and unique per language.
Required scope: templates:write
curl --request POST \
--url https://lazyapp.in/v1/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"language": "<string>",
"body_text": "<string>",
"body_examples": [
"<string>"
],
"footer_text": "<string>",
"header": {
"text": "<string>",
"examples": [
"<string>"
],
"example_handle": "<string>",
"example_url": "<string>"
},
"buttons": [
{
"text": "<string>",
"url": "<string>",
"examples": [
"<string>"
],
"example": "<string>",
"phone_number": "<string>",
"flow_id": "<string>",
"ttl_minutes": 22320,
"app_deep_link": {
"android_deep_link": "<string>",
"android_fallback_playstore_url": "<string>"
}
}
],
"submit": true,
"library_template_name": "<string>",
"limited_time_offer": {
"text": "<string>",
"has_expiration": true
},
"authentication": {
"add_security_recommendation": true,
"code_expiration_minutes": 45
},
"carousel_cards": [
{
"example_handle": "<string>",
"body_text": "<string>",
"buttons": [
{
"text": "<string>",
"url": "<string>",
"examples": [
"<string>"
],
"phone_number": "<string>"
}
],
"example_url": "<string>"
}
],
"message_send_ttl_seconds": 1295999,
"call_permission_request": true,
"cta_url_link_tracking_opted_out": true,
"creative_features": {},
"max_price": {
"bid_amount": 2,
"country_multipliers": {}
}
}
'import requests
url = "https://lazyapp.in/v1/templates"
payload = {
"name": "<string>",
"language": "<string>",
"body_text": "<string>",
"body_examples": ["<string>"],
"footer_text": "<string>",
"header": {
"text": "<string>",
"examples": ["<string>"],
"example_handle": "<string>",
"example_url": "<string>"
},
"buttons": [
{
"text": "<string>",
"url": "<string>",
"examples": ["<string>"],
"example": "<string>",
"phone_number": "<string>",
"flow_id": "<string>",
"ttl_minutes": 22320,
"app_deep_link": {
"android_deep_link": "<string>",
"android_fallback_playstore_url": "<string>"
}
}
],
"submit": True,
"library_template_name": "<string>",
"limited_time_offer": {
"text": "<string>",
"has_expiration": True
},
"authentication": {
"add_security_recommendation": True,
"code_expiration_minutes": 45
},
"carousel_cards": [
{
"example_handle": "<string>",
"body_text": "<string>",
"buttons": [
{
"text": "<string>",
"url": "<string>",
"examples": ["<string>"],
"phone_number": "<string>"
}
],
"example_url": "<string>"
}
],
"message_send_ttl_seconds": 1295999,
"call_permission_request": True,
"cta_url_link_tracking_opted_out": True,
"creative_features": {},
"max_price": {
"bid_amount": 2,
"country_multipliers": {}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
language: '<string>',
body_text: '<string>',
body_examples: ['<string>'],
footer_text: '<string>',
header: {
text: '<string>',
examples: ['<string>'],
example_handle: '<string>',
example_url: '<string>'
},
buttons: [
{
text: '<string>',
url: '<string>',
examples: ['<string>'],
example: '<string>',
phone_number: '<string>',
flow_id: '<string>',
ttl_minutes: 22320,
app_deep_link: {android_deep_link: '<string>', android_fallback_playstore_url: '<string>'}
}
],
submit: true,
library_template_name: '<string>',
limited_time_offer: {text: '<string>', has_expiration: true},
authentication: {add_security_recommendation: true, code_expiration_minutes: 45},
carousel_cards: [
{
example_handle: '<string>',
body_text: '<string>',
buttons: [
{
text: '<string>',
url: '<string>',
examples: ['<string>'],
phone_number: '<string>'
}
],
example_url: '<string>'
}
],
message_send_ttl_seconds: 1295999,
call_permission_request: true,
cta_url_link_tracking_opted_out: true,
creative_features: {},
max_price: {bid_amount: 2, country_multipliers: {}}
})
};
fetch('https://lazyapp.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://lazyapp.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' => '<string>',
'language' => '<string>',
'body_text' => '<string>',
'body_examples' => [
'<string>'
],
'footer_text' => '<string>',
'header' => [
'text' => '<string>',
'examples' => [
'<string>'
],
'example_handle' => '<string>',
'example_url' => '<string>'
],
'buttons' => [
[
'text' => '<string>',
'url' => '<string>',
'examples' => [
'<string>'
],
'example' => '<string>',
'phone_number' => '<string>',
'flow_id' => '<string>',
'ttl_minutes' => 22320,
'app_deep_link' => [
'android_deep_link' => '<string>',
'android_fallback_playstore_url' => '<string>'
]
]
],
'submit' => true,
'library_template_name' => '<string>',
'limited_time_offer' => [
'text' => '<string>',
'has_expiration' => true
],
'authentication' => [
'add_security_recommendation' => true,
'code_expiration_minutes' => 45
],
'carousel_cards' => [
[
'example_handle' => '<string>',
'body_text' => '<string>',
'buttons' => [
[
'text' => '<string>',
'url' => '<string>',
'examples' => [
'<string>'
],
'phone_number' => '<string>'
]
],
'example_url' => '<string>'
]
],
'message_send_ttl_seconds' => 1295999,
'call_permission_request' => true,
'cta_url_link_tracking_opted_out' => true,
'creative_features' => [
],
'max_price' => [
'bid_amount' => 2,
'country_multipliers' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lazyapp.in/v1/templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"body_text\": \"<string>\",\n \"body_examples\": [\n \"<string>\"\n ],\n \"footer_text\": \"<string>\",\n \"header\": {\n \"text\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"example_handle\": \"<string>\",\n \"example_url\": \"<string>\"\n },\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"example\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"flow_id\": \"<string>\",\n \"ttl_minutes\": 22320,\n \"app_deep_link\": {\n \"android_deep_link\": \"<string>\",\n \"android_fallback_playstore_url\": \"<string>\"\n }\n }\n ],\n \"submit\": true,\n \"library_template_name\": \"<string>\",\n \"limited_time_offer\": {\n \"text\": \"<string>\",\n \"has_expiration\": true\n },\n \"authentication\": {\n \"add_security_recommendation\": true,\n \"code_expiration_minutes\": 45\n },\n \"carousel_cards\": [\n {\n \"example_handle\": \"<string>\",\n \"body_text\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"phone_number\": \"<string>\"\n }\n ],\n \"example_url\": \"<string>\"\n }\n ],\n \"message_send_ttl_seconds\": 1295999,\n \"call_permission_request\": true,\n \"cta_url_link_tracking_opted_out\": true,\n \"creative_features\": {},\n \"max_price\": {\n \"bid_amount\": 2,\n \"country_multipliers\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://lazyapp.in/v1/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"body_text\": \"<string>\",\n \"body_examples\": [\n \"<string>\"\n ],\n \"footer_text\": \"<string>\",\n \"header\": {\n \"text\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"example_handle\": \"<string>\",\n \"example_url\": \"<string>\"\n },\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"example\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"flow_id\": \"<string>\",\n \"ttl_minutes\": 22320,\n \"app_deep_link\": {\n \"android_deep_link\": \"<string>\",\n \"android_fallback_playstore_url\": \"<string>\"\n }\n }\n ],\n \"submit\": true,\n \"library_template_name\": \"<string>\",\n \"limited_time_offer\": {\n \"text\": \"<string>\",\n \"has_expiration\": true\n },\n \"authentication\": {\n \"add_security_recommendation\": true,\n \"code_expiration_minutes\": 45\n },\n \"carousel_cards\": [\n {\n \"example_handle\": \"<string>\",\n \"body_text\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"phone_number\": \"<string>\"\n }\n ],\n \"example_url\": \"<string>\"\n }\n ],\n \"message_send_ttl_seconds\": 1295999,\n \"call_permission_request\": true,\n \"cta_url_link_tracking_opted_out\": true,\n \"creative_features\": {},\n \"max_price\": {\n \"bid_amount\": 2,\n \"country_multipliers\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"body_text\": \"<string>\",\n \"body_examples\": [\n \"<string>\"\n ],\n \"footer_text\": \"<string>\",\n \"header\": {\n \"text\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"example_handle\": \"<string>\",\n \"example_url\": \"<string>\"\n },\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"example\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"flow_id\": \"<string>\",\n \"ttl_minutes\": 22320,\n \"app_deep_link\": {\n \"android_deep_link\": \"<string>\",\n \"android_fallback_playstore_url\": \"<string>\"\n }\n }\n ],\n \"submit\": true,\n \"library_template_name\": \"<string>\",\n \"limited_time_offer\": {\n \"text\": \"<string>\",\n \"has_expiration\": true\n },\n \"authentication\": {\n \"add_security_recommendation\": true,\n \"code_expiration_minutes\": 45\n },\n \"carousel_cards\": [\n {\n \"example_handle\": \"<string>\",\n \"body_text\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"examples\": [\n \"<string>\"\n ],\n \"phone_number\": \"<string>\"\n }\n ],\n \"example_url\": \"<string>\"\n }\n ],\n \"message_send_ttl_seconds\": 1295999,\n \"call_permission_request\": true,\n \"cta_url_link_tracking_opted_out\": true,\n \"creative_features\": {},\n \"max_price\": {\n \"bid_amount\": 2,\n \"country_multipliers\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"name": "<string>",
"language": "<string>",
"category": "AUTHENTICATION",
"status": "draft",
"body_text": "<string>",
"body_examples": [
"<string>"
],
"header": {},
"footer_text": "<string>",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "<string>",
"url": "<string>",
"examples": [
"<string>"
],
"example": "<string>",
"phone_number": "<string>",
"flow_id": "<string>",
"ttl_minutes": 22320,
"app_deep_link": {
"android_deep_link": "<string>",
"android_fallback_playstore_url": "<string>"
}
}
],
"rejection_reason": "<string>",
"quality_score": "<string>",
"provider_template_id": "<string>",
"submitted_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"carousel_cards": [
{
"header_format": "IMAGE",
"example_handle": "<string>",
"body_text": "<string>",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "<string>",
"url": "<string>",
"examples": [
"<string>"
],
"phone_number": "<string>"
}
]
}
],
"limited_time_offer": {},
"call_permission_request": true,
"message_send_ttl_seconds": 123,
"cta_url_link_tracking_opted_out": true,
"marketing_options": {},
"source": "<string>",
"sub_category": "<string>",
"pending_category": "<string>",
"template_group": "<string>",
"send_features": [
{}
],
"rejection_reason_text": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "The API is on the Pro plan. Upgrade in Billing to use live keys. Test keys keep working.",
"code": "plan_limit_reached"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>"
}Authorizations
Your API key, e.g. sk_live_... or sk_test_....
Headers
Optional. Makes this write safe to retry: the same key replays the first response instead of acting twice.
255Body
body_text is required unless library_template_name is set.
512^[a-z0-9_]+$16AUTHENTICATION, UTILITY, MARKETING Use {{1}}-style placeholders.
10245025560Show child attributes
Show child attributes
10Show child attributes
Show child attributes
Submit to Meta immediately.
NAMED uses {{first_name}}-style variables.
POSITIONAL, NAMED Clone a ready-made template from GET /v1/templates/library instead of writing body_text.
512^[a-z0-9_]+$Show child attributes
Show child attributes
Show child attributes
Show child attributes
Media carousels take 2 to 10 cards; product carousels exactly 2 when created. Every card has the same button types.
10Show child attributes
Show child attributes
How long WhatsApp keeps trying to deliver. Authentication 30–900, utility 30–43200, marketing 43200–2592000. -1 means 30 days (authentication and utility only).
-1 <= x <= 2592000Marketing or utility: ask the customer for permission to call them. Body only, no buttons.
Marketing: turn off Meta's click tracking for URL buttons.
Marketing: Meta's automatic creative improvements, such as image_animation or add_text_overlay.
Show child attributes
Show child attributes
Marketing only, after the max price agreement is accepted. Clear it by sending null for both fields.
Show child attributes
Show child attributes
Response
Created.
AUTHENTICATION, UTILITY, MARKETING draft, submitting, pending, approved, rejected, paused, disabled, archived, deleted Show child attributes
Show child attributes
Show child attributes
Show child attributes
Creative features and max price as last submitted.
Set when Meta generated the template (for example from Direct Send). Such templates cannot be edited or deleted here.
The category Meta will move this template to.
uuid of the template group.
Extra inputs a send needs, such as cards, coupon_code or voice_call.