This is the reference documentation for the Zenvia REST-like API. The API itself is based on resources that are represented by JSON format and are manipulated using the HTTP protocol.
You can send messages through the Zenvia-supported channels.
You can also subscribe to events and receive them on a webhook of your choosing. The available events for each and every channel are:
Before using this API you need the following:
You can use the Sandbox to start using and testing this API immediately.
You can also access Zenvia platform to view your Usage Report
The fastest way to begin utilizing this API is with our Sandbox (available on the Zenvia platform).
As you create your new Sandbox, you'll be guided step-by-step in order to start sending and receiving messages using your desired channel.
Click here and start sending and receiving messages using RCS, WhatsApp or SMS using this API.
You are allowed to send test messages to phone numbers you've connected during a 24-hour period. Following that, you must reconnect your number by sending the keyword once again to continue using the Sandbox's features.
All breaking changes to Zenvia APIs will be documented here.
Currently, the Zenvia APIs is on version v2.
channels
attribute from the template resource.You can still check v1 version clicking here.
HTTP methods are used to manipulate resources. Though, as not all resources allow all HTTP operations, observeOK the reference of each resource below.
Methods used with collection endpoints:
HTTP Method | Operation | Success HTTP status |
---|---|---|
GET | List collection items | 200 - OK |
POST | Create a new item | 200 - OK |
Methods used with item endpoints:
HTTP Method | Operation | Success HTTP status |
---|---|---|
GET | Retrieve one resource item | 200 - OK |
DELETE | Delete one resource item | 204 - No content |
PATCH | Update one resource item | 200 - OK |
When an operation is executed successfully, the API will respond with a 2xx status code.
When one error occurs, the API will return a 4xx or 5xx HTTP status code and the payload with an Error Object.
The error object obeys the follwing schema:
code required | string (Code) An error code to identify the error programmatically. |
message required | string (Message) A human readable text to help on error troubleshooting. |
Array of objects (Details) Error details to help identify the problem source. |
{- "code": "VALIDATION_ERROR",
- "message": "Validation error",
- "details": [
- {
- "code": "string",
- "path": "string",
- "message": "string"
}
]
}
Responses error codes are detailed below.
Http Status Code | Code | Message | Retry request |
---|---|---|---|
400 | VALIDATION_ERROR | Validation error | No |
401 | AUTHENTICATION_ERROR | No authorization token was found | No |
404 | NOT_FOUND | Not found | No |
409 | DUPLICATED | Entity already exists | No |
500 | INTERNAL_ERROR | Internal error | Yes |
To use this API you need to send the API token in every request.
The token needs to be sent in the HTTP header X-API-TOKEN
.
X-API-TOKEN: hKp94crjv9OF3UGrCpSXUJw1-UYHhRvLKNLt
Generate your token on the API console on Zenvia platform.
This is an advanced version of the token authentication.
In this approach, alongside the X-API-Token
http header, it is necessary to send a request signature.
The signature is expected in the X-API-Signature
http header.
This signature needs to be generated for each request, since it is unique to the request.
Although similar, the standard token do not support signature, and the signature token always requires a signature.
Both types of token can be created in the API console on Zenvia platform.
X-API-Token: hKp94crjv9OF3UGrCpSXUJw1-UYHhRvLKNLt
X-API-Signature: rtHTyAfsJFD5UFpPDeztUI3JE0Guea5pqG9iJqrT2EY=
The signature is a HMAC-SHA256 hash, calculated using the token secret obtained at the creation of the signature token in the API console, encoded as a base64 string.
The input for the hash generation is a multiline string, composed by six lines separated by unix line breaks: \n
, without an empty line in the end.
The components of each line are the following:
The request method.
Ex: POST
, GET
.
The MD5 hash of the request body.
Ex: d98bd30dcb3c03d166eee84efba1e3d7
multipart/form-data
, only the file content from the request is expected for the hash calculation.The request Content-Type
header.
Ex: application/json
.
multipart/form-data
, the file content type should be used.The request Date
header, formatted following the RFC2616.
Ex: Sun, 12 Feb 2023 07:40:32 GMT
.
The request hostname. It probably will always be api.zenvia.com.
Ex: api.zenvia.com
.
The request resource, including the query string when present.
Ex: /v2/channels/whatsapp/messages
, /v2/files?limit=5
.
POST
d98bd30dcb3c03d166eee84efba1e3d7
application/json
Sun, 12 Feb 2023 07:40:32 GMT
api.zenvia.com
/v2/channels/whatsapp/messages
GET
Sun, 12 Feb 2023 07:40:32 GMT
api.zenvia.com
/v2/files?limit=5
const crypto = require('crypto');
const payload = JSON.stringfy({
from: 'sms-account',
to: '55108888888888',
contents: [{
type: 'text',
text: 'Hi Zenvia!',
}],
});
const date = new Date().toUTCString();
const contentType = 'application/json';
const stringToSign = `POST
${crypto.createHash('md5').update(payload).digest('hex')}
${contentType}
${date}
api.zenvia.com
/v2/channels/sms/messages`;
const token = '123456';
const secret = 'ABCDEF';
const signature = crypto.createHmac('sha256', secret).update(stringToSign).digest('base64');
const headers = {
Date: date,
'Content-Type': contentType,
'X-API-Token': token,
'X-API-Signature': signature,
}
console.log(headers);
The JWT token is primarily used by front-end applications for user interactions.
For server-to-server integrations use the token authentication approach.
For each content type covered in the next section, the following table reflects its support for each available channel:
Content Type | SMS | RCS | Voice | Telegram | GBM* | ||||
---|---|---|---|---|---|---|---|---|---|
text | ✔ | ✔ | ✔ | ✔ | ✕ | ✔ | ✔ | ✔ | ✕ |
file | ✕ | ✔ | ✔ | ✔ | ✕ | ✔ | ✔ | ✔ | ✕ |
replyable_text | ✕ | ✔ | ✕ | ✔ | ✕ | ✕ | ✔ | ✔ | ✕ |
template | ✔ | ✕ | ✔ | ✔ | ✕ | ✕ | ✕ | ✕ | ✔ |
card | ✕ | ✔ | ✕ | ✔ | ✕ | ✕ | ✔ | ✔ | ✕ |
carousel | ✕ | ✔ | ✕ | ✔ | ✕ | ✕ | ✔ | ✔ | ✕ |
contacts | ✕ | ✕ | ✔ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
location | ✕ | ✕ | ✔ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
call | ✕ | ✕ | ✕ | ✕ | ✔ | ✕ | ✕ | ✕ | ✕ |
✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✔ | |
button | ✕ | ✕ | ✔ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
list | ✕ | ✕ | ✔ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
product_list | ✕ | ✕ | ✔ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
product | ✕ | ✕ | ✔ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
*GBM stands for Google Business Messages
This type of content is the most used one and is composed of plain text.
type required | string (Content type) Content type discriminator |
text required | string non-empty Text to be sent. When a URL is sent in the text, a URL preview will be added to the message, if the channel supports it.
|
{- "type": "text",
- "text": "This is a text.",
- "payload": "string"
}
This type of content is used to send a file to the user. Depending on the file type, the file itself will be displayed with a different appearance. There are four types of presentation:
type required | string (Content type) Content type discriminator |
fileUrl required | string URL of the file to be sent. The image at this URL should be publicly accessible and downloadable. |
thumbnailUrl | string Image URL to be used as a thumbnail for media files. Accepted formats are PNG, JPEG and GIF. The image at this URL should be publicly accessible and downloadable..
|
thumbnailMimeType | string MIME type of the file to be sent. If not sent, the MIME type will be identified using the content type sent in the request header. |
fileMimeType | string MIME type of the file to be sent. If not sent, the MIME type will be identified using the content type sent in the request header. |
fileName | string The name of the file.
|
fileCaption | string Some description for the file.
|
{- "type": "file",
- "thumbnailMimeType": "image/png",
- "fileMimeType": "application/pdf",
- "fileName": "document.pdf",
- "fileCaption": "Some caption"
}
This is the same as text content, but is followed by buttons for quick replying.
type required | string (Content type) Content type discriminator |
text required | string non-empty Text to be sent. When a URL is sent in the text, a URL preview will be added to the message, if the channel supports it.
|
Array of any (Quick reply buttons) <= 13 items Horizontal list of buttons displayed after the content. These will fade away once one is clicked. |
{- "type": "replyable_text",
- "text": "This is a text.",
- "payload": "string",
- "quickReplyButtons": [
- {
- "type": "string",
- "text": "Click me!",
- "payload": "clicked-on-button-1"
}
]
}
This type of content has an underlying fixed text content with some required variables. With the fields of the template properly filled, the template must be submitted for approval. This approval depends solely on WhatsApp, and the criteria are strict.
type required | string (Content type) Content type discriminator |
templateId required | string The template identifier. Click here to go to the template page. |
Cards (object) or Product Sections (object) The available fields to be used in this template. |
{- "type": "template",
- "templateId": "c2c3e42d-6fb7-4ad6-897a-dd7613469f58",
- "fields": {
- "user": "John Smith",
- "protocol": "34534252"
}
}
You may submit templates for approval using our template console if you already own a WhatsApp Business account with us.
This type of content is rich and is composed of at least one of the following components (none of them are mandatory):
Additionally, it may include:
More information on each attribute may be found below:
type required | string (Content type) Content type discriminator |
title | string A title in bold shown above the text of the card.
|
text | string A text to be displayed inside the card.
|
object (Media) An image or a video to be displayed inside the card. | |
Array of any (Buttons) <= 4 items Vertical list of buttons displayed inside a card. These will not fade away once a button is clicked. | |
Array of any (Quick reply buttons) <= 13 items Horizontal list of buttons displayed after the content. These will fade away once one is clicked. |
{- "type": "card",
- "title": "Hello",
- "text": "This is the best thing you will see today!",
- "media": {
- "disposition": "ON_THE_LEFT",
- "caption": "Zenvia's team picture"
}, - "buttons": [
- {
- "type": "string",
- "text": "Click me!",
- "payload": "clicked-on-button-1"
}
], - "quickReplyButtons": [
- {
- "type": "string",
- "text": "Click me!",
- "payload": "clicked-on-button-1"
}
]
}
This type of content displays a horizontally scrollable sequence of cards, with some differences and limitations.
More details may be found below.
type required | string (Content type) Content type discriminator |
cardWidth | string Default: "MEDIUM" Enum: "SMALL" "MEDIUM" The card width, which is always smaller than the width of the standalone card. The standard card width would be the equivalent of |
required | Array of objects (Card) [ 1 .. 10 ] items The sequence of cards to be shown in the carousel. |
Array of any (Quick reply buttons) <= 13 items Horizontal list of buttons displayed after the content. These will fade away once one is clicked. |
{- "type": "carousel",
- "cardWidth": "SMALL",
- "cards": [
- {
- "title": "Hello",
- "text": "This is the best thing you will see today!",
- "media": {
- "disposition": "ON_THE_TOP_SHORT_HEIGHT",
- "caption": "Zenvia's team picture"
}, - "buttons": [
- {
- "type": "string",
- "text": "Click me!",
- "payload": "clicked-on-button-1"
}
]
}
], - "quickReplyButtons": [
- {
- "type": "string",
- "text": "Click me!",
- "payload": "clicked-on-button-1"
}
]
}
This type of content is used to send contact information to the user.
type required | string (Content type) Content type discriminator |
required | Array of objects non-empty A list of contacts |
{- "type": "contacts",
- "contacts": [
- {
- "addresses": [
- {
- "street": "Street Address, 123",
- "city": "City name",
- "state": "SP",
- "zip": "01000-000",
- "country": "Brazil",
- "countryCode": "BR",
- "type": "WORK"
}
], - "birthday": "11/10/1980",
- "contactImage": "string",
- "emails": [
- {
- "email": "my-email@email-domain.com",
- "type": "HOME"
}
], - "ims": [
- {
- "service": "This is a messaging service",
- "userId": "johnsmith"
}
], - "name": {
- "formattedName": "John Megan Smith",
- "firstName": "John",
- "lastName": "Smith",
- "middleName": "Megan",
- "suffix": "PhD",
- "prefix": "Mr."
}, - "org": {
- "company": "Ms. Sara",
- "department": "Sales",
- "title": "Manager"
}, - "phones": [
- {
- "phone": "+5521999998888",
- "type": "CELL",
- "waId": "string"
}
],
}
]
}
This type of content is used to send location messages represented as a point on the map to the user.
type required | string (Content type) Content type discriminator |
longitude required | number Longitude of the location |
latitude required | number Latitude of the location |
name | string Name of the location |
address | string Address of the location. Only displayed if name is present. |
url | string URL for the website where the location information was downloaded (WhatsApp restriction: available only on IN direction) |
{- "type": "location",
- "longitude": -122.425332,
- "latitude": 37.758056,
- "name": "Home",
- "address": "Home Address",
}
type required | string (Content type) Content type discriminator |
any (Object header) | |
body required | string (Body text) [ 1 .. 1024 ] characters |
footer | string (Footer text) [ 1 .. 60 ] characters |
required | Array of objects (List of buttons) [ 1 .. 10 ] items |
{- "type": "button",
- "header": {
- "type": "text",
- "text": "Header text"
}, - "body": "Body text.",
- "footer": "Footer text.",
- "buttons": [
- {
- "id": "Button ID",
- "title": "Button text"
}
]
}
type required | string (Content type) Content type discriminator |
header | string (Header text) [ 1 .. 60 ] characters |
body required | string (Body text) [ 1 .. 1024 ] characters |
footer | string (Footer text) [ 1 .. 60 ] characters |
button required | string (List button) [ 1 .. 20 ] characters Button used to open the list. Does not allow emojis or markdown. |
required | Array of objects (List of sections) [ 1 .. 10 ] items |
{- "type": "list",
- "header": "Header text.",
- "body": "Body text.",
- "footer": "Footer text.",
- "button": "string",
- "sections": [
- {
- "title": "Section name",
- "rows": [
- {
- "id": "Row id",
- "title": "Row title",
- "description": "Row description"
}
]
}
]
}
This is the Voice channel content.
type required | string (Content type) Content type discriminator |
Array of any (content.audio-sources.all) A sequence of audio bits forming a message to be played at the beginning of the call | |
transferTo | string Transfer or call to another number when the audio message has been completely played |
recordAudio | boolean Record the call |
hangUpOnVoiceMail | boolean End the call on voicemail |
{- "type": "call",
- "audio": [
- {
- "type": "string",
- "text": "This is a text",
- "voiceStyle": "br-Ricardo",
- "awaitRecipientAnswer": true
}
], - "transferTo": "5510999999999",
- "recordAudio": true,
- "hangUpOnVoiceMail": true
}
This is the E-Mail channel content.
type required | string (Content type) Content type discriminator |
subject required | string non-empty The e-mail subject |
html required | string <= 32768 characters The e-mail content in HTML format.
|
Array of objects (File) E-mail attachments. | |
Array of objects (Courtesy Copy) List of e-mails addresses to be copied on the e-mail. | |
Array of objects (Blind Courtesy Copy) List of e-mails addresses to be secretly copied on the e-mail. | |
object (Reply To) E-mail that will be set as recipient when a e-mail response is initiated. |
{- "type": "email",
- "subject": "Re: Ticket 12345",
- "html": "<b>Hi!</b><br><img src=\"cid:example2.jpeg\">",
- "attachments": [
], - "cc": [
- {
- "email": "cc1@zenvia.com"
}, - {
- "email": "cc2@zenvia.com",
- "name": "CC2"
}
], - "bcc": [
- {
- "email": "bcc1@zenvia.com"
}, - {
- "email": "bcc2@zenvia.com",
- "name": "BCC2"
}
], - "replyTo": {
- "email": "reply-to@zenvia.com",
- "name": "Service Care"
}
}
This the SMS version of the text content. It has additional parameters specific to the SMS integration.
type required | string (Content type) Content type discriminator |
text required | string non-empty Text to be sent. When a URL is sent in the text, a URL preview will be added to the message, if the channel supports it.
|
encodingStrategy | string Default: "AUTO" Enum: "AUTO" "MORE_CHARACTER_SUPPORT" "MORE_CHARACTERS_PER_MESSAGE" The method used for selecting the message encoding used to dispatch the message to the provider.
|
reportId | number [ -2147483648 .. 2147483647 ] An ID used for report purposes only (also known as aggregate id). It must be setup before use.
|
{- "type": "text",
- "text": "This is a text.",
- "payload": "string",
- "encodingStrategy": "AUTO",
- "reportId": 12345
}
Single product message. This is a WhatsApp channel content.
type required | string (Content type) Content type discriminator |
body | string Body content |
footer | string Footer content |
catalogId required | string The catalog identifier. Click here to go to the catalogs page. |
productId required | string The product identifier. |
{- "type": "product",
- "body": "Text body content",
- "footer": "Text footer content",
- "catalogId": "string",
- "productId": "string"
}
Product list message. This is a WhatsApp channel content.
type required | string (Content type) Content type discriminator |
header | string Header content |
body required | string Body content |
footer | string Footer content |
catalogId required | string The catalog identifier. Click here to go to the catalogs page. |
required | Array of objects (Product Sections) The available fields to be used in a product list. Only applicable to WhatsApp channel. |
{- "type": "product_list",
- "header": "Text header content",
- "body": "Text body content",
- "footer": "Text footer content",
- "catalogId": "string",
- "sections": [
- {
- "title": "title",
- "productItems": [
- {
- "productId": "MY_PRODUCT_ID"
}
]
}
]
}
type required | string (Content type) Content type discriminator |
mediaUrl | string URL of an image to be displayed inside the opt-in request. |
title required | string The topic of the recurring messages subscription. This will be displayed in the opt-in request. |
frequency required | string Enum: "DAILY" "WEEKLY" "MONTHLY" How often the messages will be sent after the contact opted-in. |
reOptIn | string Default: "ENABLED" Enum: "ENABLED" "DISABLED" Allow the contact to opt-in back again after opting-out. |
payload | string Content to be sent back as an opt-in response message event when the contact accepts to receive recurring messages. |
timezone | string Default: "UTC" Indicates the timezone that will be used for scheduling the recurring messages. |
{- "type": "optin_request",
- "title": "Weekly Sale",
- "frequency": "DAILY",
- "reOptIn": "ENABLED",
- "payload": "string",
- "timezone": "America/Sao_Paulo"
}
This is Whatsapp Product List Order content. This is supported only in the webhook content.
type required | string (Content type) Content type discriminator |
text | string Text content |
catalogId required | string The catalog identifier. |
required | Array of objects The available fields to be used in this product list order. |
{- "type": "product_list_order",
- "text": "Text content",
- "catalogId": "string",
- "productItems": [
- {
- "productId": "string",
- "quantity": "string",
- "itemPrice": "string",
- "currency": "string"
}
]
}
This is Instagram and Facebook recurring message optin response content. This is supported only in the webhook content.
type required | string (Content type) Content type discriminator |
recurringMessagesRecipient | string The contact id that needs to be used to send the recurring messages for the topic the user has opted-in. You will receive a unique contact id for each topic the user opts-in. Therefore, this needs to be used the recipient ( |
optInExpiration | string The timestamp when the opt-in will expire and no longer be usable, unless renewed. |
optInStatus | string (OptIn Status) Enum: "OPTIN" "OPTOUT" "REOPTIN" Indicates whether this is a new opt-in, an opt-out, or a reopt-in. |
frequency | string Enum: "DAILY" "WEEKLY" "MONTHLY" How often the recurring messages may be sent. |
payload | string The payload set in the opt-in request message of this opt-in response. |
{- "type": "optin_response",
- "recurringMessagesRecipient": "string",
- "optInExpiration": "string",
- "optInStatus": "OPTIN",
- "frequency": "DAILY",
- "payload": "string"
}
The SMS channel may be used after its activation on Zenvia platform.
Get in touch with Zenvia consultants to create your account.
Webhooks allow you to receive events in the configured URL. Learn more here.
A SMS has a maximum length of 140 bytes, which can be used either with the standard encoding, which supports 160 characters (7 bits each), or using an unicode encoding, which supports 70 characters (16 bits each).
The standard encoding supports around 110 different characters, while the unicode encoding supports around 65500 characters.
Here are some examples of characters which are only supported by the unicode encoding:
çÇáéíóúýÁÉÍÓÚÝàèìòùÀÈÌÒÙãõñäëïöüÿÄËÏÖÜÃÕÑâêîôûÂÊÎÔÛºª°|
By default, our API selects automatically the SMS encoding based on the message content.
However, it is also possible to enforce an encoding strategy
. More details can be found in the SMS Text section.
To overcome the SMS size limitation, cellphone manufacturers developed a feature called concatenated SMS
.
This allows a long message to be break down into multiple SMS messages for delivery, which are joined back together by the cellphone SMS application.
Therefore, when a message is longer than 160 characters in the standard encoding or 70 characters in the unicode encoding, this feature will be applied automatically.
Important things to keep in mind:
When you send a message to a contact using SMS channel:
When you receive a message from a contact, the sender and recipient are inverted:
The sender goes in the attribute from
and the receiver goes in the attribute to
of message object.
Send a SMS message
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
required | Array of objects (Message Contents) non-empty A list of content to be sent |
object (Conversation Content) |
id | string (Message ID) An ID for the message. It can be used for future message consulting or callback notifications. |
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
direction | string (Message direction) Enum: "IN" "OUT" Indicates whether the message is received from a channel (IN) or sent to a channel (OUT) |
channel | string (Message channel) Message channel |
required | Array of objects (Message Contents) non-empty A list of content to be sent |
timestamp | string <date-time> (Message timestamp) Timestamp of the message. Usually received from the provider of the channel. |
object (Conversation Content) |
{- "externalId": "my-campaign-name",
- "from": "sms-account",
- "to": "55108888888888",
- "contents": [
- {
- "type": "text",
- "text": "Hi Zenvia!"
}
]
}
{- "id": "string",
- "externalId": "string",
- "from": "string",
- "to": "string",
- "direction": "IN",
- "channel": "string",
- "contents": [
- {
- "type": "text",
- "text": "This is a text.",
- "payload": "string",
- "encodingStrategy": "AUTO",
- "reportId": 12345
}
], - "timestamp": "2019-08-24T14:15:22Z",
- "conversation": {
- "solution": "conversion"
}
}
The WhatsApp channel may be used after its activation on Zenvia platform.
To activate WhatsApp you a need a registered number on WhatsApp Business API and an account registered on Zenvia platform.
Get in touch with Zenvia consultants to create your account.
Webhooks allow you to receive events in the configured URL. Learn more here.
The WhatsApp API has some limitations:
To start a conversation with someone you need a specific type of message caled a template message, which requires approval before being used.
Messages not being as template content type, can only be delivered inside a 24-hour window since the last sent message by the client to the company.
When sending PNG images with a transparent background, you can get an unexpected final result due to the image processing performed by WhatsApp in order to convert the image to JPEG.
Media | Content Type | Post-Processing Media Size* |
---|---|---|
document | Any valid MIME type. | 100 MB |
image | image/jpeg image/png |
5 MB |
sticker | image/webp Note: Animated sticker is not supported. |
100 KB |
audio | audio/acc audio/mp4 audio/amr audio/mpeg audio/ogg; codecs=opus Note: The base audio/ogg type is not supported. |
16 MB |
video | video/mp4 video/3gpp Notes:
|
16 MB |
*The size of the media file after encryption. The maximum file size for media that can be uploaded is 64MB.
When you send a message to a contact using WhatsApp channel:
When you receive a message from a contact, the sender and recipient are inverted:
The sender goes in the attribute from
and the receiver goes in the attribute to
of message object.
Send a WhatsApp message
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
required | Array of objects (Message Contents) non-empty A list of content to be sent |
idRef | string Id of the message sent or received in the conversation channel to reference as a message reply.
|
contentRef | number Default: 0 Index of the content in the message sent or received in the conversation channel to reference as a message reply.
|
object (Conversation Content) |
id | string (Message ID) An ID for the message. It can be used for future message consulting or callback notifications. |
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
direction | string (Message direction) Enum: "IN" "OUT" Indicates whether the message is received from a channel (IN) or sent to a channel (OUT) |
channel | string (Message channel) Message channel |
required | Array of objects (Message Contents) non-empty A list of content to be sent |
timestamp | string <date-time> (Message timestamp) Timestamp of the message. Usually received from the provider of the channel. |
idRef | string Id of the message sent or received in the conversation channel to reference as a message reply.
|
contentRef | number Default: 0 Index of the content in the message sent or received in the conversation channel to reference as a message reply.
|
object (Conversation Content) |
{- "externalId": "my-campaign-name",
- "from": "5510999999999",
- "to": "55108888888888",
- "contents": [
- {
- "type": "text",
- "text": "Hi Zenvia!"
}
]
}
{- "id": "string",
- "externalId": "string",
- "from": "string",
- "to": "string",
- "direction": "IN",
- "channel": "string",
- "contents": [
- {
- "type": "text",
- "text": "This is a text.",
- "payload": "string"
}
], - "timestamp": "2019-08-24T14:15:22Z",
- "idRef": "7390113b-e120-41b5-8a07-c4567726abc2",
- "contentRef": 1,
- "conversation": {
- "solution": "conversion"
}
}
The Instagram channel may be used after its activation on Zenvia Platform.
Get in touch with Zenvia consultants to connect your account.
To be able to send messages to a contact, you first need to setup a webhook, which will allow you to receive events in the configured URL. Learn more here.
The Instagram API content type and size limitations for sending media:
Media | Content Type | Media Size |
---|---|---|
image | image/jpeg image/png image/ico image/bmp image/webp image/* |
8 MB |
audio | audio/* | Currently not supported |
video | video/* | Currently not supported |
document | Any other valid MIME type. | Currently not supported |
When you receive a message from a contact from Instagram channel:
When you send a message to a contact, the sender and recipient are inverted:
The sender goes in the attribute from
and the receiver goes in the attribute to
of message object.
Send a Instagram message
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
required | Array of objects (Message Contents) non-empty A list of content to be sent |
object (Representative Object) Provides information on the representative who sent the message.
| |
object (Conversation Content) |
id | string (Message ID) An ID for the message. It can be used for future message consulting or callback notifications. |
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
direction | string (Message direction) Enum: "IN" "OUT" Indicates whether the message is received from a channel (IN) or sent to a channel (OUT) |
channel | string (Message channel) Message channel |
required | Array of objects (Message Contents) non-empty A list of content to be sent |
timestamp | string <date-time> (Message timestamp) Timestamp of the message. Usually received from the provider of the channel. |
object (Representative Object) Provides information on the representative who sent the message.
| |
object (Conversation Content) |
{- "externalId": "my-campaign-name",
- "from": "ig-account-id",
- "to": "ig-contact-id",
- "contents": [
- {
- "type": "text",
- "text": "Hi Zenvia!"
}
]
}
{- "id": "string",
- "externalId": "string",
- "from": "string",
- "to": "string",
- "direction": "IN",
- "channel": "string",
- "contents": [
- {
- "type": "text",
- "text": "This is a text.",
- "payload": "string"
}
], - "timestamp": "2019-08-24T14:15:22Z",
- "representative": {
- "type": "HUMAN"
}, - "conversation": {
- "solution": "conversion"
}
}
The Facebook channel may be used after you connect a Facebook page on Zenvia platform.
To be able to send messages to a contact, you first need to setup a webhook, which will allow you to receive events in the configured URL. Learn more here.
When you receive a message from a contact from Facebook channel:
When you send some message to a contact, the sender and recipient are inverted:
The sender goes in the attribute from
and the receiver goes in the attribute to
of message object.
Send a Facebook message
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
required | Array of objects (Message Contents) non-empty A list of content to be sent |
object (Conversation Content) |
id | string (Message ID) An ID for the message. It can be used for future message consulting or callback notifications. |
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
direction | string (Message direction) Enum: "IN" "OUT" Indicates whether the message is received from a channel (IN) or sent to a channel (OUT) |
channel | string (Message channel) Message channel |
required | Array of objects (Message Contents) non-empty A list of content to be sent |
timestamp | string <date-time> (Message timestamp) Timestamp of the message. Usually received from the provider of the channel. |
object (Conversation Content) |
{- "externalId": "my-campaign-name",
- "from": "fb-page-id",
- "to": "fb-contact-id",
- "contents": [
- {
- "type": "text",
- "text": "Hi Zenvia!"
}
]
}
{- "id": "string",
- "externalId": "string",
- "from": "string",
- "to": "string",
- "direction": "IN",
- "channel": "string",
- "contents": [
- {
- "type": "text",
- "text": "This is a text.",
- "payload": "string"
}
], - "timestamp": "2019-08-24T14:15:22Z",
- "conversation": {
- "solution": "conversion"
}
}
The RCS channel may be used after its activation on Zenvia platform.
Get in touch with Zenvia consultants to create your Google agent (a conversational entity that interacts with users by sending messages and reacting to users' responses).
Webhooks allow you to receive events in the configured URL. Learn more here.
Rich Communcation Services, or RCS for short, is a messaging protocol similar to SMS, where it's used by telecommunications providers as a standard of messaging. In practical terms, the messaging process is similar to SMS:
Unlike the traditional text messaging format (SMS), RCS significantly introduces a range of dynamic features. Suggested actions and replies enable users to engage in conversations more efficiently, offering contextually relevant options based on the message content. With the integration of cards and carousels, users can share interactive content, such as location maps, images, and links, seamlessly within the chat interface. The protocol also supports read receipts, delivery receipts, and typing indicators, providing users with real-time visibility into the status of their messages.
Check out visually how these RCS features look here.
The RCS channel is compatible only with Android smartphones with 8.0 version (Oreo) or above. Most Android devices already come with RCS enabled.
The use of RCS channel follows Google's content policies, available through this link: https://developers.google.com/business-communications/rcs-business-messaging/support/tos.
When you send a message to a contact using RCS channel:
When you receive a message from a contact, the sender and recipient are inverted:
The sender goes in the attribute from
and the receiver goes in the attribute to
of message object.
RCS business messaging (or RBM for short) allows a business with a Google-provided RBM agent to send RCS messages to mobile end-users. This agent is associated with branding and business information, such as a logo, description, webistes, brand name, and more. The Verified Sender Badge of your brand tells mobile end-users that they can trust that sender given Google's clearance. Along with the badge, there are some additional features that an RBM agent can send to a mobile end-user in comparison to traditional text messaging.
RCS enables instantaneous interaction through real-time event handling. Agents and users exchange delivery receipts, read receipts, and typing indicators, ensuring prompt acknowledgment and response tracking. User activities automatically trigger events, while agents can actively send updates, keeping users informed about message acknowledgment and response progress. This real-time engagement elevates the responsiveness and overall user experience within RCS conversations.
Within RCS, diverse messaging formats contribute to a rich and adaptable communication landscape. From conventional text messages to multimedia-rich content like images and videos, RCS caters to a variety of communication needs. Suggested replies, suggested actions, and interactive suggestion chip lists further enhance the conversational experience. These versatile messaging formats provide the flexibility needed to craft engaging and natural conversations.
We've separated the specific attributes of Rich Cards and Carousels in distinct sections below, highlighting their unique functionalities and how they add to the overall versatility of RCS messaging.
Rich Cards in RCS provide a straightforward way to convey information, media, or suggestions in a unified format. These cards, which can be presented individually or in a carousel, offer a practical means of sharing content. With the ability to include various elements such as media, text, and interactive options, Rich Cards serve as a functional tool for delivering diverse content without unnecessary complexity.
Carousels in RCS offer a dynamic way to present a sequence of rich cards, enhancing the user experience with visual appeal. Each card within the carousel can be customized to display different content, providing a simple and interactive method for sharing information. Carousels are designed for practicality, offering a user-friendly approach to conveying a series of related messages or content pieces.
Send a RCS message
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
required | Array of objects (Message Contents) non-empty A list of content to be sent |
object (Conversation Content) |
id | string (Message ID) An ID for the message. It can be used for future message consulting or callback notifications. |
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
direction | string (Message direction) Enum: "IN" "OUT" Indicates whether the message is received from a channel (IN) or sent to a channel (OUT) |
channel | string (Message channel) Message channel |
required | Array of objects (Message Contents) non-empty A list of content to be sent |
timestamp | string <date-time> (Message timestamp) Timestamp of the message. Usually received from the provider of the channel. |
object (Conversation Content) |
{- "externalId": "my-campaign-name",
- "from": "rcs-agent-id",
- "to": "55108888888888",
- "contents": [
- {
- "type": "text",
- "text": "Hi Zenvia!"
}
]
}
{- "id": "string",
- "externalId": "string",
- "from": "string",
- "to": "string",
- "direction": "IN",
- "channel": "string",
- "contents": [
- {
- "type": "text",
- "text": "This is a text.",
- "payload": "string"
}
], - "timestamp": "2019-08-24T14:15:22Z",
- "conversation": {
- "solution": "conversion"
}
}
The Telegram can be used after its activation on Zenvia platform.
To activate Telegram you a need a registered Bot account on Telegram Bot API and an account enabled on Zenvia platform.
To be able to send messages to a contact, you first need to setup a webhook, which allows you to receive events in the configured URL. Learn more here.
Supported content types and sizes:
Media | Content Type | Size |
---|---|---|
image | image/* | 5 MB |
video | video/* | 20 MB |
audio | audio/* | 20 MB |
document | Any other valid MIME type. | 20 MB |
When you receive a message from a contact from Telegram channel:
When you send a message to a contact, the sender and recipient are inverted:
The sender goes in the attribute from
and the receiver goes in the attribute to
of message object.
Send a Telegram message
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
required | Array of objects (Message Contents) non-empty A list of content to be sent |
object (Conversation Content) |
id | string (Message ID) An ID for the message. It can be used for future message consulting or callback notifications. |
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
direction | string (Message direction) Enum: "IN" "OUT" Indicates whether the message is received from a channel (IN) or sent to a channel (OUT) |
channel | string (Message channel) Message channel |
required | Array of objects (Message Contents) non-empty A list of content to be sent |
timestamp | string <date-time> (Message timestamp) Timestamp of the message. Usually received from the provider of the channel. |
object (Conversation Content) |
{- "externalId": "my-campaign-name",
- "from": "YourBot",
- "to": "tg-chat-id",
- "contents": [
- {
- "type": "text",
- "text": "Hi Zenvia!"
}
]
}
{- "id": "string",
- "externalId": "string",
- "from": "string",
- "to": "string",
- "direction": "IN",
- "channel": "string",
- "contents": [
- {
- "type": "text",
- "text": "This is a text.",
- "payload": "string"
}
], - "timestamp": "2019-08-24T14:15:22Z",
- "conversation": {
- "solution": "conversion"
}
}
The Google Business Messages channel may be used after its activation on Zenvia platform.
To activate Google Business Messages you need to be registered as a partner with Google Business Messages and get an account information configured on Zenvia platform.
Get in touch with Zenvia consultants to create your account.
To be able to send messages to a contact, you first need to setup a webhook, which allows you to receive events in the configured URL. Learn more here.
When you receive a message from a contact from Google Business Messages channel:
When you send a message to a contact, the sender and recipient are inverted:
The sender goes in the attribute from
and the receiver goes in the attribute to
of message object.
Send a Google Business Messages message
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
required | Array of objects (Message Contents) non-empty A list of content to be sent |
object (Representative Object) Provides information on the representative who sent the message.
| |
object (Conversation Content) |
id | string (Message ID) An ID for the message. It can be used for future message consulting or callback notifications. |
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
direction | string (Message direction) Enum: "IN" "OUT" Indicates whether the message is received from a channel (IN) or sent to a channel (OUT) |
channel | string (Message channel) Message channel |
required | Array of objects (Message Contents) non-empty A list of content to be sent |
timestamp | string <date-time> (Message timestamp) Timestamp of the message. Usually received from the provider of the channel. |
object (Representative Object) Provides information on the representative who sent the message.
| |
object (Conversation Content) |
{- "externalId": "my-campaign-name",
- "from": "gbm-agent-id",
- "to": "gbm-contact-id",
- "contents": [
- {
- "type": "text",
- "text": "Hi Zenvia!"
}
],
}
{- "id": "string",
- "externalId": "string",
- "from": "string",
- "to": "string",
- "direction": "IN",
- "channel": "string",
- "contents": [
- {
- "type": "text",
- "text": "This is a text.",
- "payload": "string"
}
], - "timestamp": "2019-08-24T14:15:22Z",
- "representative": {
- "type": "HUMAN",
- "name": "Agent name",
}, - "conversation": {
- "solution": "conversion"
}
}
To access the Voice channel, you need to create your account here: https://voice-app.zenvia.com/painel/signup.php.
Once the account is created, you can get your voice access token on your voice panel homepage: https://voice-app.zenvia.com/painel/
The voice channel will be available for use after you connect a voice access token on Zenvia platform.
Get in touch with Zenvia consultants to create your account.
Webhooks allow you to receive status in the configured URL. Learn more here.
Supported content types and sizes:
Media | Content Type | Size |
---|---|---|
audio | audio/mp3 audio/wav |
5 MB |
When you send a voice message to a contact using Voice channel:
When you receive a voice message from a contact, the sender and recipient are inverted:
The sender goes in the attribute from
and the receiver goes in the attribute to
of the message object.
Send a Voice message
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
required | Array of objects (Message Contents) non-empty A list of content to be sent |
id | string (Message ID) An ID for the message. It can be used for future message consulting or callback notifications. |
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
direction | string (Message direction) Enum: "IN" "OUT" Indicates whether the message is received from a channel (IN) or sent to a channel (OUT) |
channel | string (Message channel) Message channel |
required | Array of objects (Message Contents) non-empty A list of content to be sent |
timestamp | string <date-time> (Message timestamp) Timestamp of the message. Usually received from the provider of the channel. |
{- "from": "sender-id",
- "to": "55108888888888",
- "contents": [
- {
- "type": "call",
- "audio": [
- {
- "type": "tts",
- "text": "Hi Zenvia!",
- "voiceStyle": "br-Vitoria",
- "awaitRecipientAnswer": true
}
]
}
], - "recordAudio": true,
- "hangUpOnVoiceMail": true
}
{- "id": "string",
- "externalId": "string",
- "from": "string",
- "to": "string",
- "direction": "IN",
- "channel": "string",
- "contents": [
- {
- "type": "call",
- "audio": [
- {
- "type": "string",
- "text": "This is a text",
- "voiceStyle": "br-Ricardo",
- "awaitRecipientAnswer": true
}
], - "transferTo": "5510999999999",
- "recordAudio": true,
- "hangUpOnVoiceMail": true
}
], - "timestamp": "2019-08-24T14:15:22Z"
}
The E-mail channel may be used after its activation on Zenvia platform.
Webhooks allow you to receive events in the configured URL. Learn more here.
You either can use one of the Zenvia domains provided in the e-mail activation console, or you can use your own domain.
However, to use your domain, your will need to change or create DNS entries to make this possible.
The way to do this will be described on the e-mail activation console
Media | Content Type | E-Mail Size* |
---|---|---|
document | Any valid MIME type. | 25 MB |
*The maximum size is for the entire e-mail.
When you send a message to a contact using E-Mail channel:
When you receive a message from a contact, the sender and recipient are inverted:
The sender goes in the attribute from
and the receiver goes in the attribute to
of message object.
Send a E-Mail message
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
required | Array of objects (Message Contents) non-empty A list of content to be sent |
object (Representative Object) Provides information on the representative who sent the message.
| |
object (Conversation Content) |
id | string (Message ID) An ID for the message. It can be used for future message consulting or callback notifications. |
externalId | string (Message External ID) A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API |
from required | string (Sender ID) [ 1 .. 64 ] characters The identifier of the sender of the message. The sender is created when an integration for the channel is connected
on the integrations console.
|
to required | string (Recipient ID) [ 1 .. 64 ] characters The identifier of the recipient (varies according to the channel) of the message.
|
direction | string (Message direction) Enum: "IN" "OUT" Indicates whether the message is received from a channel (IN) or sent to a channel (OUT) |
channel | string (Message channel) Message channel |
required | Array of objects (Message Contents) non-empty A list of content to be sent |
timestamp | string <date-time> (Message timestamp) Timestamp of the message. Usually received from the provider of the channel. |
object (Representative Object) Provides information on the representative who sent the message.
| |
object (Conversation Content) |
{- "from": "sac@brand.domain",
- "to": "user@zenvia.com",
- "contents": [
- {
- "type": "email",
- "subject": "Re: Ticket 12345",
- "html": "<b>Hi!</b><br><img src=\"cid:example2.jpeg\">",
- "attachments": [
], - "cc": [
- {
- "email": "cc1@zenvia.com"
}, - {
- "email": "cc2@zenvia.com",
- "name": "CC2"
}
], - "bcc": [
- {
- "email": "bcc1@zenvia.com"
}, - {
- "email": "bcc2@zenvia.com",
- "name": "BCC2"
}
], - "replyTo": {
- "email": "reply-to@zenvia.com",
- "name": "Service Care"
}
}
], - "representative": {
- "name": "Sender Name"
}
}
{- "id": "string",
- "externalId": "string",
- "from": "string",
- "to": "string",
- "direction": "IN",
- "channel": "string",
- "contents": [
- {
- "type": "email",
- "subject": "Re: Ticket 12345",
- "html": "<b>Hi!</b><br><img src=\"cid:example2.jpeg\">",
- "attachments": [
], - "cc": [
- {
- "email": "cc1@zenvia.com"
}, - {
- "email": "cc2@zenvia.com",
- "name": "CC2"
}
], - "bcc": [
- {
- "email": "bcc1@zenvia.com"
}, - {
- "email": "bcc2@zenvia.com",
- "name": "BCC2"
}
], - "replyTo": {
- "email": "reply-to@zenvia.com",
- "name": "Service Care"
}
}
], - "timestamp": "2019-08-24T14:15:22Z",
- "representative": {
- "name": "Sender Name"
}, - "conversation": {
- "solution": "conversion"
}
}
The batch API makes it possible to send a message with one or more contents to multiple contacts at once. The channels can be used after activation on the Zenvia platform.
The supported channels are SMS, WhatsApp, RCS(Basic) and E-mail.
Content Type | SMS | RCS Basic | ||
---|---|---|---|---|
text | ✔ | ✕ | ✔ | ✕ |
template | ✕ | ✔ | ✔ | ✔ |
To send batch through WhatsApp channel, you must have a template message, which needs an approval before being used.
Only Basic RCS messages can be sent in batches.
Create batch
contacts required | string (Binary CSV File) Binary csv file with recipients and variable values when necessary. |
required | any (Batch Object) This is a Batch object model |
id | string (Batch ID) Batch identifier created automatically |
name required | string (Batch Name) Batch identification name |
channel required | string (Channel) Message channel |
required | object (Column Mapper) The mapping of variables in relation to the columns of the file. This indicates in which column of the file is the value that must be used to fill each variable. The recipient_header_name variable is required so the values on it are used as recipient's contact number. |
required | object (Message Object) This is a Message object model |
curl "https://api.zenvia.com/v2/message-batches" \ -H "X-API-TOKEN: YOUR_API_TOKEN" \ -F 'batch={ "name": "My batch name", "channel": "sms", "columnMapper": { "recipient_header_name": "recipient_number_column", "name": "recipient_name_column", "protocol": "protocol_column" }, "message": { "from": "string", "contents": [{ "type": "text", "text": "Hello {{name}} your service protocol is number {{protocol}}" }] } };type=application/json' \ -F 'contacts=@./contacts.csv;type=text/csv;filename=contacts.csv'
{- "id": "ad48e792-7d6e-464f-a478-df3239475016",
- "name": "My batch name",
- "channel": "sms",
- "columnMapper": {
- "recipient_header_name": "recipient_number_column",
- "name": "recipient_name_column",
- "protocol": "protocol_column"
}, - "message": {
- "from": "string",
- "contents": [
- {
- "type": "text",
- "text": "Hello {{name}} your service protocol is number {{protocol}}"
}
]
}
}
Two-Factor Authentication (2FA) is a security measure that adds an extra layer to account access by requiring two distinct forms of verification. The aim is to prevent unauthorized access even if one form of identification is compromised.
Before sending tokens, you need to configure the token settings. This includes:
Note that you only need to create a new configuration if you want to have different rules for sending tokens. Once created, these configurations are identified by an ID and can be used for multiple token sends.
Our 2FA service ensures that access requests are made by trusted users by identifying the user's request token. The channels used for sending tokens are:
Here's how our 2FA service works:
Create a configuration
required | object (Token properties) Information about the token properties |
object (Verification properties) Verification properties | |
object (Delivery properties) Delivery properties | |
required | object (SMS and E-mail Content) Content with SMS and e-mail information and default locale, it's necessary to create configuration for at least one locale |
object (Website domains) Information needed to use this two factor authentication API service on a website |
Location | string Resource created: https://api.zenvia.com/v2/2fa-configurations/{configurationId} |
id | string (Token Configuration Id) The configuration's unique Id |
object (Token properties) Information about the token properties | |
object (Verification properties) Verification properties | |
object (Delivery properties) Delivery properties | |
object (SMS and E-mail Content) Content with SMS and e-mail information and default locale, it's necessary to create configuration for at least one locale | |
object (Website domains) Information needed to use this two factor authentication API service on a website | |
createdAt | string (Creation Timestamp) Timestamp of the configuration token creation |
updatedAt | string (Update timestamp) Timestamp of the token updates |
{- "token": {
- "size": 6,
- "mode": "NUMBER",
- "case": "UPPER_ONLY"
}, - "verify": {
- "maxAttempts": 3,
- "expireMinutes": 1
}, - "delivery": {
- "maxAttempts": 1,
- "minIntervalSeconds": 60
}, - "content": {
- "default": "pt_br",
- "pt_br": {
- "sms": {
- "from": "559999999999",
- "type": "text",
- "text": "Hello {{name}}! Your code is {{code}}"
}, - "email": {
- "from": "string",
- "type": "email",
- "subject": "Authentication code",
- "html": "Hello {{name}}! Your code is {{code}}"
}
}
}, - "website": {
- "domains": [
- "app.zenvia.com"
]
}
}
{- "id": "11401560-bffb-4ef3-a08e-989a15ed3c32",
- "token": {
- "size": 6,
- "mode": "NUMBER",
- "case": "UPPER_ONLY"
}, - "verify": {
- "maxAttempts": 3,
- "expireMinutes": 1
}, - "delivery": {
- "maxAttempts": 1,
- "minIntervalSeconds": 60
}, - "content": {
- "default": "pt_br",
- "pt_br": {
- "sms": {
- "from": "559999999999",
- "type": "text",
- "text": "Hello {{name}}! Your code is {{code}}"
}, - "email": {
- "from": "string",
- "type": "email",
- "subject": "Authentication code",
- "html": "Hello {{name}}! Your code is {{code}}"
}
}
}, - "website": {
- "domains": [
- "app.zenvia.com"
], - "websiteKey": "XXXXXXXXXXXXXX"
}, - "createdAt": "2022-10-27T13:25:11.354Z",
- "updatedAt": "2022-10-27T13:25:11.354Z"
}
List all configurations
page | number (page) Default: 0 Example: page=5 This is the page number. |
limit | number (size) Example: limit=10 Number of elements on a page. If not filled, the default size is the total number of records |
id | string (Token Configuration Id) The configuration's unique Id |
object (Token properties) Information about the token properties | |
object (Verification properties) Verification properties | |
object (Delivery properties) Delivery properties | |
object (SMS and E-mail Content) Content with SMS and e-mail information and default locale, it's necessary to create configuration for at least one locale | |
object (Website domains) Information needed to use this two factor authentication API service on a website | |
createdAt | string (Creation Timestamp) Timestamp of the configuration token creation |
updatedAt | string (Update timestamp) Timestamp of the token updates |
[- {
- "id": "11401560-bffb-4ef3-a08e-989a15ed3c32",
- "token": {
- "size": 6,
- "mode": "NUMBER",
- "case": "UPPER_ONLY"
}, - "verify": {
- "maxAttempts": 3,
- "expireMinutes": 1
}, - "delivery": {
- "maxAttempts": 1,
- "minIntervalSeconds": 60
}, - "content": {
- "default": "pt_br",
- "pt_br": {
- "sms": {
- "from": "559999999999",
- "type": "text",
- "text": "Hello {{name}}! Your code is {{code}}"
}, - "email": {
- "from": "string",
- "type": "email",
- "subject": "Authentication code",
- "html": "Hello {{name}}! Your code is {{code}}"
}
}
}, - "website": {
- "domains": [
- "app.zenvia.com"
], - "websiteKey": "XXXXXXXXXXXXXX"
}, - "createdAt": "2022-10-27T13:25:11.354Z",
- "updatedAt": "2022-10-27T13:25:11.354Z"
}
]
List a configuration by id
configurationId required | string The configuration identifier |
required | object (Token properties) Information about the token properties |
object (Verification properties) Verification properties | |
object (Delivery properties) Delivery properties | |
required | object (SMS and E-mail Content) Content with SMS and e-mail information and default locale, it's necessary to create configuration for at least one locale |
object (Website domains) Information needed to use this two factor authentication API service on a website |
{- "token": {
- "size": 6,
- "mode": "NUMBER",
- "case": "UPPER_ONLY"
}, - "verify": {
- "maxAttempts": 3,
- "expireMinutes": 1
}, - "delivery": {
- "maxAttempts": 1,
- "minIntervalSeconds": 60
}, - "content": {
- "default": "pt_br",
- "pt_br": {
- "sms": {
- "from": "559999999999",
- "type": "text",
- "text": "Hello {{name}}! Your code is {{code}}"
}, - "email": {
- "from": "string",
- "type": "email",
- "subject": "Authentication code",
- "html": "Hello {{name}}! Your code is {{code}}"
}
}
}, - "website": {
- "domains": [
- "app.zenvia.com"
], - "websiteKey": "XXXXXXXXXXXXXX"
}
}
Delete a configuration by configuration id
configurationId required | string The configuration identifier |
{- "code": "VALIDATION_ERROR",
- "message": "Validation error",
- "details": [
- {
- "code": "string",
- "path": "string",
- "message": "string"
}
]
}
Patch configuration
configurationId required | string The configuration identifier |
op required | string Enum: "replace" "add" "remove" Token configuration update operation type |
path required | string The path inside the token configuration object |
value required | object The value to replace, add, or remove |
id | string (Token Configuration Id) The configuration's unique Id |
object (Token properties) Information about the token properties | |
object (Verification properties) Verification properties | |
object (Delivery properties) Delivery properties | |
object (SMS and E-mail Content) Content with SMS and e-mail information and default locale, it's necessary to create configuration for at least one locale | |
object (Website domains) Information needed to use this two factor authentication API service on a website | |
createdAt | string (Creation Timestamp) Timestamp of the configuration token creation |
updatedAt | string (Update timestamp) Timestamp of the token updates |
{- "op": "replace",
- "path": "/token",
- "value": {
- "size": 6,
- "mode": "NUMBER",
- "case": "UPPER_ONLY"
}
}
{- "id": "11401560-bffb-4ef3-a08e-989a15ed3c32",
- "token": {
- "size": 6,
- "mode": "NUMBER",
- "case": "UPPER_ONLY"
}, - "verify": {
- "maxAttempts": 3,
- "expireMinutes": 1
}, - "delivery": {
- "maxAttempts": 1,
- "minIntervalSeconds": 60
}, - "content": {
- "default": "pt_br",
- "pt_br": {
- "sms": {
- "from": "559999999999",
- "type": "text",
- "text": "Hello {{name}}! Your code is {{code}}"
}, - "email": {
- "from": "string",
- "type": "email",
- "subject": "Authentication code",
- "html": "Hello {{name}}! Your code is {{code}}"
}
}
}, - "website": {
- "domains": [
- "app.zenvia.com"
], - "websiteKey": "XXXXXXXXXXXXXX"
}, - "createdAt": "2022-10-27T13:25:11.354Z",
- "updatedAt": "2022-10-27T13:25:11.354Z"
}
Recreate websitekey
configurationId required | string The configuration identifier |
websiteKey | string The platform generates a key that the client's frontend must use to identify itself |
{- "websiteKey": "XXXXXXXXXXXXXX"
}
Send token
configurationId required | string Unique configuration Id |
to required | string Contact number or e-mail to send the token |
channel required | string Enum: "sms" "email" Channel to be used to send the token |
locale | string Choose one configured locale, if left blank the default locale will be used |
required | object |
id | string Token Id |
from | string Contact of origin |
to | string Recipient contact |
channel | string Enum: "sms" "email" Channel used |
locale | string Configured locale |
configurationId | string Token Configuration Id |
object Fields with key words of the text that will be sent to the user | |
status | string Enum: "PENDING" "CANCELED" "VERIFIED" Status of the generated token |
remoteip | string Ip of the user making the request to be authenticated |
object (Verification properties) Verification properties | |
object (Delivery properties) Delivery properties | |
expiresAt | string (Expiration timestamp) Timestamp of the expiration date |
createdAt | string (Creation timestamp) Timestamp of token creation. |
updatedAt | string (Update timestamp) Timestamp of updates |
{- "configurationId": "0f25c816-478d-4729-a600-b6b0124b4b9e",
- "to": "5511999999999",
- "channel": "sms",
- "locale": "pt_br",
- "fields": {
- "name": "Josh Doe"
}
}
{- "id": "7388c68e-675e-435b-b2ec-f72677798678",
- "from": "email@email.com",
- "to": "received_email@email.com",
- "channel": "email",
- "locale": "pt_br",
- "configurationId": "88ff8743-22ba-44db-850b-5f54d6442cdd",
- "fields": {
- "name": "Josh Doe"
}, - "status": "PENDING",
- "remoteip": "127.0.0.1:80",
- "verify": {
- "maxAttempts": 3,
- "expireMinutes": 1
}, - "delivery": {
- "maxAttempts": 1,
- "minIntervalSeconds": 60
}, - "expiresAt": "2022-10-27T13:26:11.354Z",
- "createdAt": "2022-10-27T13:25:11.354Z",
- "updatedAt": "2022-10-27T13:25:11.354Z"
}
Resend token
to required | string User recipient |
channel required | string Channel used to send the token |
{- "to": "email@email.com",
- "channel": "email"
}
{- "code": "VALIDATION_ERROR",
- "message": "Validation error",
- "details": [
- {
- "code": "string",
- "path": "string",
- "message": "string"
}
]
}
Verify token
to required | string User recipient |
channel required | string Channel used |
code required | string Code sent by the user |
id | string Token Id |
from | string Contact of origin |
to | string Recipient contact |
channel | string Enum: "sms" "email" Channel used |
locale | string Location configured |
configurationId | string Token Configuration Id |
object Fields with key words of the text that will be sent to the user | |
status | string Enum: "PENDING" "CANCELED" "VERIFIED" Status of the generated token |
remoteip | string Ip of the user making the request to be authenticated |
object (Verification properties) Verification properties | |
object (Delivery properties) Delivery properties | |
expiresAt | string (Expiration timestamp) Timestamp of the expiration date |
createdAt | string (Creation timestamp) Timestamp of token creation. |
updatedAt | string (Update timestamp) Timestamp of updates |
{- "to": "email@email.com",
- "channel": "email",
- "code": "269878"
}
{- "id": "7388c68e-675e-435b-b2ec-f72677798678",
- "from": "email@email.com",
- "to": "received_email@email.com",
- "channel": "email",
- "locale": "pt_br",
- "configurationId": "88ff8743-22ba-44db-850b-5f54d6442cdd",
- "fields": {
- "name": "Josh Doe"
}, - "status": "VERIFIED",
- "remoteip": "127.0.0.1:80",
- "verify": {
- "maxAttempts": 3,
- "expireMinutes": 1
}, - "delivery": {
- "maxAttempts": 1,
- "minIntervalSeconds": 60
}, - "expiresAt": "2022-10-27T13:26:11.354Z",
- "createdAt": "2022-10-27T13:25:11.354Z",
- "updatedAt": "2022-10-27T13:25:11.354Z"
}
Resend the token by token id
tokenId required | string The token identifier |
{- "code": "VALIDATION_ERROR",
- "message": "Validation error",
- "details": [
- {
- "code": "string",
- "path": "string",
- "message": "string"
}
]
}
Verify a token by token id
tokenId required | string The token identifier |
code | string Code sent by the user |
id | string Token Id |
from | string Contact of origin |
to | string Recipient contact |
channel | string Enum: "sms" "email" Channel used |
locale | string Location configured |
configurationId | string Token Configuration Id |
object Fields with key words of the text that will be sent to the user | |
status | string Enum: "PENDING" "CANCELED" "VERIFIED" Status of the generated token |
remoteip | string Ip of the user making the request to be authenticated |
object (Verification properties) Verification properties | |
object (Delivery properties) Delivery properties | |
expiresAt | string (Expiration timestamp) Timestamp of the expiration date |
createdAt | string (Creation timestamp) Timestamp of token creation. |
updatedAt | string (Update timestamp) Timestamp of updates |
{- "code": "269878"
}
{- "id": "7388c68e-675e-435b-b2ec-f72677798678",
- "from": "email@email.com",
- "to": "received_email@email.com",
- "channel": "email",
- "locale": "pt_br",
- "configurationId": "88ff8743-22ba-44db-850b-5f54d6442cdd",
- "fields": {
- "name": "Josh Doe"
}, - "status": "VERIFIED",
- "remoteip": "127.0.0.1:80",
- "verify": {
- "maxAttempts": 3,
- "expireMinutes": 1
}, - "delivery": {
- "maxAttempts": 1,
- "minIntervalSeconds": 60
}, - "expiresAt": "2022-10-27T13:26:11.354Z",
- "createdAt": "2022-10-27T13:25:11.354Z",
- "updatedAt": "2022-10-27T13:25:11.354Z"
}
Webhooks allow you to receive events in the configured URL. The available type of events are MESSAGE and MESSAGE_STATUS.
The event type MESSAGE refers to messages dispatched and/or received in the desired channel.
When you are subscribed to this type of event, your webhook will receive a request with the schema as follows:
id | string (Event Id) ID of the webhook event. Can be used to identify retried deliveries in case of webhook errors. |
timestamp | string <date-time> (Event Timestamp) Timestamp of the webhook event |
type | string (Event type) Enum: "MESSAGE" "MESSAGE_STATUS" "MESSAGE" "MESSAGE_STATUS" |
subscriptionId | string (Webhook ID) ID of the webhook that caused this event to be delivered |
channel | string (Message Channel) |
direction | string (Message Direction) Enum: "IN" "OUT" Indicates whether the message is received from a channel (IN) or sent to a channel (OUT)
|
object (Message) This is a Message object model |
{- "id": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "type": "MESSAGE",
- "subscriptionId": "string",
- "channel": "string",
- "direction": "IN",
- "message": {
- "id": "string",
- "from": "string",
- "to": "string",
- "direction": "IN",
- "channel": "string",
- "contents": [
- {
- "type": "text",
- "text": "This is a text.",
- "payload": "string"
}
], - "timestamp": "2019-08-24T14:15:22Z",
- "visitor": {
- "name": "string",
- "firstName": "string",
- "lastName": "string",
- "userName": "string",
- "picture": "string"
}, - "referral": {
- "headline": "This is a headline",
- "body": "This is a body",
- "source": {
- "id": "string",
- "type": "ad",
- "text": "string",
- "user": "string",
- "timestamp": "string"
}, - "ctwaId": "12345"
}, - "idRef": "string"
}
}
The event type MESSAGE_STATUS refers to a status update related to a previously sent message.
If you are subscribed to this type of event, your webhook will receive a request with the schema as follows:
id | string (Event Id) ID of the webhook event. Can be used to identify retried deliveries in case of webhook errors. |
timestamp | string <date-time> (Event Timestamp) Timestamp of the webhook event |
type | string (Event type) Enum: "MESSAGE" "MESSAGE_STATUS" "MESSAGE" "MESSAGE_STATUS" |
subscriptionId | string (Webhook ID) ID of the webhook that caused this event to be delivered |
channel | string (Message Channel) |
messageId | string (Message ID) Deprecated ID of the message whose status is being delivered |
contentIndex | number (Content Index) Deprecated Index of content that is receiving the status update |
object | |
object (Message Status) |
{- "id": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "type": "MESSAGE_STATUS",
- "subscriptionId": "string",
- "channel": "string",
- "messageId": "string",
- "contentIndex": 0,
- "message": {
- "id": "string",
- "externalId": "string",
- "contentIndex": 0,
- "from": "email@email.com",
- "to": "received_email@email.com"
}, - "messageStatus": {
- "timestamp": "2019-08-24T14:15:22Z",
- "code": "REJECTED",
- "description": "string",
- "causes": [
- {
- "channelErrorCode": "string",
- "reason": "string",
- "details": "string"
}
], - "context": {
- "button": {
- "type": "text",
- "payload": "string"
}
}, - "channelData": {
- "sms": {
- "carrier": "VIVO_BR"
}, - "rcs": {
- "realChannel": "sms"
}, - "email": {
- "clientInfo": {
- "machineOpen": true,
- "userAgent": "Mozilla/5.0",
- "sourceIp": "255.255.255.255",
}
}
}
}
}
The code
field may assume the following values:
causes
field.causes
field. Support varies according to the channel.The description
field is directly tied to the code
field, and it may assume the following values:
Webhook notifications sent from Zenvia come from any of the following ranges of IP addresses:
Currently it is possible to create up to two subscriptions with the same criteria (Event Type and Channel).
As described before, webhooks allow you to receive events in your application.
However, if a webhook request fails, a retry procedure begins. This procedure abides by the following rules
This means that a single event may be retried for around 15 minutes. Following this, the event will no longer be available.
Event retries are handled separately from the initial request. This ensures that webhooks without request fails are not penalized by webhooks with many requests fails.
Multiple errors on a single webhook may change its (quality) status. The possible webhook statuses are:
The criteria which trigger status changes consist of the following:
Both the success and fail counters automatically reset themselves 8 hours after the first increment.
The following table shows the content types supported by each channel for the IN direction.
For the OUT direction, check the messaging content type table.
Content Type | SMS | RCS | Voice | Telegram | GBM* | ||||
---|---|---|---|---|---|---|---|---|---|
text | ✔ | ✔ | ✔ | ✔ | ✕ | ✔ | ✔ | ✔ | ✕ |
file | ✕ | ✔ | ✔ | ✔ | ✕ | ✔ | ✔ | ✔ | ✕ |
contacts | ✕ | ✕ | ✔ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
location | ✕ | ✕ | ✔ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✔ | |
product_list_order | ✕ | ✕ | ✔ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
optin_response | ✕ | ✔ | ✕ | ✕ | ✕ | ✕ | ✕ | ✔ | ✕ |
*GBM stands for Google Business Messages
Create a new webhook
eventType required | string (Event type to subscribe) |
required | object |
status | string (Status of subscription) Enum: "ACTIVE" "INACTIVE" |
version | string (Version of subscription) Default: "v2" Enum: "v1" "v2" |
required | object |
id | string (Subscription Id) |
eventType required | string (Event type to subscribe) |
required | object |
status | string (Status of subscription) Enum: "ACTIVE" "INACTIVE" |
version | string (Version of subscription) Default: "v2" Enum: "v1" "v2" |
createdAt | string (Creation timestamp) Creation timestamp in ISO format |
updatedAt | string (Update timestamp) Update timestamp in ISO format |
required | object |
{- "eventType": "MESSAGE",
- "webhook": {
- "url": "string",
- "headers": { }
}, - "status": "ACTIVE",
- "version": "v1",
- "criteria": {
- "channel": "string",
- "direction": "IN"
}
}
{- "id": "string",
- "eventType": "MESSAGE",
- "webhook": {
- "url": "string",
- "headers": { }
}, - "status": "ACTIVE",
- "version": "v1",
- "createdAt": "string",
- "updatedAt": "string",
- "criteria": {
- "channel": "string",
- "direction": "IN"
}
}
{- "id": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "type": "MESSAGE",
- "subscriptionId": "string",
- "channel": "string",
- "direction": "IN",
- "message": {
- "id": "string",
- "from": "string",
- "to": "string",
- "direction": "IN",
- "channel": "string",
- "contents": [
- {
- "type": "text",
- "text": "This is a text.",
- "payload": "string"
}
], - "timestamp": "2019-08-24T14:15:22Z",
- "visitor": {
- "name": "string",
- "firstName": "string",
- "lastName": "string",
- "userName": "string",
- "picture": "string"
}, - "referral": {
- "headline": "This is a headline",
- "body": "This is a body",
- "source": {
- "id": "string",
- "type": "ad",
- "text": "string",
- "user": "string",
- "timestamp": "string"
}, - "ctwaId": "12345"
}, - "idRef": "string"
}
}
List all webhooks
id | string (Subscription Id) |
eventType required | string (Event type to subscribe) |
required | object |
status | string (Status of subscription) Enum: "ACTIVE" "DEGRADED" "INACTIVE" |
version | string (Version of subscription) Default: "v2" Enum: "v1" "v2" |
createdAt | string (Creation timestamp) Creation timestamp in ISO format |
updatedAt | string (Update timestamp) Update timestamp in ISO format |
required | object |
[- {
- "id": "string",
- "eventType": "MESSAGE",
- "webhook": {
- "url": "string",
- "headers": { }
}, - "status": "ACTIVE",
- "version": "v1",
- "createdAt": "string",
- "updatedAt": "string",
- "criteria": {
- "channel": "string",
- "direction": "IN"
}
}
]
Retrieve one webhook by id
subscriptionId required | string The subscription identifier |
id | string (Subscription Id) |
eventType required | string (Event type to subscribe) |
required | object |
status | string (Status of subscription) Enum: "ACTIVE" "DEGRADED" "INACTIVE" |
version | string (Version of subscription) Default: "v2" Enum: "v1" "v2" |
createdAt | string (Creation timestamp) Creation timestamp in ISO format |
updatedAt | string (Update timestamp) Update timestamp in ISO format |
required | object |
{- "id": "string",
- "eventType": "MESSAGE",
- "webhook": {
- "url": "string",
- "headers": { }
}, - "status": "ACTIVE",
- "version": "v1",
- "createdAt": "string",
- "updatedAt": "string",
- "criteria": {
- "channel": "string",
- "direction": "IN"
}
}
Delete one webhook by id
subscriptionId required | string The subscription identifier |
{- "code": "VALIDATION_ERROR",
- "message": "Validation error",
- "details": [
- {
- "code": "string",
- "path": "string",
- "message": "string"
}
]
}
Update one webhook by id
subscriptionId required | string The subscription identifier |
object (subscription.webhook) | |
status | string (Status of subscription) Enum: "ACTIVE" "INACTIVE" |
id | string (Subscription Id) |
eventType required | string (Event type to subscribe) |
required | object |
status | string (Status of subscription) Enum: "ACTIVE" "DEGRADED" "INACTIVE" |
version | string (Version of subscription) Default: "v2" Enum: "v1" "v2" |
createdAt | string (Creation timestamp) Creation timestamp in ISO format |
updatedAt | string (Update timestamp) Update timestamp in ISO format |
required | object |
{- "webhook": {
- "url": "string",
- "headers": { }
}, - "status": "ACTIVE"
}
{- "id": "string",
- "eventType": "MESSAGE",
- "webhook": {
- "url": "string",
- "headers": { }
}, - "status": "ACTIVE",
- "version": "v1",
- "createdAt": "string",
- "updatedAt": "string",
- "criteria": {
- "channel": "string",
- "direction": "IN"
}
}
Message Templates are message formats used for common reusable messages a business may want to send. Businesses must use Message Templates for sending notifications to customers.
This allows a business to send just the template identifier along with the appropriate parameters instead of the whole message content.
Templates have the following components:
The components object allows you to indicate the type of message and the message's parameters.
The standard message templates allows you to send plain text-only messages using a body
components object.
Media message templates expand the outgoing content beyond the standard message template type to include media, headers, and footers using a header
and footer
components object.
Interactive message templates expand the outgoing content beyond the standard message template and media messages template types to include interactive buttons using the button
components object.
There are three types of predefined buttons offered: actions, quick replies and mixed.
Allows your customer to visit a website, call a phone number or send a product catalog.
Allows your customer to return a simple text message.
When a quick reply message is sent, and the customer clicks one of the options, your webhook will receive a MESSAGE_EVENT
, provided you've subscribed to that kind of event. The MESSAGE_EVENT
itself will contain one content of type text
with the text
and payload
fields defined in the creation of interactive templates.
You can learn more about it on the subscriptions section.
Quick reply buttons also have the OPT_OUT
type, a exclusive button for marketing template. Button that Meta recommends using in marketing templates to increase its approval chances. With it, the final contact has the option to request not to receive messages of this type from the company.
Allows that in RCS messages you can mix buttons like ACTIONS and QUICK REPLIES.
E-mail templates allows sending content up to 30MB to multiple contacts using a small payload.
Email templates have the following components:
Create a new template
required | object (Components) Message content of this template |
category required | string (Category) Enum: "AUTHENTICATION" "MARKETING" "UTILITY" Category of use for this template |
channel required | string (Channel) Channel where the template will be made available. |
name required | string (Template name) The name of the template |
locale required | string (Locale) Enum: "af" "sq" "ar" "az" "bn" "bg" "ca" "zh_CN" "zh_HK" "zh_TW" "hr" "cs" "da" "nl" "en" "en_GB" "en_US" "et" "fil" "fi" "fr" "de" "el" "gu" "ha" "he" "hi" "hu" "id" "ga" "it" "ja" "kn" "kk" "ko" "lo" "lv" "lt" "mk" "ms" "ml" "mr" "nb" "fa" "pl" "pt_BR" "pt_PT" "pa" "ro" "ru" "sr" "sk" "sl" "es" "es_AR" "es_ES" "es_MX" "sw" "sv" "ta" "te" "th" "tr" "uk" "ur" "uz" "vi" "zu" Template language and locale |
examples | object (Examples) Provides an example of possible model data. This helps during the review and approval process so that the provider (e.g. Meta) can understand what
kind of messages you plan to send. Ensure these are examples and do not include personal or confidential information.
In case you decide to include variables and examples, provide them with the same number.
|
senderId required | string (Sender ID) The identifier of the sender of the template. The sender should be created with a credential. |
object (Metadata) Additional values related to the template but not used for messaging. | |
notificationEmail | string (Notification e-mail) E-mail list (comma-separated) to send notifications about the message template approving process |
required | object (Components) Message content of this template |
category required | string (Category) Enum: "AUTHENTICATION" "MARKETING" "UTILITY" Category of use for this template |
qualityScore | string (Quality Score) Enum: "UNKNOWN" "GREEN" "YELLOW" "RED" Quality score of the template while active, specific for WhatsApp templates, this field is based on the end client feedback and there are four possible scores: Pending (not enough feedback to classify the template quality, this template can be sent to clients), High (few or no negative feedback, this template can be sent to clients), Medium (has received negative feedback from several clients, this template can be sent to clients, but there is a risk of it being paused or disabled soon unless the problems reported by the clients are resolved) and Low (has received negative feedback from several clients, templates of this status can still be sent to clients, but there is a risk of it being suspended or disabled soon, so it is recommended that the problems reported by the clients are resolved as soon as possible). |
channel required | string (Channel) Channel where the template will be made available. |
id | string (Template ID) |
name required | string (Template name) The name of the template |
locale required | string (Locale) Enum: "af" "sq" "ar" "az" "bn" "bg" "ca" "zh_CN" "zh_HK" "zh_TW" "hr" "cs" "da" "nl" "en" "en_GB" "en_US" "et" "fil" "fi" "fr" "de" "el" "gu" "ha" "he" "hi" "hu" "id" "ga" "it" "ja" "kn" "kk" "ko" "lo" "lv" "lt" "mk" "ms" "ml" "mr" "nb" "fa" "pl" "pt_BR" "pt_PT" "pa" "ro" "ru" "sr" "sk" "sl" "es" "es_AR" "es_ES" "es_MX" "sw" "sv" "ta" "te" "th" "tr" "uk" "ur" "uz" "vi" "zu" Template language and locale |
examples | object (Examples) Provides an example of possible model data. This helps during the review and approval process so that the provider (e.g. Meta) can understand what
kind of messages you plan to send. Ensure these are examples and do not include personal or confidential information.
In case you decide to include variables and examples, provide them with the same number.
|
senderId required | string (Sender ID) The identifier of the sender of the template. The sender should be created with a credential. |
object (Metadata) Additional values related to the template but not used for messaging. | |
notificationEmail | string (Notification e-mail) E-mail list (comma-separated) to send notifications about the message template approving process |
text | string (Template text) A text reference for the template. This field encompasses all content components. |
fields | Array of strings (Fields) >= 0 items The available fields to be used in this template |
Array of objects (Comments) Comments added to the template during the approval process | |
status | string (Status of template) Enum: "WAITING_REVIEW" "REJECTED" "WAITING_APPROVAL" "APPROVED" "PAUSED" "DISABLED" |
createdAt | string (Creation timestamp) Creation timestamp in ISO format |
updatedAt | string (Update timestamp) Update timestamp in ISO format |
{- "components": {
- "header": {
- "type": "MEDIA_DOCUMENT",
- "text": "string"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "footer": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}, - "otp": {
- "type": "ONE_TAP",
- "copyButtonText": "Copy the code",
- "addSecurityRecommendation": true,
- "codeExpirationMinutes": 5,
- "autofillText": "autofill",
- "packageName": "com.example.myapplication",
- "signatureHash": "K8a%2FAINcGX7"
}, - "carousel": {
- "cards": [
- {
- "header": {
- "type": "MEDIA_IMAGE"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}
}, - {
- "header": {
- "type": "MEDIA_IMAGE"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}
}
]
}
}, - "category": "AUTHENTICATION",
- "channel": "WHATSAPP",
- "name": "string",
- "locale": "af",
- "senderId": "string",
- "metadata": {
- "property1": "Zenvia",
- "property2": "Zenvia"
}, - "notificationEmail": "string"
}
{- "components": {
- "header": {
- "type": "MEDIA_DOCUMENT",
- "text": "string"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "footer": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}, - "otp": {
- "type": "ONE_TAP",
- "copyButtonText": "Copy the code",
- "addSecurityRecommendation": true,
- "codeExpirationMinutes": 5,
- "autofillText": "autofill",
- "packageName": "com.example.myapplication",
- "signatureHash": "K8a%2FAINcGX7"
}, - "carousel": {
- "cards": [
- {
- "header": {
- "type": "MEDIA_IMAGE"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}
}, - {
- "header": {
- "type": "MEDIA_IMAGE"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}
}
]
}
}, - "category": "AUTHENTICATION",
- "qualityScore": "UNKNOWN",
- "channel": "WHATSAPP",
- "id": "string",
- "name": "string",
- "locale": "af",
- "senderId": "string",
- "metadata": {
- "property1": "Zenvia",
- "property2": "Zenvia"
}, - "notificationEmail": "string",
- "text": "string",
- "fields": [
- "string"
], - "comments": [
- {
- "id": "string",
- "author": "string",
- "role": "REQUESTER",
- "text": "string",
- "createdAt": "string",
- "updatedAt": "string"
}
], - "status": "WAITING_REVIEW",
- "createdAt": "string",
- "updatedAt": "string"
}
List all templates
channel | string Enum: "WHATSAPP" "SMS" "RCS" "EMAIL" "FACEBOOK" Example: channel=WHATSAPP Filter by channel |
senderId | string Example: senderId=b5agf1-y237-11e8-b127-1230f6c2d98m Filter by senderId |
status | string Enum: "WAITING_REVIEW" "REJECTED" "WAITING_APPROVAL" "APPROVED" "PAUSED" "DISABLED" Example: status=APPROVED Filter by status |
page | number (page) Default: 1 Example: page=5 This is the page number. |
size | number (size) Default: 500 Example: size=10 This is the page size. |
x-total | string Example: "100" The total number of results available. |
x-page-size | string Example: "10" The number of results per page. |
x-page | string Example: "5" The current page. |
required | object (Components) Message content of this template |
category required | string (Category) Enum: "AUTHENTICATION" "MARKETING" "UTILITY" Category of use for this template |
qualityScore | string (Quality Score) Enum: "UNKNOWN" "GREEN" "YELLOW" "RED" Quality score of the template while active, specific for WhatsApp templates, this field is based on the end client feedback and there are four possible scores: Pending (not enough feedback to classify the template quality, this template can be sent to clients), High (few or no negative feedback, this template can be sent to clients), Medium (has received negative feedback from several clients, this template can be sent to clients, but there is a risk of it being paused or disabled soon unless the problems reported by the clients are resolved) and Low (has received negative feedback from several clients, templates of this status can still be sent to clients, but there is a risk of it being suspended or disabled soon, so it is recommended that the problems reported by the clients are resolved as soon as possible). |
channel required | string (Channel) Channel where the template will be made available. |
id | string (Template ID) |
name required | string (Template name) The name of the template |
locale required | string (Locale) Enum: "af" "sq" "ar" "az" "bn" "bg" "ca" "zh_CN" "zh_HK" "zh_TW" "hr" "cs" "da" "nl" "en" "en_GB" "en_US" "et" "fil" "fi" "fr" "de" "el" "gu" "ha" "he" "hi" "hu" "id" "ga" "it" "ja" "kn" "kk" "ko" "lo" "lv" "lt" "mk" "ms" "ml" "mr" "nb" "fa" "pl" "pt_BR" "pt_PT" "pa" "ro" "ru" "sr" "sk" "sl" "es" "es_AR" "es_ES" "es_MX" "sw" "sv" "ta" "te" "th" "tr" "uk" "ur" "uz" "vi" "zu" Template language and locale |
examples | object (Examples) Provides an example of possible model data. This helps during the review and approval process so that the provider (e.g. Meta) can understand what
kind of messages you plan to send. Ensure these are examples and do not include personal or confidential information.
In case you decide to include variables and examples, provide them with the same number.
|
senderId required | string (Sender ID) The identifier of the sender of the template. The sender should be created with a credential. |
object (Metadata) Additional values related to the template but not used for messaging. | |
notificationEmail | string (Notification e-mail) E-mail list (comma-separated) to send notifications about the message template approving process |
text | string (Template text) A text reference for the template. This field encompasses all content components. |
fields | Array of strings (Fields) >= 0 items The available fields to be used in this template |
Array of objects (Comments) Comments added to the template during the approval process | |
status | string (Status of template) Enum: "WAITING_REVIEW" "REJECTED" "WAITING_APPROVAL" "APPROVED" "PAUSED" "DISABLED" |
createdAt | string (Creation timestamp) Creation timestamp in ISO format |
updatedAt | string (Update timestamp) Update timestamp in ISO format |
[- {
- "components": {
- "header": {
- "type": "MEDIA_DOCUMENT",
- "text": "string"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "footer": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}, - "otp": {
- "type": "ONE_TAP",
- "copyButtonText": "Copy the code",
- "addSecurityRecommendation": true,
- "codeExpirationMinutes": 5,
- "autofillText": "autofill",
- "packageName": "com.example.myapplication",
- "signatureHash": "K8a%2FAINcGX7"
}, - "carousel": {
- "cards": [
- {
- "header": {
- "type": "MEDIA_IMAGE"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}
}, - {
- "header": {
- "type": "MEDIA_IMAGE"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}
}
]
}
}, - "category": "AUTHENTICATION",
- "qualityScore": "UNKNOWN",
- "channel": "WHATSAPP",
- "id": "string",
- "name": "string",
- "locale": "af",
- "senderId": "string",
- "metadata": {
- "property1": "Zenvia",
- "property2": "Zenvia"
}, - "notificationEmail": "string",
- "text": "string",
- "fields": [
- "string"
], - "comments": [
- {
- "id": "string",
- "author": "string",
- "role": "REQUESTER",
- "text": "string",
- "createdAt": "string",
- "updatedAt": "string"
}
], - "status": "WAITING_REVIEW",
- "createdAt": "string",
- "updatedAt": "string"
}
]
Retrieve one template by id
templateId required | string |
required | object (Components) Message content of this template |
category required | string (Category) Enum: "AUTHENTICATION" "MARKETING" "UTILITY" Category of use for this template |
qualityScore | string (Quality Score) Enum: "UNKNOWN" "GREEN" "YELLOW" "RED" Quality score of the template while active, specific for WhatsApp templates, this field is based on the end client feedback and there are four possible scores: Pending (not enough feedback to classify the template quality, this template can be sent to clients), High (few or no negative feedback, this template can be sent to clients), Medium (has received negative feedback from several clients, this template can be sent to clients, but there is a risk of it being paused or disabled soon unless the problems reported by the clients are resolved) and Low (has received negative feedback from several clients, templates of this status can still be sent to clients, but there is a risk of it being suspended or disabled soon, so it is recommended that the problems reported by the clients are resolved as soon as possible). |
channel required | string (Channel) Channel where the template will be made available. |
id | string (Template ID) |
name required | string (Template name) The name of the template |
locale required | string (Locale) Enum: "af" "sq" "ar" "az" "bn" "bg" "ca" "zh_CN" "zh_HK" "zh_TW" "hr" "cs" "da" "nl" "en" "en_GB" "en_US" "et" "fil" "fi" "fr" "de" "el" "gu" "ha" "he" "hi" "hu" "id" "ga" "it" "ja" "kn" "kk" "ko" "lo" "lv" "lt" "mk" "ms" "ml" "mr" "nb" "fa" "pl" "pt_BR" "pt_PT" "pa" "ro" "ru" "sr" "sk" "sl" "es" "es_AR" "es_ES" "es_MX" "sw" "sv" "ta" "te" "th" "tr" "uk" "ur" "uz" "vi" "zu" Template language and locale |
examples | object (Examples) Provides an example of possible model data. This helps during the review and approval process so that the provider (e.g. Meta) can understand what
kind of messages you plan to send. Ensure these are examples and do not include personal or confidential information.
In case you decide to include variables and examples, provide them with the same number.
|
senderId required | string (Sender ID) The identifier of the sender of the template. The sender should be created with a credential. |
object (Metadata) Additional values related to the template but not used for messaging. | |
notificationEmail | string (Notification e-mail) E-mail list (comma-separated) to send notifications about the message template approving process |
text | string (Template text) A text reference for the template. This field encompasses all content components. |
fields | Array of strings (Fields) >= 0 items The available fields to be used in this template |
Array of objects (Comments) Comments added to the template during the approval process | |
status | string (Status of template) Enum: "WAITING_REVIEW" "REJECTED" "WAITING_APPROVAL" "APPROVED" "PAUSED" "DISABLED" |
createdAt | string (Creation timestamp) Creation timestamp in ISO format |
updatedAt | string (Update timestamp) Update timestamp in ISO format |
{- "components": {
- "header": {
- "type": "MEDIA_DOCUMENT",
- "text": "string"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "footer": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}, - "otp": {
- "type": "ONE_TAP",
- "copyButtonText": "Copy the code",
- "addSecurityRecommendation": true,
- "codeExpirationMinutes": 5,
- "autofillText": "autofill",
- "packageName": "com.example.myapplication",
- "signatureHash": "K8a%2FAINcGX7"
}, - "carousel": {
- "cards": [
- {
- "header": {
- "type": "MEDIA_IMAGE"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}
}, - {
- "header": {
- "type": "MEDIA_IMAGE"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}
}
]
}
}, - "category": "AUTHENTICATION",
- "qualityScore": "UNKNOWN",
- "channel": "WHATSAPP",
- "id": "string",
- "name": "string",
- "locale": "af",
- "senderId": "string",
- "metadata": {
- "property1": "Zenvia",
- "property2": "Zenvia"
}, - "notificationEmail": "string",
- "text": "string",
- "fields": [
- "string"
], - "comments": [
- {
- "id": "string",
- "author": "string",
- "role": "REQUESTER",
- "text": "string",
- "createdAt": "string",
- "updatedAt": "string"
}
], - "status": "WAITING_REVIEW",
- "createdAt": "string",
- "updatedAt": "string"
}
Delete one template by id
templateId required | string |
{- "code": "VALIDATION_ERROR",
- "message": "Validation error",
- "details": [
- {
- "code": "string",
- "path": "string",
- "message": "string"
}
]
}
Update one template by id
templateId required | string |
locale | string (Locale) Enum: "af" "sq" "ar" "az" "bn" "bg" "ca" "zh_CN" "zh_HK" "zh_TW" "hr" "cs" "da" "nl" "en" "en_GB" "en_US" "et" "fil" "fi" "fr" "de" "el" "gu" "ha" "he" "hi" "hu" "id" "ga" "it" "ja" "kn" "kk" "ko" "lo" "lv" "lt" "mk" "ms" "ml" "mr" "nb" "fa" "pl" "pt_BR" "pt_PT" "pa" "ro" "ru" "sr" "sk" "sl" "es" "es_AR" "es_ES" "es_MX" "sw" "sv" "ta" "te" "th" "tr" "uk" "ur" "uz" "vi" "zu" Template language and locale |
category | string (Category) Enum: "AUTHENTICATION" "MARKETING" "UTILITY" "ACCOUNT_UPDATE" "PAYMENT_UPDATE" "PERSONAL_FINANCE_UPDATE" "SHIPPING_UPDATE" "RESERVATION_UPDATE" "ISSUE_RESOLUTION" "APPOINTMENT_UPDATE" "TRANSPORTATION_UPDATE" "TICKET_UPDATE" "ALERT_UPDATE" "AUTO_REPLY" "OTHER" Category of use for this template |
object (Components) Message content of this template | |
examples | object (Examples) Provides an example of possible model data. This helps during the review and approval process so that the provider (e.g. Meta) can understand what
kind of messages you plan to send. Ensure these are examples and do not include personal or confidential information.
In case you decide to include variables and examples, provide them with the same number.
|
notificationEmail | string (Notification e-mail) E-mail list (comma-separated) to send notifications about the message template approving process |
required | object (Components) Message content of this template |
category required | string (Category) Enum: "AUTHENTICATION" "MARKETING" "UTILITY" Category of use for this template |
qualityScore | string (Quality Score) Enum: "UNKNOWN" "GREEN" "YELLOW" "RED" Quality score of the template while active, specific for WhatsApp templates, this field is based on the end client feedback and there are four possible scores: Pending (not enough feedback to classify the template quality, this template can be sent to clients), High (few or no negative feedback, this template can be sent to clients), Medium (has received negative feedback from several clients, this template can be sent to clients, but there is a risk of it being paused or disabled soon unless the problems reported by the clients are resolved) and Low (has received negative feedback from several clients, templates of this status can still be sent to clients, but there is a risk of it being suspended or disabled soon, so it is recommended that the problems reported by the clients are resolved as soon as possible). |
channel required | string (Channel) Channel where the template will be made available. |
id | string (Template ID) |
name required | string (Template name) The name of the template |
locale required | string (Locale) Enum: "af" "sq" "ar" "az" "bn" "bg" "ca" "zh_CN" "zh_HK" "zh_TW" "hr" "cs" "da" "nl" "en" "en_GB" "en_US" "et" "fil" "fi" "fr" "de" "el" "gu" "ha" "he" "hi" "hu" "id" "ga" "it" "ja" "kn" "kk" "ko" "lo" "lv" "lt" "mk" "ms" "ml" "mr" "nb" "fa" "pl" "pt_BR" "pt_PT" "pa" "ro" "ru" "sr" "sk" "sl" "es" "es_AR" "es_ES" "es_MX" "sw" "sv" "ta" "te" "th" "tr" "uk" "ur" "uz" "vi" "zu" Template language and locale |
examples | object (Examples) Provides an example of possible model data. This helps during the review and approval process so that the provider (e.g. Meta) can understand what
kind of messages you plan to send. Ensure these are examples and do not include personal or confidential information.
In case you decide to include variables and examples, provide them with the same number.
|
senderId required | string (Sender ID) The identifier of the sender of the template. The sender should be created with a credential. |
object (Metadata) Additional values related to the template but not used for messaging. | |
notificationEmail | string (Notification e-mail) E-mail list (comma-separated) to send notifications about the message template approving process |
text | string (Template text) A text reference for the template. This field encompasses all content components. |
fields | Array of strings (Fields) >= 0 items The available fields to be used in this template |
Array of objects (Comments) Comments added to the template during the approval process | |
status | string (Status of template) Enum: "WAITING_REVIEW" "REJECTED" "WAITING_APPROVAL" "APPROVED" "PAUSED" "DISABLED" |
createdAt | string (Creation timestamp) Creation timestamp in ISO format |
updatedAt | string (Update timestamp) Update timestamp in ISO format |
{- "locale": "af",
- "category": "AUTHENTICATION",
- "components": {
- "header": {
- "type": "MEDIA_DOCUMENT",
- "text": "string"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "footer": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}, - "otp": {
- "type": "ONE_TAP",
- "copyButtonText": "Copy the code",
- "addSecurityRecommendation": true,
- "codeExpirationMinutes": 5,
- "autofillText": "autofill",
- "packageName": "com.example.myapplication",
- "signatureHash": "K8a%2FAINcGX7"
}, - "attachments": [
- {
- "type": "ATTACHMENT_FIXED",
- "cid": "promotion.jpeg",
- "fileMimeType": "image/jpeg",
- "fileName": "attachment-name.jpeg"
}
], - "email": {
- "replyTo": {
- "email": "reply-to@zenvia.com",
- "name": "Service Care"
}
}
}, - "notificationEmail": "string"
}
{- "components": {
- "header": {
- "type": "MEDIA_DOCUMENT",
- "text": "string"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "footer": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}, - "otp": {
- "type": "ONE_TAP",
- "copyButtonText": "Copy the code",
- "addSecurityRecommendation": true,
- "codeExpirationMinutes": 5,
- "autofillText": "autofill",
- "packageName": "com.example.myapplication",
- "signatureHash": "K8a%2FAINcGX7"
}, - "carousel": {
- "cards": [
- {
- "header": {
- "type": "MEDIA_IMAGE"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}
}, - {
- "header": {
- "type": "MEDIA_IMAGE"
}, - "body": {
- "type": "TEXT_FIXED",
- "text": "string"
}, - "buttons": {
- "type": "string",
- "items": [
- {
- "type": "URL",
- "text": "string",
- "url": "string"
}
]
}
}
]
}
}, - "category": "AUTHENTICATION",
- "qualityScore": "UNKNOWN",
- "channel": "WHATSAPP",
- "id": "string",
- "name": "string",
- "locale": "af",
- "senderId": "string",
- "metadata": {
- "property1": "Zenvia",
- "property2": "Zenvia"
}, - "notificationEmail": "string",
- "text": "string",
- "fields": [
- "string"
], - "comments": [
- {
- "id": "string",
- "author": "string",
- "role": "REQUESTER",
- "text": "string",
- "createdAt": "string",
- "updatedAt": "string"
}
], - "status": "WAITING_REVIEW",
- "createdAt": "string",
- "updatedAt": "string"
}
Create a new comment
templateId required | string |
author required | string (Author) Author |
role required | string (Role) Enum: "REQUESTER" "REVIEWER" "WHATSAPP" Author role |
text required | string (Text) Comment text |
id | string (Comment ID) |
author required | string (Author) Author |
role required | string (Role) Enum: "REQUESTER" "REVIEWER" "WHATSAPP" Author role |
text required | string (Text) Comment text |
createdAt | string (Creation timestamp) Creation timestamp in ISO format |
updatedAt | string (Update timestamp) Update timestamp in ISO format |
{- "author": "string",
- "role": "REQUESTER",
- "text": "string"
}
{- "id": "string",
- "author": "string",
- "role": "REQUESTER",
- "text": "string",
- "createdAt": "string",
- "updatedAt": "string"
}
List all comments
templateId required | string |
id | string (Comment ID) |
author required | string (Author) Author |
role required | string (Role) Enum: "REQUESTER" "REVIEWER" "WHATSAPP" Author role |
text required | string (Text) Comment text |
createdAt | string (Creation timestamp) Creation timestamp in ISO format |
updatedAt | string (Update timestamp) Update timestamp in ISO format |
[- {
- "id": "string",
- "author": "string",
- "role": "REQUESTER",
- "text": "string",
- "createdAt": "string",
- "updatedAt": "string"
}
]
Delete comment by id
templateId required | string |
templateCommentId required | string The comment identifier |
{- "code": "VALIDATION_ERROR",
- "message": "Validation error",
- "details": [
- {
- "code": "string",
- "path": "string",
- "message": "string"
}
]
}
Allows the storage of files for later use.
content required | string (Binary File) Binary file content to be stored. |
object (File object) This is a file object model. |
Location | string The URL for created file object. |
id | string (ID) ID of the file resource created. |
url | string (URL) URL from where the file content is available. |
mimeType | string (Mime Type) Mime type of the file. When not provided, it will be determined based either on the header Content-Type or the file name extension. |
name | string (Name) Name of the file. When not provided, it will be obtained from either the header Content-Disposition or the URL path. |
bytes | number (Bytes) Size in bytes of the file content created. |
createdAt | string (Created At) Timestamp of the file creation. |
deleteAt | string (Delete At) Timestamp of the moment after which the file will be automatically deleted. |
Content-Type: multipart/form-data; boundary=3bb873df66f5202e15d4b3b9a7eff
--3bb873df66f5202e15d4b3b9a7eff Content-Disposition: form-data; name="file" Content-Type: application/json { "mimeType": "image/png", "name": "my-image.png" } --3bb873df66f5202e15d4b3b9a7eff Content-Disposition: form-data; name="content"; filename="original-name.png" Content-Type: image/png BINARY-CONTENT --3bb873df66f5202e15d4b3b9a7eff--
{- "id": "f8b5a77c7cd3403b08231a1a9c40705717cbc8cab4a9a9e08bf8a5c78905b7d5",
- "mimeType": "video/mp4",
- "name": "my-video.mp4",
- "bytes": 1044889600,
- "createdAt": "2021-12-20T14:37:59.000Z",
- "deleteAt": "2021-12-21T14:37:59.000Z"
}
Lists all files available
startTimestamp | string Example: startTimestamp=2022-02-21T10:30:25Z Timestamp after which, the files to be returned, were created |
endTimestamp | string Example: endTimestamp=2022-02-21T12:30:45Z Timestamp after which, the files to be returned, were created |
limit | integer [ 1 .. 10000 ] Default: 1000 The maximum amount of files to be returned. |
x-total | string Example: "100" The total number of results available. |
id | string (ID) ID of the file resource created. |
url | string (URL) URL from where the file content is available. |
mimeType | string (Mime Type) Mime type of the file. When not provided, it will be determined based either on the header Content-Type or the file name extension. |
name | string (Name) Name of the file. When not provided, it will be obtained from either the header Content-Disposition or the URL path. |
bytes | number (Bytes) Size in bytes of the file content created. |
createdAt | string (Created At) Timestamp of the file creation. |
deleteAt | string (Delete At) Timestamp of the moment after which the file will be automatically deleted. |
[- {
- "id": "f8b5a77c7cd3403b08231a1a9c40705717cbc8cab4a9a9e08bf8a5c78905b7d5",
- "mimeType": "video/mp4",
- "name": "my-video.mp4",
- "bytes": 1044889600,
- "createdAt": "2021-12-20T14:37:59.000Z",
- "deleteAt": "2021-12-21T14:37:59.000Z"
}
]
Allows to retrieve information about one previously stored file.
fileId required | string The file identifier |
id | string (ID) ID of the file resource created. |
url | string (URL) URL from where the file content is available. |
mimeType | string (Mime Type) Mime type of the file. When not provided, it will be determined based either on the header Content-Type or the file name extension. |
name | string (Name) Name of the file. When not provided, it will be obtained from either the header Content-Disposition or the URL path. |
bytes | number (Bytes) Size in bytes of the file content created. |
createdAt | string (Created At) Timestamp of the file creation. |
deleteAt | string (Delete At) Timestamp of the moment after which the file will be automatically deleted. |
{- "id": "f8b5a77c7cd3403b08231a1a9c40705717cbc8cab4a9a9e08bf8a5c78905b7d5",
- "mimeType": "video/mp4",
- "name": "my-video.mp4",
- "bytes": 1044889600,
- "createdAt": "2021-12-20T14:37:59.000Z",
- "deleteAt": "2021-12-21T14:37:59.000Z"
}
Allows to delete one previously stored file.
fileId required | string The file identifier |
{- "code": "VALIDATION_ERROR",
- "message": "Validation error",
- "details": [
- {
- "code": "string",
- "path": "string",
- "message": "string"
}
]
}
The flow-batches api makes it possible to dispatch a active Flow with one or more contents to multiple contacts at once.
To perform these operations, you will need your flowId and you can find it here.
Create a flow batch
flowId required | string The the flow identifier. You can view your Flow IDs here. |
name required | string The batch name. |
object (Batch schedule) Schedule to the batch dispatch | |
required | object (The batch content) The content to be used on dispatch |
id | string The flow batch identifier. |
flowId required | string The the flow identifier. You can view your Flow IDs here. |
name required | string The batch name. |
status | string Enum: "LOADING" "READY" "QUEUED" "PROCESSING" "WAITING" "COMPLETED" "CANCELING" "CANCELED" "TIMEOUT" "ERROR" The batch status:
|
errorCode | string Enum: "ERROR_SAVING_FILE" "ERROR_INVALID_MEDIA_TYPE" "ERROR_IN_MEDIA_TYPE_DETECTION" "ERROR_FILE_NOT_FOUND" "ERROR_IN_FILE_PROCESSING" "ERROR_PROCESSING_CONTACTS" "ERROR_INVALID_BULK_HEADERS" "ERROR_INVALID_CHARACTER" "ERROR_INVALID_TELEPHONE_NUMBER" "ERROR_SEEKING_CONTACTS" "ERROR_MAX_TPS" "UNSUPPORTED_CONTENT" "HEADER_SIZE_MISMATCH" "INVALID_MESSAGE_FORMAT" "FLOW_ID_NOT_FOUND" "GATEWAY_ERROR" "FLOW_ERROR" "INVALID_CONTENTS" "RECIPIENT_NOT_FOUND" "ERROR_REQUEST_STANDARD_ANSWER" "RESCHEDULE_PROCESS_ERROR" The batch error |
size | number The quantity of recived registers |
object (Aggregated batch status) Detailed status of the batch items | |
progress | number Progress of batch. 0-100 |
object (Batch schedule) Schedule to the batch dispatch | |
createdAt | string The created date. |
createdByUserEmail | string The creator e-mail |
object (The batch content) The content to be used on dispatch |
{- "flowId": "c2c3e42d-6fb7-4ad6-897a-dd7613469f58",
- "name": "Sales campaing",
- "schedule": {
- "start": "2021-08-03T16:26:23.616Z",
- "end": "2021-08-03T16:26:23.616Z",
- "limit": "2021-08-03T16:26:23.616Z"
}, - "content": {
- "fields": [
- [
- "5511999999999",
- "John",
- "Smartphone",
- "20/07/2021"
], - [
- "5511911111111",
- "Paul",
- "Tablet",
- "21/07/2021"
]
], - "fieldNames": [
- "sms",
- "name",
- "product",
- "deliveryDate"
]
}
}
{- "id": "853c2b58-8367-4fcb-8d16-d42208e15942",
- "flowId": "c2c3e42d-6fb7-4ad6-897a-dd7613469f58",
- "name": "Sales campaing",
- "status": "READY",
- "errorCode": "FLOW_ID_NOT_FOUND",
- "size": 1,
- "aggregatedStatus": {
- "successProcessedRecords": 1,
- "timedoutRecords": 1,
- "errorProcessedRecords": 1,
- "canceledRecords": 1,
- "processingRecords": 1,
- "queuedRecords": 1
}, - "progress": 100,
- "schedule": {
- "start": "2021-08-03T16:26:23.616Z",
- "end": "2021-08-03T16:26:23.616Z",
- "limit": "2021-08-03T16:26:23.616Z"
}, - "createdAt": "2021-08-03T16:26:23.616Z",
- "createdByUserEmail": "user@mail.com",
- "content": {
- "file": {
- "name": "file.csv",
- "containsHeader": true,
- "charset": "UTF-8"
}, - "fieldNames": [
- "sms",
- "name",
- "product",
- "deliveryDate"
]
}
}
Get list of flow-batches
flowId required | string Example: flowId=b5agf1-y237-11e8-b127-1230f6c2d98m The the flow identifier. You can view your Flow IDs here. |
page | number (page) Default: 0 Example: page=5 This is the page number. |
size | number (size) Default: 20 Example: size=10 This is the page size. |
x-total | string Example: "100" The total number of results available. |
x-page-size | string Example: "10" The number of results per page. |
x-page | string Example: "5" The current page. |
id | string The flow batch identifier. |
flowId required | string The the flow identifier. You can view your Flow IDs here. |
name required | string The batch name. |
status | string Enum: "LOADING" "READY" "QUEUED" "PROCESSING" "WAITING" "COMPLETED" "CANCELING" "CANCELED" "TIMEOUT" "ERROR" The batch status:
|
errorCode | string Enum: "ERROR_SAVING_FILE" "ERROR_INVALID_MEDIA_TYPE" "ERROR_IN_MEDIA_TYPE_DETECTION" "ERROR_FILE_NOT_FOUND" "ERROR_IN_FILE_PROCESSING" "ERROR_PROCESSING_CONTACTS" "ERROR_INVALID_BULK_HEADERS" "ERROR_INVALID_CHARACTER" "ERROR_INVALID_TELEPHONE_NUMBER" "ERROR_SEEKING_CONTACTS" "ERROR_MAX_TPS" "UNSUPPORTED_CONTENT" "HEADER_SIZE_MISMATCH" "INVALID_MESSAGE_FORMAT" "FLOW_ID_NOT_FOUND" "GATEWAY_ERROR" "FLOW_ERROR" "INVALID_CONTENTS" "RECIPIENT_NOT_FOUND" "ERROR_REQUEST_STANDARD_ANSWER" "RESCHEDULE_PROCESS_ERROR" The batch error |
size | number The quantity of recived registers |
object (Aggregated batch status) Detailed status of the batch items | |
progress | number Progress of batch. 0-100 |
object (Batch schedule) Schedule to the batch dispatch | |
createdAt | string The created date. |
createdByUserEmail | string The creator e-mail |
object (The batch content) The content to be used on dispatch |
[- {
- "id": "853c2b58-8367-4fcb-8d16-d42208e15942",
- "flowId": "c2c3e42d-6fb7-4ad6-897a-dd7613469f58",
- "name": "Sales campaing",
- "status": "READY",
- "errorCode": "FLOW_ID_NOT_FOUND",
- "size": 1,
- "aggregatedStatus": {
- "successProcessedRecords": 1,
- "timedoutRecords": 1,
- "errorProcessedRecords": 1,
- "canceledRecords": 1,
- "processingRecords": 1,
- "queuedRecords": 1
}, - "progress": 100,
- "schedule": {
- "start": "2021-08-03T16:26:23.616Z",
- "end": "2021-08-03T16:26:23.616Z",
- "limit": "2021-08-03T16:26:23.616Z"
}, - "createdAt": "2021-08-03T16:26:23.616Z",
- "createdByUserEmail": "user@mail.com",
- "content": {
- "file": {
- "name": "file.csv",
- "containsHeader": true,
- "charset": "UTF-8"
}, - "fieldNames": [
- "sms",
- "name",
- "product",
- "deliveryDate"
]
}
}
]
Retrieve one batch by id
flowBatchId required | string Example: b5agf1-y237-11e8-b127-1230f6c2d98m Flow Batch identifier |
id | string The flow batch identifier. |
flowId required | string The the flow identifier. You can view your Flow IDs here. |
name required | string The batch name. |
status | string Enum: "LOADING" "READY" "QUEUED" "PROCESSING" "WAITING" "COMPLETED" "CANCELING" "CANCELED" "TIMEOUT" "ERROR" The batch status:
|
errorCode | string Enum: "ERROR_SAVING_FILE" "ERROR_INVALID_MEDIA_TYPE" "ERROR_IN_MEDIA_TYPE_DETECTION" "ERROR_FILE_NOT_FOUND" "ERROR_IN_FILE_PROCESSING" "ERROR_PROCESSING_CONTACTS" "ERROR_INVALID_BULK_HEADERS" "ERROR_INVALID_CHARACTER" "ERROR_INVALID_TELEPHONE_NUMBER" "ERROR_SEEKING_CONTACTS" "ERROR_MAX_TPS" "UNSUPPORTED_CONTENT" "HEADER_SIZE_MISMATCH" "INVALID_MESSAGE_FORMAT" "FLOW_ID_NOT_FOUND" "GATEWAY_ERROR" "FLOW_ERROR" "INVALID_CONTENTS" "RECIPIENT_NOT_FOUND" "ERROR_REQUEST_STANDARD_ANSWER" "RESCHEDULE_PROCESS_ERROR" The batch error |
size | number The quantity of recived registers |
object (Aggregated batch status) Detailed status of the batch items | |
progress | number Progress of batch. 0-100 |
object (Batch schedule) Schedule to the batch dispatch | |
createdAt | string The created date. |
createdByUserEmail | string The creator e-mail |
object (The batch content) The content to be used on dispatch |
{- "id": "853c2b58-8367-4fcb-8d16-d42208e15942",
- "flowId": "c2c3e42d-6fb7-4ad6-897a-dd7613469f58",
- "name": "Sales campaing",
- "status": "READY",
- "errorCode": "FLOW_ID_NOT_FOUND",
- "size": 1,
- "aggregatedStatus": {
- "successProcessedRecords": 1,
- "timedoutRecords": 1,
- "errorProcessedRecords": 1,
- "canceledRecords": 1,
- "processingRecords": 1,
- "queuedRecords": 1
}, - "progress": 100,
- "schedule": {
- "start": "2021-08-03T16:26:23.616Z",
- "end": "2021-08-03T16:26:23.616Z",
- "limit": "2021-08-03T16:26:23.616Z"
}, - "createdAt": "2021-08-03T16:26:23.616Z",
- "createdByUserEmail": "user@mail.com",
- "content": {
- "file": {
- "name": "file.csv",
- "containsHeader": true,
- "charset": "UTF-8"
}, - "fieldNames": [
- "sms",
- "name",
- "product",
- "deliveryDate"
]
}
}
Cancel a flow batch
flowBatchId required | string Example: b5agf1-y237-11e8-b127-1230f6c2d98m Flow Batch identifier |
{- "code": "VALIDATION_ERROR",
- "message": "Validation error",
- "details": [
- {
- "code": "string",
- "path": "string",
- "message": "string"
}
]
}
Pause a flow batch
flowBatchId required | string Example: b5agf1-y237-11e8-b127-1230f6c2d98m Flow Batch identifier |
{- "code": "VALIDATION_ERROR",
- "message": "Validation error",
- "details": [
- {
- "code": "string",
- "path": "string",
- "message": "string"
}
]
}
Resume a flow batch
flowBatchId required | string Example: b5agf1-y237-11e8-b127-1230f6c2d98m Flow Batch identifier |
{- "code": "VALIDATION_ERROR",
- "message": "Validation error",
- "details": [
- {
- "code": "string",
- "path": "string",
- "message": "string"
}
]
}
Send outbound message to Chatbot
from required | string (From) non-empty Identifier of the channel to be triggered. |
to required | string (To) non-empty User identifier according to the channel. |
channel required | string (Channel) non-empty The channel name to be trigerred. |
required | Array of any (Contents) non-empty Contents of template to trigger outbound. |
nodeId | string (Node Id) Node identifier in NLU. |
object (Attributes) Attributes of NLU contact to be set. | |
extra | object (Extra) Extra attributes of NLU contact. New properties will be created that do not exist in NLU. Existing properties will have their values replaced. Only properties with letters, digits and/or underscores will be accepted. Any other character will be considered invalid and the property will not be created. |
restartContact | boolean (restartContact) Parameter to reset context variables and create a new service in NLU. |
inactivityTime | number (inactivityTime) Time in minutes that must pass since the user's last interaction with the assistant for the message to be sent. Example: If the user is interacting or interacted with the assistant 1 minute ago and the inactivity time required for the message to be sent is 2 minutes |
id | number Outbound message identifier in NLU |
channelId | number Channel identifier in NLU |
contactId | number Contact identifier in NLU |
messageId | string (Message ID) An ID for the message. It can be used for future message consulting or callback notifications. |
status | string Status of outbound trigger |
createdAt | string (Creation Timestamp) Timestamp of the outbound message trigger |
from required | string (From) non-empty Identifier of the channel to be triggered. |
to required | string (To) non-empty User identifier according to the channel. |
channel required | string (Channel) non-empty The channel name to be trigerred. |
required | Array of any (Contents) non-empty Contents of template to trigger outbound. |
nodeId | string (Node Id) Node identifier in NLU. |
object (Attributes) Attributes of NLU contact to be set. | |
extra | object (Extra) Extra attributes of NLU contact. New properties will be created that do not exist in NLU. Existing properties will have their values replaced. Only properties with letters, digits and/or underscores will be accepted. Any other character will be considered invalid and the property will not be created. |
restartContact | boolean (restartContact) Parameter to reset context variables and create a new service in NLU. |
inactivityTime | number (inactivityTime) Time in minutes that must pass since the user's last interaction with the assistant for the message to be sent. Example: If the user is interacting or interacted with the assistant 1 minute ago and the inactivity time required for the message to be sent is 2 minutes |
{- "from": "551130309090",
- "to": "44988776655",
- "channel": "whatsapp",
- "contents": [
- {
- "type": "template",
- "templateId": "c2c3e42d-6fb7-4ad6-897a-dd7613469f58",
- "fields": {
- "user": "John Smith",
- "protocol": "34534252"
}
}
], - "nodeId": "node_6fb54f855f19a947",
- "attributes": {
- "name": "John",
- "email": "john@doe.email.com",
- "cpf": "11122233344",
- "birthdate": "1970-06-13",
- "gender": "Male",
- "address": {
- "postalCode": "11222-000",
- "street": "Street address",
- "number": 123,
- "complement": "Store 03",
- "district": "District name",
- "city": "City name",
- "state": "SP"
}
}, - "extra": {
- "new_property": "some_value",
- "identification_number2": ""
}, - "restartContact": true,
- "inactivityTime": 2
}
{- "id": 1293,
- "channelId": 2,
- "contactId": 9752,
- "messageId": "string",
- "status": "pending",
- "createdAt": "2022-10-27T13:25:11.354Z",
- "from": "551130309090",
- "to": "44988776655",
- "channel": "whatsapp",
- "contents": [
- {
- "type": "template",
- "templateId": "c2c3e42d-6fb7-4ad6-897a-dd7613469f58",
- "fields": {
- "user": "John Smith",
- "protocol": "34534252"
}
}
], - "nodeId": "node_6fb54f855f19a947",
- "attributes": {
- "name": "John",
- "email": "john@doe.email.com",
- "cpf": "11122233344",
- "birthdate": "1970-06-13",
- "gender": "Male",
- "address": {
- "postalCode": "11222-000",
- "street": "Street address",
- "number": 123,
- "complement": "Store 03",
- "district": "District name",
- "city": "City name",
- "state": "SP"
}
}, - "extra": {
- "new_property": "some_value",
- "identification_number2": ""
}, - "restartContact": true,
- "inactivityTime": 2
}
Allows the creation of contacts.
required | object (Channels) non-empty Contact communication channels. At least one communication channel must be provided. |
firstName | string (First Name) Contact's name. |
lastName | string (Last Name) Contact's surname. |
birthdate | string (Birthdate) Contact's birthdate |
object (Custom Data) Set values for contact custom data fields created on contact data fields API. | |
Array of objects (Addresses) Contact's addresses. | |
listIds | Array of strings (List IDs) IDs of the lists the contact is included in. |
id | string (ID) ID of the contact. |
object (Channels) non-empty Contact communication channels. At least one communication channel must be provided. | |
firstName | string (First Name) Contact's name. |
lastName | string (Last Name) Contact's surname. |
birthdate | string (Birthdate) Contact's birthdate |
object (Custom Data) Set values for contact custom data fields created on contact data fields API. | |
Array of objects (Addresses) Contact's addresses. | |
listIds | Array of strings (List IDs) IDs of the lists the contact is included in. |
createdAt | string (Created At) Timestamp of the contact creation. |
updatedAt | string (Updated At) Timestamp of the contact update. |
{- "channels": {
- "email": "contact@domain.example",
- "mobile": "5510888883333",
- "landline": "551044443333"
}, - "firstName": "Rafael",
- "lastName": "Souza",
- "birthdate": "1970-06-13",
- "customData": {
- "property1": "2022-06-13",
- "property2": "2022-06-13"
}, - "addresses": [
- {
- "country": "Brazil",
- "zipcode": "01310-300",
- "state": "SP",
- "city": "São Paulo",
- "address": "Av. Paulista",
- "streetNumber": "2300",
- "neighborhood": "Bela Vista"
}
], - "listIds": [
- "list-id-01",
- "list-id-02",
- "list-id-03"
]
}
{- "id": "string",
- "channels": {
- "email": "contact@domain.example",
- "mobile": "5510888883333",
- "landline": "551044443333"
}, - "firstName": "Rafael",
- "lastName": "Souza",
- "birthdate": "1970-06-13",
- "customData": {
- "property1": "2022-06-13",
- "property2": "2022-06-13"
}, - "addresses": [
- {
- "country": "Brazil",
- "zipcode": "01310-300",
- "state": "SP",
- "city": "São Paulo",
- "address": "Av. Paulista",
- "streetNumber": "2300",
- "neighborhood": "Bela Vista"
}
], - "listIds": [
- "list-id-01",
- "list-id-02",
- "list-id-03"
], - "createdAt": "2022-05-23T19:37:59.000Z",
- "updatedAt": "2022-05-23T19:37:59.000Z"
}
Lists all contacts available
listId | Array of strings Example: listId=list-id-01&listId=list-id-02&listId=list-id-03 Contact list ids to filter the contacts. |
page | number (page) Default: 0 Example: page=5 This is the page number. |
size | number (size) Default: 20 Example: size=10 This is the page size. |
x-total | string Example: "100" The total number of results available. |
id | string (ID) ID of the contact. |
object (Channels) non-empty Contact communication channels. At least one communication channel must be provided. | |
firstName | string (First Name) Contact's name. |
lastName | string (Last Name) Contact's surname. |
birthdate | string (Birthdate) Contact's birthdate |
object (Custom Data) Set values for contact custom data fields created on contact data fields API. | |
Array of objects (Addresses) Contact's addresses. | |
listIds | Array of strings (List IDs) IDs of the lists the contact is included in. |
createdAt | string (Created At) Timestamp of the contact creation. |
updatedAt | string (Updated At) Timestamp of the contact update. |
[- {
- "id": "string",
- "channels": {
- "email": "contact@domain.example",
- "mobile": "5510888883333",
- "landline": "551044443333"
}, - "firstName": "Rafael",
- "lastName": "Souza",
- "birthdate": "1970-06-13",
- "customData": {
- "property1": "2022-06-13",
- "property2": "2022-06-13"
}, - "addresses": [
- {
- "country": "Brazil",
- "zipcode": "01310-300",
- "state": "SP",
- "city": "São Paulo",
- "address": "Av. Paulista",
- "streetNumber": "2300",
- "neighborhood": "Bela Vista"
}
], - "listIds": [
- "list-id-01",
- "list-id-02",
- "list-id-03"
], - "createdAt": "2022-05-23T19:37:59.000Z",
- "updatedAt": "2022-05-23T19:37:59.000Z"
}
]
Allows to retrieve a contact's information.
contactId required | string The contact identifier |
id | string (ID) ID of the contact. |
object (Channels) non-empty Contact communication channels. At least one communication channel must be provided. | |
firstName | string (First Name) Contact's name. |
lastName | string (Last Name) Contact's surname. |
birthdate | string (Birthdate) Contact's birthdate |
object (Custom Data) Set values for contact custom data fields created on contact data fields API. | |
Array of objects (Addresses) Contact's addresses. | |
listIds | Array of strings (List IDs) IDs of the lists the contact is included in. |
createdAt | string (Created At) Timestamp of the contact creation. |
updatedAt | string (Updated At) Timestamp of the contact update. |
{- "id": "string",
- "channels": {
- "email": "contact@domain.example",
- "mobile": "5510888883333",
- "landline": "551044443333"
}, - "firstName": "Rafael",
- "lastName": "Souza",
- "birthdate": "1970-06-13",
- "customData": {
- "property1": "2022-06-13",
- "property2": "2022-06-13"
}, - "addresses": [
- {
- "country": "Brazil",
- "zipcode": "01310-300",
- "state": "SP",
- "city": "São Paulo",
- "address": "Av. Paulista",
- "streetNumber": "2300",
- "neighborhood": "Bela Vista"
}
], - "listIds": [
- "list-id-01",
- "list-id-02",
- "list-id-03"
], - "createdAt": "2022-05-23T19:37:59.000Z",
- "updatedAt": "2022-05-23T19:37:59.000Z"
}
Allows to update a contact's information.
contactId required | string The contact identifier |
object (Channels) non-empty Contact communication channels. At least one communication channel must be provided. | |
firstName | string (First Name) Contact's name. |
lastName | string (Last Name) Contact's surname. |
birthdate | string (Birthdate) Contact's birthdate |
object (Custom Data) Set values for contact custom data fields created on contact data fields API. | |
Array of objects (Addresses) Contact's addresses. | |
listIds | Array of strings (List IDs) IDs of the lists the contact is included in. |
id | string (ID) ID of the contact. |
object (Channels) non-empty Contact communication channels. At least one communication channel must be provided. | |
firstName | string (First Name) Contact's name. |
lastName | string (Last Name) Contact's surname. |
birthdate | string (Birthdate) Contact's birthdate |
object (Custom Data) Set values for contact custom data fields created on contact data fields API. | |
Array of objects (Addresses) Contact's addresses. | |
listIds | Array of strings (List IDs) IDs of the lists the contact is included in. |
createdAt | string (Created At) Timestamp of the contact creation. |
updatedAt | string (Updated At) Timestamp of the contact update. |
{- "channels": {
- "email": "contact@domain.example",
- "mobile": "5510888883333",
- "landline": "551044443333"
}, - "firstName": "Rafael",
- "lastName": "Souza",
- "birthdate": "1970-06-13",
- "customData": {
- "property1": "2022-06-13",
- "property2": "2022-06-13"
}, - "addresses": [
- {
- "country": "Brazil",
- "zipcode": "01310-300",
- "state": "SP",
- "city": "São Paulo",
- "address": "Av. Paulista",
- "streetNumber": "2300",
- "neighborhood": "Bela Vista"
}
], - "listIds": [
- "list-id-01",
- "list-id-02",
- "list-id-03"
]
}
{- "id": "string",
- "channels": {
- "email": "contact@domain.example",
- "mobile": "5510888883333",
- "landline": "551044443333"
}, - "firstName": "Rafael",
- "lastName": "Souza",
- "birthdate": "1970-06-13",
- "customData": {
- "property1": "2022-06-13",
- "property2": "2022-06-13"
}, - "addresses": [
- {
- "country": "Brazil",
- "zipcode": "01310-300",
- "state": "SP",
- "city": "São Paulo",
- "address": "Av. Paulista",
- "streetNumber": "2300",
- "neighborhood": "Bela Vista"
}
], - "listIds": [
- "list-id-01",
- "list-id-02",
- "list-id-03"
], - "createdAt": "2022-05-23T19:37:59.000Z",
- "updatedAt": "2022-05-23T19:37:59.000Z"
}
Allows to delete a contact.
contactId required | string The contact identifier |
{- "code": "VALIDATION_ERROR",
- "message": "Validation error",
- "details": [
- {
- "code": "string",
- "path": "string",
- "message": "string"
}
]
}
Allows the creation of contact lists.
name required | string (Name) Contact list's name. |
id | string (ID) ID of the contact list. |
name | string (Name) Contact list's name. |
size | number (Size) Number of contacts are in the list. |
createdAt | string (Created At) Timestamp of the contact list creation. |
updatedAt | string (Updated At) Timestamp of the contact list update. |
{- "name": "Technology interest"
}
{- "id": "string",
- "name": "Technology interest",
- "size": 10,
- "createdAt": "2022-05-23T19:37:59.000Z",
- "updatedAt": "2022-05-23T19:37:59.000Z"
}
Lists all contact lists available.
page | number (page) Default: 0 Example: page=5 This is the page number. |
size | number (size) Default: 20 Example: size=10 This is the page size. |
x-total | string Example: "100" The total number of results available. |
id | string (ID) ID of the contact list. |
name | string (Name) Contact list's name. |
size | number (Size) Number of contacts are in the list. |
createdAt | string (Created At) Timestamp of the contact list creation. |
updatedAt | string (Updated At) Timestamp of the contact list update. |
[- {
- "id": "string",
- "name": "Technology interest",
- "size": 10,
- "createdAt": "2022-05-23T19:37:59.000Z",
- "updatedAt": "2022-05-23T19:37:59.000Z"
}
]
Allows to retrieve a contact list's information.
listId required | string The contact list identifier |
id | string (ID) ID of the contact list. |
name | string (Name) Contact list's name. |
size | number (Size) Number of contacts are in the list. |
createdAt | string (Created At) Timestamp of the contact list creation. |
updatedAt | string (Updated At) Timestamp of the contact list update. |
{- "id": "string",
- "name": "Technology interest",
- "size": 10,
- "createdAt": "2022-05-23T19:37:59.000Z",
- "updatedAt": "2022-05-23T19:37:59.000Z"
}
Allows to update a contact list's information.
listId required | string The contact list identifier |
name | string (Name) Contact list's name. |
id | string (ID) ID of the contact list. |
name | string (Name) Contact list's name. |
size | number (Size) Number of contacts are in the list. |
createdAt | string (Created At) Timestamp of the contact list creation. |
updatedAt | string (Updated At) Timestamp of the contact list update. |
{- "name": "Technology interest"
}
{- "id": "string",
- "name": "Technology interest",
- "size": 10,
- "createdAt": "2022-05-23T19:37:59.000Z",
- "updatedAt": "2022-05-23T19:37:59.000Z"
}
Allows to delete a contact list. Only the list is deleted, not the contacts.
listId required | string The contact list identifier |
{- "code": "VALIDATION_ERROR",
- "message": "Validation error",
- "details": [
- {
- "code": "string",
- "path": "string",
- "message": "string"
}
]
}
Virtual collection to list the contacts in the list.
listId required | string The contact list identifier |
page | number (page) Default: 0 Example: page=5 This is the page number. |
size | number (size) Default: 20 Example: size=10 This is the page size. |
x-total | string Example: "100" The total number of results available. |
id | string (ID) ID of the contact. |
object (Channels) non-empty Contact communication channels. At least one communication channel must be provided. | |
firstName | string (First Name) Contact's name. |
lastName | string (Last Name) Contact's surname. |
birthdate | string (Birthdate) Contact's birthdate |
object (Custom Data) Set values for contact custom data fields created on contact data fields API. | |
Array of objects (Addresses) Contact's addresses. | |
listIds | Array of strings (List IDs) IDs of the lists the contact is included in. |
createdAt | string (Created At) Timestamp of the contact creation. |
updatedAt | string (Updated At) Timestamp of the contact update. |
[- {
- "id": "string",
- "channels": {
- "email": "contact@domain.example",
- "mobile": "5510888883333",
- "landline": "551044443333"
}, - "firstName": "Rafael",
- "lastName": "Souza",
- "birthdate": "1970-06-13",
- "customData": {
- "property1": "2022-06-13",
- "property2": "2022-06-13"
}, - "addresses": [
- {
- "country": "Brazil",
- "zipcode": "01310-300",
- "state": "SP",
- "city": "São Paulo",
- "address": "Av. Paulista",
- "streetNumber": "2300",
- "neighborhood": "Bela Vista"
}
], - "listIds": [
- "list-id-01",
- "list-id-02",
- "list-id-03"
], - "createdAt": "2022-05-23T19:37:59.000Z",
- "updatedAt": "2022-05-23T19:37:59.000Z"
}
]
Allows the creation of custom data fields to be used in the contacts API.
name required | string (Name) Friendly name for the field. This is used on user interfaces like Zenvia Campaign. |
type | string (Type) Default: "string" Enum: "string" "number" "date" The type of values stored in this field. It affects validation and rendering in user interfaces. |
id | string (ID) ID of the contact data field to be created. This will be field name to be used on the contacts API. |
name required | string (Name) Friendly name for the field. This is used on user interfaces like Zenvia Campaign. |
type | string (Type) Default: "string" Enum: "string" "number" "date" The type of values stored in this field. It affects validation and rendering in user interfaces. |
createdAt | string (Created At) Timestamp of the contact data field creation. |
{- "name": "My Field",
- "type": "date"
}
{- "id": "my_field",
- "name": "My Field",
- "type": "date",
- "createdAt": "2022-05-23T19:37:59.000Z"
}
Lists all contact custom data fields available.
page | number (page) Default: 0 Example: page=5 This is the page number. |
size | number (size) Default: 20 Example: size=10 This is the page size. |
x-total | string Example: "100" The total number of results available. |
id | string (ID) ID of the contact data field to be created. This will be field name to be used on the contacts API. |
name required | string (Name) Friendly name for the field. This is used on user interfaces like Zenvia Campaign. |
type | string (Type) Default: "string" Enum: "string" "number" "date" The type of values stored in this field. It affects validation and rendering in user interfaces. |
createdAt | string (Created At) Timestamp of the contact data field creation. |
[- {
- "id": "my_field",
- "name": "My Field",
- "type": "date",
- "createdAt": "2022-05-23T19:37:59.000Z"
}
]
A report that shows all messages sent and received during a period. It may also be filtered by channel or type.
Retrieve all entries applying the given filters
startDate required | string <date> The start date for query entries |
endDate required | string <date> The end date for query entries |
channels | string A comma-separated list of the channels identifier |
type | string Enum: "message" "notification" The type of the messages |
channel | string (Channel) |
type | string (Message type) The type of messages, which may be either "message" or "notification". |
directionInTotal | number (IN messages total) The total of IN direction messages. |
directionOutTotal | number (OUT messages total) The total of OUT direction messages. |
total | number (Messages total) The total of messages including IN and OUT directions. |
[- {
- "channel": "string",
- "type": "string",
- "directionInTotal": 0,
- "directionOutTotal": 0,
- "total": 0
}
]
A report that provides the current state of sessions (executions) of flows for a specific time frame. These states contain session variables and their current value. The report can be filtered by flow, dispatch, or session.
Retrieve all entries applying the given filters
startDate required | string <date> The start date for query entries |
endDate | string <date> The end date for query entries |
flowId | string (Flow ID) The the flow identifier. You can view your Flow IDs here. |
dispatchId | string (Dispatch ID) The ID generated at the time of the dispatch |
sessionId | string (Session ID) An ID that represents a flow execution. In case of conversational flows, it identifies the conversation in our platform. |
flowId | string (Flow ID) The the flow identifier. You can view your Flow IDs here. |
dispatchId | string (Dispatch ID) The dispatch identifier |
sessionId | string (Session ID) An ID that represents a flow execution. In case of conversational flows, it identifies the conversation in our platform. |
firstEventTimestamp | string (First event timestamp) Time of the first event with the client |
lastEventTimestamp | string (Last event timestamp) Time of the last event with the client |
variables | object (Objects of varibles) Object where session variables are saved |
[- {
- "flowId": "string",
- "dispatchId": "string",
- "sessionId": "string",
- "firstEventTimestamp": "string",
- "lastEventTimestamp": "string",
- "variables": { }
}
]
The marketing-automations API makes it possible to trigger an automation for a contact that is outside of the contacts manager.
To perform these operations, you will need an automationId that you can find it here.
Allows the execution of a marketing automation
automationId required | string The marketing automation identifier |
required | object (Recipient's channels) non-empty List of recipient's channels. All channels registered in marketing automation must be provided |
object (Variables) Variables list registered in automation steps. All variables registered in marketing automation must be provided |
id | string The dispatch identifier |
status | string The dispatch status |
marketingAutomationId | string The marketing automation identifier |
{- "recipientChannels": {
- "sms": "5511999999999",
- "email": "email@email.com"
}, - "variables": {
- "name": "John Doe",
- "birthdate": "01/01/1979"
}
}
{- "id": "7388c68e-675e-435b-b2ec-f72677798678",
- "status": "SENT",
- "marketingAutomationId": "5c408dd6-a39a-4eb1-b3b0-bf6f2f34ea39"
}
Centralized API for status and monitoring of Zenvia platforms and solutions. This API can be used by customers who need to monitor our services for better understanding.
Allows monitoring of the status of Zenvia platforms and solutions.
id | string (ID) ID of the Zenvia plataform/service. |
name | string (Name) Name of the Zenvia plataform/service. |
type | string (Type) Enum: "system" "configured" Type of the Status Group. The configured type will only appear if available and if the user uses a valid authentication |
status | string (Status) Enum: "UP" "UNKNOWN" "WARNING" "DOWN" Indicates the status of a Zenvia group or component |
timestamp | string (Timestamp) Indicates the moment in which the state was generated. |
object (Window) Indicates the time window that the state represents. | |
Array of objects (Components) Components that are a part of the status. |
[- {
- "id": "whatsapp",
- "name": "whatsapp",
- "type": "configured",
- "status": "UP",
- "timestamp": "2022-05-23T19:37:59.000Z",
- "window": {
- "seconds": 60,
- "timestamp": "2023-02-23T19:37:00Z",
- "id": 27929555
}, - "components": [
- {
- "id": "core-api",
- "name": "Platform",
- "status": "UP",
- "property1": "Zenvia",
- "property2": "Zenvia"
}
]
}
]
Allows monitoring of the status of a single Zenvia platform and solution.
componentId required | string The component of the status groups identifier |
id | string (ID) ID of the Zenvia plataform/service. |
name | string (Name) Name of the Zenvia plataform/service. |
type | string (Type) Enum: "system" "configured" Type of the Status Group. The configured type will only appear if available and if the user uses a valid authentication |
status | string (Status) Enum: "UP" "UNKNOWN" "WARNING" "DOWN" Indicates the status of a Zenvia group or component |
timestamp | string (Timestamp) Indicates the moment in which the state was generated. |
object (Window) Indicates the time window that the state represents. | |
Array of objects (Components) Components that are a part of the status. |
{- "id": "whatsapp",
- "name": "whatsapp",
- "type": "configured",
- "status": "UP",
- "timestamp": "2022-05-23T19:37:59.000Z",
- "window": {
- "seconds": 60,
- "timestamp": "2023-02-23T19:37:00Z",
- "id": 27929555
}, - "components": [
- {
- "id": "core-api",
- "name": "Platform",
- "status": "UP",
- "property1": "Zenvia",
- "property2": "Zenvia"
}
]
}