Skip to content
Get started
Esc
List templates

Templates

GET /v1/templates

WhatsApp only

The number's approved templates: name, language, category and placeholders in order.

Code language
// npm install @airboxhq/api
// AIRBOX_API_KEY=YOUR_API_KEY node templates.mjs
import { Airbox } from "@airboxhq/api";

const client = new Airbox(process.env.AIRBOX_API_KEY);

const { data, error } = await client.templates.list();

if (error) {
  throw new Error(`${error.code}: ${error.message} (${error.requestId})`);
}

console.log(data);
Response 200
{
    "data": [
        {
            "name": "order_ready",
            "language": "ru",
            "category": "utility",
            "parameters": [
                "1",
                "2"
            ],
            "body": "Hello, {{1}}! Your order #{{2}} is ready."
        }
    ]
}