Create and Delete Templates
This part of the documentation describes how to create message Templates via WhatsApp Business API.

Introduction

WhatsApp Message Templates can be created through the WhatsApp Business API. You will find more information on the official Facebook Documentation here. Some important things to note:
Ensure that your templates meet Facebook's strict Message Template Guidelines.
    1.
    We support create and delete for templates. Editing a template is not yet available.
    2.
    The Create API call allows you to add a message template in a specific language.
    3.
    The Delete API call allows you to delete all translations of a message template you specify by name.
    4.
    When you create a message template, make sure to be consistent when providing translations.
    5.
    Every template has to be approved by Facebook.
      You can use your template, as soon as its status changes to approved
        This can take up to 48h. If your template is still in status submitted after two days, please contact Help and Support.

Create a template

You can use the WhatsApp Business Management API to create new message templates, media message templates, or interactive message templates. To create a message template, you have to use the following request:
post
/v1/configs/templates
Currently, you cannot edit message templates. Please use a test account when learning to use the WhatsApp Business Management API.
The handle for examples has to be a valid URL to your media file.
More information about parameters, components, and buttons you can find here: Templates - WhatsApp Business API. More information about all supported languages you can find here: Supported Languages - WhatsApp Business API.
Example: Create template (with HEADER-IMAGE + BODY + BUTTONS-URL + PHONE + FOOTER) Request URL: /v1/configs/templates
1
{
2
"name": "template_name_example",
3
"category": "ACCOUNT_UPDATE",
4
"components": [
5
{
6
"type": "BODY",
7
"text": "What do you want to do now?"
8
},
9
{
10
"type": "HEADER",
11
"format": "IMAGE",
12
"example": {
13
"header_handle": [
14
"https://url-to-media-file/media.file"
15
]
16
}
17
},
18
{
19
"type": "FOOTER",
20
"text": "your-footer-text"
21
},
22
{
23
"type": "BUTTONS",
24
"buttons": [
25
{
26
"type": "PHONE_NUMBER",
27
"text": "your-phone-button-text",
28
"phone_number": "+1(650) 555-1111"
29
},
30
{
31
"type": "URL",
32
"text": "your-url-button-text",
33
"url": "https://www.website.com/{{1}}",
34
"example": [
35
"https://www.website.com/dynamic-url-example"
36
]
37
}
38
]
39
}
40
],
41
"language": "en_US"
42
}
Copied!
Response code:
1
{
2
"category": "ACCOUNT_UPDATE",
3
"components": [
4
{
5
"text": "What do you want to do now?",
6
"type": "BODY"
7
},
8
{
9
"example": {
10
"header_text": [
11
"your-header-example"
12
]
13
},
14
"format": "IMAGE",
15
"type": "HEADER"
16
},
17
{
18
"text": "your-footer-text",
19
"type": "FOOTER"
20
},
21
{
22
"buttons": [
23
{
24
"phone_number": "+1(650) 555-1111",
25
"text": "your-phone-button-text",
26
"type": "PHONE_NUMBER"
27
},
28
{
29
"example": [
30
"https://www.website.com/dynamic-url-example"
31
],
32
"text": "your-url-button-text",
33
"type": "URL",
34
"url": "https://www.website.com/{{1}}"
35
}
36
],
37
"type": "BUTTONS"
38
}
39
],
40
"language": "en_US",
41
"name": "template_name_example",
42
"namespace": "xxxx",
43
"rejected_reason": null,
44
"status": "submitted"
45
}
Copied!

Get template list

You can use the WhatsApp Business Management API to get a list of your existing message templates.
get
/v1/configs/templates

Example:

Response code:

200
1
{
2
"count": 3,
3
"filters": {
4
},
5
"limit": 1000,
6
"offset": 0,
7
"sort": [
8
"id"
9
],
10
"total": 3,
11
"waba_templates": [
12
{
13
"category": "ACCOUNT_UPDATE",
14
"components": [
15
{
16
"format": "TEXT",
17
"text": "Facebook Template Message",
18
"type": "HEADER"
19
},
20
{
21
"text": "Thank you for your request. \nAs Facebook closes the conversation after 24hours we cannot reach out to you anymore besides this template. \nIf you like to get in contact with us again and revoke the conversation please just click on one of the buttons and we get back to you.",
22
"type": "BODY"
23
},
24
{
25
"text": "Many thanks, your 360dialog team",
26
"type": "FOOTER"
27
},
28
{
29
"buttons": [
30
{
31
"text": "RESOLVED",
32
"type": "QUICK_REPLY"
33
},
34
{
35
"text": "NO",
36
"type": "QUICK_REPLY"
37
},
38
{
39
"text": "YES",
40
"type": "QUICK_REPLY"
41
}
42
],
43
"type": "BUTTONS"
44
}
45
],
46
"language": "en",
47
"name": "test_1",
48
"namespace": "xxxxxxxx_xxxx_xxxx_xxxx_xxxxxxxxxxxx",
49
"rejected_reason": "NONE",
50
"status": "APPROVED"
51
},
52
{
53
"category": "TICKET_UPDATE",
54
"components": [
55
{
56
"text": "Thank you for reaching out to us. We are looking into your request and get back to you.",
57
"type": "BODY"
58
},
59
{
60
"text": "Feel free to get in contact",
61
"type": "FOOTER"
62
},
63
{
64
"buttons": [
65
{
66
"phone_number": "+49xxxxxxxxx",
67
"text": "Call number",
68
"type": "PHONE_NUMBER"
69
},
70
{
71
"text": "360dialog Website",
72
"type": "URL",
73
"url": "https://www.360dialog.com/de/whatsapp-business/"
74
}
75
],
76
"type": "BUTTONS"
77
}
78
],
79
"language": "en",
80
"name": "test_2",
81
"namespace": "xxxxxxxx_xxxx_xxxx_xxxx_xxxxxxxxxxxx",
82
"rejected_reason": "NONE",
83
"status": "APPROVED"
84
},
85
{
86
"category": "TICKET_UPDATE",
87
"components": [
88
{
89
"text": "Hello {{1}}! This is a test message, setup with API version {{2}}",
90
"type": "BODY"
91
},
92
{
93
"buttons": [
94
{
95
"text": "Follow the link!",
96
"type": "URL",
97
"url": "https://www.360dialog.com/{{1}}"
98
}
99
],
100
"type": "BUTTONS"
101
},
102
{
103
"text": "This is the footer",
104
"type": "FOOTER"
105
}
106
],
107
"language": "en",
108
"name": "test_3",
109
"namespace": "xxxxxxxx_xxxx_xxxx_xxxx_xxxxxxxxxxxx",
110
"rejected_reason": "NONE",
111
"status": "APPROVED"
112
}
113
]
114
}
Copied!

Delete a template

You can use the WhatsApp Business Management API to delete your message templates by providing the message template name. Some things to keep in mind before deleting a message template:
    If that message template name exists in multiple languages, all languages will be deleted.
    Messages that have been sent but not delivered (e.g., if the customer's device is offline) will attempt to be delivered for 30 days.
    If a message from an approved message template is sent 30 days after deletion, you will receive a "Structure Unavailable" error and the customer will not receive the message.
    Once deleted, the name of an approved template cannot be used again for 30 days. Use a different name to create future templates.
delete
/v1/configs/templates/{template_name}
More information on what is possible with templates can be found in the Facebook Template Message guide and the Facebook Template reference guide.
Last modified 3mo ago