createWhatsAppTemplate
Requires permission settings:integration:update.
Submits a new message template, with optional header, footer and buttons, to the WhatsApp provider for approval. Requires permission to update integrations.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation CreateWhatsAppTemplate($input: CreateWhatsAppTemplateInput!) {
createWhatsAppTemplate(input: $input) {
name
approvalStatus
detail
ok
templateId
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CreateWhatsAppTemplate($input: CreateWhatsAppTemplateInput!) {\n createWhatsAppTemplate(input: $input) {\n name\n approvalStatus\n detail\n ok\n templateId\n }\n}",
"variables": {
"input": {
"body": "string",
"bodyText": [
"string"
],
"buttons": [
{
"text": "string",
"type": "string"
}
],
"category": "string",
"displayName": "string",
"language": "string"
}
}
}
EOF
Variables:
{
"input": {
"body": "string",
"bodyText": [
"string"
],
"buttons": [
{
"text": "string",
"type": "string"
}
],
"category": "string",
"displayName": "string",
"language": "string"
}
}
Response:
{
"data": {
"createWhatsAppTemplate": {
"name": "string",
"approvalStatus": "string",
"detail": "string",
"ok": true,
"templateId": "string"
}
}
}
createWhatsAppTemplate(
input: CreateWhatsAppTemplateInput!
provider: WhatsAppProvider
): WhatsAppCreateTemplateResultGql!
Arguments
createWhatsAppTemplate.input ● CreateWhatsAppTemplateInput! non-null input
The template's name, language, category, header, body, footer and buttons.
createWhatsAppTemplate.provider ● WhatsAppProvider enum
The WhatsApp provider to use. Omit it to use the organization's enabled provider, else its most recently edited one.
Type
WhatsAppCreateTemplateResultGql object
The result of creating a template.