Check out our upcoming events and meetups! View events →
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const template = await client.whatsapp.templates.create({
category: 'MARKETING',
components: [{ format: 'TEXT', type: 'HEADER' }],
language: 'language',
name: 'name',
waba_id: 'waba_id',
});
console.log(template.data);{
"data": {
"id": "<string>",
"record_type": "whatsapp_message_template",
"template_id": "<string>",
"name": "<string>",
"category": "MARKETING",
"language": "<string>",
"status": "<string>",
"rejection_reason": "<string>",
"components": [
{}
],
"whatsapp_business_account": {
"id": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Documentation Index
Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The WhatsApp Business Account ID.
Template name. Lowercase letters, numbers, and underscores only.
Template category: AUTHENTICATION, UTILITY, or MARKETING.
MARKETING, UTILITY, AUTHENTICATION Template language code (e.g. en_US, es, pt_BR).
Template components defining message structure. Passed through to Meta Graph API. Templates with variables must include example values. Supports HEADER, BODY, FOOTER, BUTTONS, CAROUSEL and any future Meta component types.
A template component. Additional Meta component types not listed here are also accepted.
Show child attributes
Template created
Show child attributes
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const template = await client.whatsapp.templates.create({
category: 'MARKETING',
components: [{ format: 'TEXT', type: 'HEADER' }],
language: 'language',
name: 'name',
waba_id: 'waba_id',
});
console.log(template.data);{
"data": {
"id": "<string>",
"record_type": "whatsapp_message_template",
"template_id": "<string>",
"name": "<string>",
"category": "MARKETING",
"language": "<string>",
"status": "<string>",
"rejection_reason": "<string>",
"components": [
{}
],
"whatsapp_business_account": {
"id": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}