Zenvia APIs (2.0.0)

Download OpenAPI specification:Download

Overview

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.

Features

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:

  • Messages: Receive messages events for outgoing and/or incoming messages.
  • Messages status: Receive status updates for outgoing messages.

Pre-requisites

Before using this API you need the following:

  • Zenvia Account: create an account on Zenvia platform's site
  • Integrations: configure desired channels to send and/or receive messages on the integrations page
  • API Token: create an API token on the API console
  • Webhook: subscribe to events using subscriptions API resources
    • Status Webhook (important): Since our messaging API is asynchronous, it is necessary to register a webhook in order to know whether the message sending was successful or not.
    • Message Webhook (optional): receive message responses by subscribing to message events.

You can use the Sandbox to start using and testing this API immediately.

View your Usage Report

You can also access Zenvia platform to view your Usage Report

Getting started with Sandbox

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.

API versions

All breaking changes to Zenvia APIs will be documented here.

Currently, the Zenvia APIs is on version v2.

v2 (current)

  • Breaking Changes
    • Visitor not sent as a JSON within contents block. Instead, it's sent directly under the message object.
    • Location is no longer used as JSON.
    • Removed deprecated channels attribute from the template resource.

v1 (deprecated)

You can still check v1 version clicking here.

SDKs

Make it simpler to use our API by integrating our SDK into your software.

These helper libraries are available on Node and Java programming languages and located on our GitHub page.

HTTP Methods

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.

Error Handling

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

Authentication

Token

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.

Example:

X-API-TOKEN: hKp94crjv9OF3UGrCpSXUJw1-UYHhRvLKNLt

Generate your token on the API console on Zenvia platform.

Signature

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.

Example:

X-API-Token: hKp94crjv9OF3UGrCpSXUJw1-UYHhRvLKNLt
X-API-Signature: rtHTyAfsJFD5UFpPDeztUI3JE0Guea5pqG9iJqrT2EY=

Signature generation

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:

  1. The request method.
    Ex: POST, GET.

  2. The MD5 hash of the request body.
    Ex: d98bd30dcb3c03d166eee84efba1e3d7

    • For request without body, this line must be empty.
    • For multipart/form-data, only the file content from the request is expected for the hash calculation.
  3. The request Content-Type header.
    Ex: application/json.

    • For request without body, this line must be empty.
    • For multipart/form-data, the file content type should be used.
  4. The request Date header, formatted following the RFC2616.
    Ex: Sun, 12 Feb 2023 07:40:32 GMT.

    • Timestamps in the future will not be considered valid.
    • Timestamps older than 3 minutes will be refused.
  5. The request hostname. It probably will always be api.zenvia.com.
    Ex: api.zenvia.com.

  6. The request resource, including the query string when present.
    Ex: /v2/channels/whatsapp/messages, /v2/files?limit=5.


Signature input examples

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

Signature generation example in JavaScript

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);

JWT

The JWT token is primarily used by front-end applications for user interactions.

For server-to-server integrations use the token authentication approach.

Content types

Supported Channels

For each content type covered in the next section, the following table reflects its support for each available channel:

Content Type SMS Facebook WhatsApp RCS Voice Telegram GBM* Instagram E-Mail
text
file
replyable_text
template
card
carousel
contacts
location
call
email
button
list
product_list
product

*GBM stands for Google Business Messages

Text

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.
URL preview only applicable to WhatsApp channel.

{
  • "type": "text",
  • "text": "This is a text.",
  • "payload": "string"
}

File

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:

  • Image
  • Video
  • Audio
  • Document
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..
Only applicable to RCS

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.

Only applicable to RCS

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.

WhatsApp: see supported contents and sizes.
Instagram: see supported contents and sizes.
Telegram: see supported contents and sizes.
E-Mail: see supported contents and sizes.
For the rest of the channels, the limitations are currently undocumented.

fileName
string

The name of the file.
Only applicable to WhatsApp, Facebook, Telegram, Google Business Messages and E-mail documents.

fileCaption
string

Some description for the file.
Only applicable to WhatsApp, RCS, Telegram and Google Business Messages images and videos.

{}

Replyable Text

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.
URL preview only applicable to WhatsApp channel.

Array of any (Quick reply buttons) <= 13 items

Horizontal list of buttons displayed after the content. These will fade away once one is clicked.

RCS: A maximum of 11 buttons is supported.
Google Business Messages: Supported types: text, link and dial. A maximum of 25 characters is supported in each button.
Instagram: Supported type: text. A maximum of 20 characters is supported in each button.
Facebook: Supported type: text.
Telegram: Supported types: text and share_location.

Only applicable to RCS and Google Business Messages channels for Cards and Carousels.

{
  • "type": "replyable_text",
  • "text": "This is a text.",
  • "payload": "string",
  • "quickReplyButtons": [
    • {
      • "type": "string",
      • "text": "Click me!",
      • "payload": "clicked-on-button-1"
      }
    ]
}

Template

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.

For media templates, the media URL is obtained from imageUrl, videoUrl or documentUrl depending on the template used.

For WhatsApp authentication templates, pass the token parameter and its value. It is required.

For WhatsApp coupon templates, pass the code parameter and its value. It is required.

{
  • "type": "template",
  • "templateId": "c2c3e42d-6fb7-4ad6-897a-dd7613469f58",
  • "fields": {
    • "user": "John Smith",
    • "protocol": "34534252"
    }
}

Submitting a template content for approval

You may submit templates for approval using our template console if you already own a WhatsApp Business account with us.

Card

This type of content is rich and is composed of at least one of the following components (none of them are mandatory):

  • Media
  • Title
  • Text

Additionally, it may include:

  • Buttons
  • Quick reply buttons (not part of the card itself, but are instead shown below it)

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.
Instagram: A maximum of 80 characters is supported.

text
string

A text to be displayed inside the card.
Instagram: A maximum of 80 characters is supported.

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.

RCS: A maximum of 4 buttons is supported, but they might not be shown if they do not fit in the available space.
Google Business Messages: A maximum of 4 buttons is supported. Supported types: text, link and dial.
Instagram: A maximum of 3 buttons is supported. Supported types: text and link.
Facebook: A maximum of 3 buttons is supported. Supported types: text, link and dial.
Telegram: Supported types: link.

Array of any (Quick reply buttons) <= 13 items

Horizontal list of buttons displayed after the content. These will fade away once one is clicked.

RCS: A maximum of 11 buttons is supported.
Google Business Messages: Supported types: text, link and dial. A maximum of 25 characters is supported in each button.
Instagram: Supported type: text. A maximum of 20 characters is supported in each button.
Facebook: Supported type: text.
Telegram: Supported types: text and share_location.

Only applicable to RCS and Google Business Messages channels for Cards and Carousels.

{
  • "type": "card",
  • "title": "Hello",
  • "text": "This is the best thing you will see today!",
  • "media": {},
  • "buttons": [
    • {
      • "type": "string",
      • "text": "Click me!",
      • "payload": "clicked-on-button-1"
      }
    ],
  • "quickReplyButtons": [
    • {
      • "type": "string",
      • "text": "Click me!",
      • "payload": "clicked-on-button-1"
      }
    ]
}

Carousel

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 LARGE if it were available for use for the cards of the carousel.

Only applicable to RCS and Google Business Messages channels.

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.

RCS: A maximum of 11 buttons is supported.
Google Business Messages: Supported types: text, link and dial. A maximum of 25 characters is supported in each button.
Instagram: Supported type: text. A maximum of 20 characters is supported in each button.
Facebook: Supported type: text.
Telegram: Supported types: text and share_location.

Only applicable to RCS and Google Business Messages channels for Cards and Carousels.

{
  • "type": "carousel",
  • "cardWidth": "SMALL",
  • "cards": [
    • {
      • "title": "Hello",
      • "text": "This is the best thing you will see today!",
      • "media": {},
      • "buttons": [
        • {
          • "type": "string",
          • "text": "Click me!",
          • "payload": "clicked-on-button-1"
          }
        ]
      }
    ],
  • "quickReplyButtons": [
    • {
      • "type": "string",
      • "text": "Click me!",
      • "payload": "clicked-on-button-1"
      }
    ]
}

Contacts

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"
          }
        ],
      • "urls": []
      }
    ]
}

Location

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",
}

WhatsApp Button

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"
      }
    ]
}

WhatsApp List

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"
          }
        ]
      }
    ]
}

Call

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
}

E-Mail

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.
Inline attachment is supported. The cid of the content is the fileName.
Ex: <img src="cid:example2.jpeg">.

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"
    }
}

SMS Text

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.
URL preview only applicable to WhatsApp channel.

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.

The default value AUTO will select the encoding method based on the text content, so this is only necessary if you need to enforce MORE_CHARACTERS_PER_MESSAGE method (not recommended regarding readability), or to enforce MORE_CHARACTER_SUPPORT if you have any trouble with AUTO.

More information about SMS encoding can be found in the SMS limitations section.

Only applicable to SMS channel.

reportId
number [ -2147483648 .. 2147483647 ]

An ID used for report purposes only (also known as aggregate id). It must be setup before use.
Only applicable to SMS channel.

{
  • "type": "text",
  • "text": "This is a text.",
  • "payload": "string",
  • "encodingStrategy": "AUTO",
  • "reportId": 12345
}

Product

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

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"
          }
        ]
      }
    ]
}

OptIn Request

This is Instagram and Facebook recurring message optin request content.

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.
You can send up to 10 opt-in requests for different titles per user over a 7 days period. A sub-limit of up to 5 opt-in requests may be sent to a contact in a day.

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.
By default, the title of the request will be used as payload.

timezone
string
Default: "UTC"

Indicates the timezone that will be used for scheduling the recurring messages.

{}

Product List Order

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"
      }
    ]
}

OptIn Response

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 (to attribute) when sending a recurring message. This contact id has an expiration timestamp.

optInExpiration
string

The timestamp when the opt-in will expire and no longer be usable, unless renewed.
Just before this expiration, the user will have the option to renew this topic opt-in. When the user makes a choice, a new webhook with a new OptIn Response will be sent.

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"
}

SMS

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.

SMS limitations

SMS length

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).

Character support

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:
çÇáéíóúýÁÉÍÓÚÝàèìòùÀÈÌÒÙãõñäëïöüÿÄËÏÖÜÃÕÑâêîôûÂÊÎÔÛºª°|

Encoding selection

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.

Concatenated SMS

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:

  • Longer messages means more cost, because they actually are multiple messages.
  • To identify each piece of the message, some bytes are used as a header in this feature, so each message piece is shorter than a single short message:
    • Up to 152 characters in the standard encoding and up to 66 characters in the unicode encoding.
    • The cut point currently is always a space, so some pieces might be smaller than this.
    • Combine the previous limitations, and words longer than the maximum characters in a message piece are not supported (152 characters in the standard encoding and 66 characters in the unicode encoding).
  • Not all carriers support this feature. The bigest carriers support it, namely: Vivo, Claro, Tim and Oi.
  • Double spaces and tabs will always be replaced by a single space.
  • To send long messages, it might be necessary to contact our service team and request that this feature be enabled on your account.
  • The maximum length currently supported is 1520 characters.

SMS sender and recipient

When you send a message to a contact using SMS channel:

  • Recipient: the complete phone number (including country code) of the contact.
  • Sender: the SMS account alias connected on Zenvia platform.

When you receive a message from a contact, the sender and recipient are inverted:

  • Recipient: the SMS account alias connected on Zenvia platform.
  • Sender: the complete phone number (including country code) of the contact.

The sender goes in the attribute from and the receiver goes in the attribute to of message object.

Send a SMS message

Send a SMS message

Authorizations:
JWTTOKEN
Request Body schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

required
Array of objects (Message Contents) non-empty

A list of content to be sent

object (Conversation Content)

Responses

Response Schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

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)

Request samples

Content type
application/json
Example
{
  • "externalId": "my-campaign-name",
  • "from": "sms-account",
  • "to": "55108888888888",
  • "contents": [
    • {
      • "type": "text",
      • "text": "Hi Zenvia!"
      }
    ]
}

Response samples

Content type
application/json
{
  • "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"
    }
}

WhatsApp

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.

WhatsApp limitations

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.


Supported content types and sizes:
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:
  • Only H.264 video codec and AAC audio codec is supported.
  • Only videos with a single audio stream are supported.
16 MB

*The size of the media file after encryption. The maximum file size for media that can be uploaded is 64MB.

WhatsApp sender and recipient

When you send a message to a contact using WhatsApp channel:

  • Recipient: the phone number of the contact
  • Sender: the WhatsApp sender id registered on Zenvia platform

When you receive a message from a contact, the sender and recipient are inverted:

  • Recipient: the WhatsApp sender id registered on Zenvia platform
  • Sender: the phone number of the contact

The sender goes in the attribute from and the receiver goes in the attribute to of message object.

Send a WhatsApp message

Send a WhatsApp message

Authorizations:
JWTTOKEN
Request Body schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

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.
Only applicable to WhatsApp channel.

contentRef
number
Default: 0

Index of the content in the message sent or received in the conversation channel to reference as a message reply.
If ommited, the index to reference will be 0 (the first content of the message).
Only applicable to WhatsApp channel.

object (Conversation Content)

Responses

Response Schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

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.
Only applicable to WhatsApp channel.

contentRef
number
Default: 0

Index of the content in the message sent or received in the conversation channel to reference as a message reply.
If ommited, the index to reference will be 0 (the first content of the message).
Only applicable to WhatsApp channel.

object (Conversation Content)

Request samples

Content type
application/json
Example
{
  • "externalId": "my-campaign-name",
  • "from": "5510999999999",
  • "to": "55108888888888",
  • "contents": [
    • {
      • "type": "text",
      • "text": "Hi Zenvia!"
      }
    ]
}

Response samples

Content type
application/json
{
  • "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"
    }
}

Instagram

The Instagram channel may be used after its activation on Zenvia Platform.

Get in touch with Zenvia consultants to connect your account.

Instagram limitations

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 response window is 24 hours, with the exception when a human agent is replying the contact, then the response window is increased to 7 days.

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

Instagram sender and recipient

When you receive a message from a contact from Instagram channel:

  • Recipient: your Instagram account id (not your account @)
  • Sender: the contact id on your account (not the contact @ and it will differ across accounts)

When you send a message to a contact, the sender and recipient are inverted:

  • Recipient: the contact id on your account (not the contact @ and it will differ across accounts)
  • Sender: your Instagram account id (not your account @)

The sender goes in the attribute from and the receiver goes in the attribute to of message object.

Send a Instagram message

Send a Instagram message

Authorizations:
JWTTOKEN
Request Body schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

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.
It is mainly meant to be used when a human agent is the message's sender.

Only applicable to Instagram, Google Business Messages and E-Mail channels.

object (Conversation Content)

Responses

Response Schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

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.
It is mainly meant to be used when a human agent is the message's sender.

Only applicable to Instagram, Google Business Messages and E-Mail channels.

object (Conversation Content)

Request samples

Content type
application/json
Example
{
  • "externalId": "my-campaign-name",
  • "from": "ig-account-id",
  • "to": "ig-contact-id",
  • "contents": [
    • {
      • "type": "text",
      • "text": "Hi Zenvia!"
      }
    ]
}

Response samples

Content type
application/json
{
  • "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"
    }
}

Facebook

The Facebook channel may be used after you connect a Facebook page on Zenvia platform.

Facebook limitations

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.

Facebook sender and recipient

When you receive a message from a contact from Facebook channel:

  • Recipient: your Facebook page id
  • Sender: the contact id on your Facebook page (PSID - page scoped id)

When you send some message to a contact, the sender and recipient are inverted:

  • Recipient: the contact id on your Facebook page (PSID - page scoped id)
  • Sender: your Facebook page id

The sender goes in the attribute from and the receiver goes in the attribute to of message object.

Send a Facebook message

Send a Facebook message

Authorizations:
JWTTOKEN
Request Body schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

required
Array of objects (Message Contents) non-empty

A list of content to be sent

object (Conversation Content)

Responses

Response Schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

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)

Request samples

Content type
application/json
Example
{
  • "externalId": "my-campaign-name",
  • "from": "fb-page-id",
  • "to": "fb-contact-id",
  • "contents": [
    • {
      • "type": "text",
      • "text": "Hi Zenvia!"
      }
    ]
}

Response samples

Content type
application/json
{
  • "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"
    }
}

RCS

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.

Introduction to RCS messaging

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:

RCS messaging diagram

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.

RCS limitations

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.

RCS sender and recipient

When you send a message to a contact using RCS channel:

  • Recipient: the phone number of the contact
  • Sender: the agent id configured on Zenvia platform

When you receive a message from a contact, the sender and recipient are inverted:

  • Recipient: the agent id configured on Zenvia platform
  • Sender: the phone number of the contact

The sender goes in the attribute from and the receiver goes in the attribute to of message object.

RCS features

RCS Verfied Senders

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 Verified Badge example

RCS Events Receipts

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.

RCS Suggested Actions and Suggested Replies

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.

RCS Suggested Actions and Suggested Replies

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.

RCS Rich Cards

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.

RCS Rich Cards

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.

RCS Carousel

Send a RCS message

Send a RCS message

Authorizations:
JWTTOKEN
Request Body schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

required
Array of objects (Message Contents) non-empty

A list of content to be sent

object (Conversation Content)

Responses

Response Schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

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)

Request samples

Content type
application/json
Example
{
  • "externalId": "my-campaign-name",
  • "from": "rcs-agent-id",
  • "to": "55108888888888",
  • "contents": [
    • {
      • "type": "text",
      • "text": "Hi Zenvia!"
      }
    ]
}

Response samples

Content type
application/json
{
  • "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"
    }
}

Telegram

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.

Telegram limitations

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

Telegram sender and recipient

When you receive a message from a contact from Telegram channel:

  • Recipient: the Telegram bot username enabled on Zenvia platform://app.zenvia.com/home/credentials/telegram/list)
  • Sender: the conversation id (not the phone number)

When you send a message to a contact, the sender and recipient are inverted:

  • Recipient: the conversation id (not the phone number)
  • Sender: the Telegram bot username enabled on Zenvia platform://app.zenvia.com/home/credentials/telegram/list)

The sender goes in the attribute from and the receiver goes in the attribute to of message object.

Send a Telegram message

Send a Telegram message

Authorizations:
JWTTOKEN
Request Body schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

required
Array of objects (Message Contents) non-empty

A list of content to be sent

object (Conversation Content)

Responses

Response Schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

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)

Request samples

Content type
application/json
Example
{
  • "externalId": "my-campaign-name",
  • "from": "YourBot",
  • "to": "tg-chat-id",
  • "contents": [
    • {
      • "type": "text",
      • "text": "Hi Zenvia!"
      }
    ]
}

Response samples

Content type
application/json
{
  • "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"
    }
}

Google Business Messages

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.

Google Business Messages limitations

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.

Google Business Messages sender and recipient

When you receive a message from a contact from Google Business Messages channel:

  • Sender: the agent id configured on Zenvia platform
  • Recipient: the contact id

When you send a message to a contact, the sender and recipient are inverted:

  • Recipient: the contact id
  • Sender: the agent id configured on Zenvia platform

The sender goes in the attribute from and the receiver goes in the attribute to of message object.

Send a Google Business Messages message

Send a Google Business Messages message

Authorizations:
JWTTOKEN
Request Body schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

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.
It is mainly meant to be used when a human agent is the message's sender.

Only applicable to Instagram, Google Business Messages and E-Mail channels.

object (Conversation Content)

Responses

Response Schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

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.
It is mainly meant to be used when a human agent is the message's sender.

Only applicable to Instagram, Google Business Messages and E-Mail channels.

object (Conversation Content)

Request samples

Content type
application/json
Example
{
  • "externalId": "my-campaign-name",
  • "from": "gbm-agent-id",
  • "to": "gbm-contact-id",
  • "contents": [
    • {
      • "type": "text",
      • "text": "Hi Zenvia!"
      }
    ],
  • "representative": {}
}

Response samples

Content type
application/json
{
  • "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": {},
  • "conversation": {
    • "solution": "conversion"
    }
}

Voice

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.

Voice limitations

Supported content types and sizes:

Media Content Type Size
audio audio/mp3
audio/wav
5 MB

Voice sender and recipient

When you send a voice message to a contact using Voice channel:

  • Recipient: the phone number of the contact
  • Sender: the sender id registered on Zenvia platform

When you receive a voice message from a contact, the sender and recipient are inverted:

  • Recipient: the sender id registered on Zenvia platform
  • Sender: the phone number of the contact

The sender goes in the attribute from and the receiver goes in the attribute to of the message object.

Send a Voice message

Send a Voice message

Authorizations:
JWTTOKEN
Request Body schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

required
Array of objects (Message Contents) non-empty

A list of content to be sent

Responses

Response Schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

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.

Request samples

Content type
application/json
Example
{
  • "from": "sender-id",
  • "to": "55108888888888",
  • "contents": [
    • {
      • "type": "call",
      • "audio": [
        • {
          • "type": "tts",
          • "text": "Hi Zenvia!",
          • "voiceStyle": "br-Vitoria",
          • "awaitRecipientAnswer": true
          }
        ]
      }
    ],
  • "recordAudio": true,
  • "hangUpOnVoiceMail": true
}

Response samples

Content type
application/json
{
  • "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"
}

E-Mail

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.

E-Mail limitations

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


Supported content types and sizes:
Media Content Type E-Mail Size*
document Any valid MIME type. 25 MB

*The maximum size is for the entire e-mail.

E-Mail sender and recipient

When you send a message to a contact using E-Mail channel:

  • Recipient: the e-mail address of the contact.
  • Sender: the e-mail address connected on Zenvia platform.

When you receive a message from a contact, the sender and recipient are inverted:

  • Recipient: the e-mail address connected on Zenvia platform.
  • Sender: the e-mail address of the contact.

The sender goes in the attribute from and the receiver goes in the attribute to of message object.

Send a E-Mail message

Send a E-Mail message

Authorizations:
JWTTOKEN
Request Body schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

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.
It is mainly meant to be used when a human agent is the message's sender.

Only applicable to Instagram, Google Business Messages and E-Mail channels.

object (Conversation Content)

Responses

Response Schema: application/json
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.
More details on the channel's sender and recipient section.

to
required
string (Recipient ID) [ 1 .. 64 ] characters

The identifier of the recipient (varies according to the channel) of the message.
More details on the channel's sender and recipient section.

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.
It is mainly meant to be used when a human agent is the message's sender.

Only applicable to Instagram, Google Business Messages and E-Mail channels.

object (Conversation Content)

Request samples

Content type
application/json
Example
{
  • "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"
    }
}

Response samples

Content type
application/json
{
  • "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"
    }
}

Message Batches

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 WhatsApp RCS Basic E-mail
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.

What you need to know about the contacts file

  • The file must be in .csv format;
  • The maximum file size is 50MB;
  • The mandatory delimiter to be used between the values ​​is the semicolon (";");
  • The first line of the file is dedicated to the header. There must be a column that contains the recipients' phone numbers. If your content has variables, there must be corresponding columns.

Create batch

Create batch

Authorizations:
JWTTOKEN
Request Body schema: multipart/form-data
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

Responses

Response Schema: application/json
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

Request samples

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'

Response samples

Content type
application/json
Example
{
  • "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

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.

Token Configuration

Before sending tokens, you need to configure the token settings. This includes:

  • Token size
  • Number of verifications
  • Token type (numeric, alphanumeric)
  • And more

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.

Token Verification

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:

  • SMS
  • Email

How it Works

Here's how our 2FA service works:

  1. The user requests a token and we generate a unique token for them.
  2. Upon verification of said token we ensure that the generated one and the incoming one match, and only then we allow access to your system.

Create a configuration

Create a configuration

Authorizations:
JWTTOKEN
Request Body schema: application/json
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

Responses

Response Headers
Location
Response Schema: application/json
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

Request samples

Content type
application/json
{
  • "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"
      ]
    }
}

Response samples

Content type
application/json
{
  • "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

List all configurations

Authorizations:
JWTTOKEN
query Parameters
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

Responses

Response Schema: application/json
Array
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

Response samples

Content type
application/json
[
  • {
    • "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

List a configuration by id

Authorizations:
JWTTOKEN
path Parameters
configurationId
required
string

The configuration identifier

Responses

Response Schema: application/json
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

Response samples

Content type
application/json
{
  • "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

Delete a configuration by configuration id

Authorizations:
JWTTOKEN
path Parameters
configurationId
required
string

The configuration identifier

Responses

Response samples

Content type
application/json
{
  • "code": "VALIDATION_ERROR",
  • "message": "Validation error",
  • "details": [
    • {
      • "code": "string",
      • "path": "string",
      • "message": "string"
      }
    ]
}

Patch configuration

Patch configuration

Authorizations:
JWTTOKEN
path Parameters
configurationId
required
string

The configuration identifier

Request Body schema: application/json
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

Responses

Response Schema: application/json
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

Request samples

Content type
application/json
{
  • "op": "replace",
  • "path": "/token",
  • "value": {
    • "size": 6,
    • "mode": "NUMBER",
    • "case": "UPPER_ONLY"
    }
}

Response samples

Content type
application/json
{
  • "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

Recreate websitekey

Authorizations:
JWTTOKEN
path Parameters
configurationId
required
string

The configuration identifier

Responses

Response Schema: application/json
websiteKey
string

The platform generates a key that the client's frontend must use to identify itself

Response samples

Content type
application/json
{
  • "websiteKey": "XXXXXXXXXXXXXX"
}

Send token

Send token

Authorizations:
JWTTOKEN
Request Body schema: application/json
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

Responses

Response Schema: application/json
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

Request samples

Content type
application/json
{
  • "configurationId": "0f25c816-478d-4729-a600-b6b0124b4b9e",
  • "to": "5511999999999",
  • "channel": "sms",
  • "locale": "pt_br",
  • "fields": {
    • "name": "Josh Doe"
    }
}

Response samples

Content type
application/json
{
  • "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

Resend token

Authorizations:
JWTTOKEN
Request Body schema: application/json
to
required
string

User recipient

channel
required
string

Channel used to send the token

Responses

Request samples

Content type
application/json
{
  • "to": "email@email.com",
  • "channel": "email"
}

Response samples

Content type
application/json
{
  • "code": "VALIDATION_ERROR",
  • "message": "Validation error",
  • "details": [
    • {
      • "code": "string",
      • "path": "string",
      • "message": "string"
      }
    ]
}

Verify token

Verify token

Authorizations:
JWTTOKEN
Request Body schema: application/json
to
required
string

User recipient

channel
required
string

Channel used

code
required
string

Code sent by the user

Responses

Response Schema: application/json
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

Request samples

Content type
application/json
{
  • "to": "email@email.com",
  • "channel": "email",
  • "code": "269878"
}

Response samples

Content type
application/json
{
  • "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

Resend the token by token id

Authorizations:
JWTTOKEN
path Parameters
tokenId
required
string

The token identifier

Responses

Response samples

Content type
application/json
{
  • "code": "VALIDATION_ERROR",
  • "message": "Validation error",
  • "details": [
    • {
      • "code": "string",
      • "path": "string",
      • "message": "string"
      }
    ]
}

Verify a token by token id

Verify a token by token id

Authorizations:
JWTTOKEN
path Parameters
tokenId
required
string

The token identifier

Request Body schema: application/json
code
string

Code sent by the user

Responses

Response Schema: application/json
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

Request samples

Content type
application/json
{
  • "code": "269878"
}

Response samples

Content type
application/json
{
  • "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

Webhooks allow you to receive events in the configured URL. The available type of events are MESSAGE and MESSAGE_STATUS.

MESSAGE

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)

Note: The OUT direction is under construction.

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"
    }
}

MESSAGE_STATUS

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": {}
      }
    }
}

Code field

The code field may assume the following values:

  • SENT: the message sent by your business was received by the provider's server
  • REJECTED: the message sent by your business has failed to be sent to the provider's server
  • DELIVERED: the message sent by your business was delivered to the user's device
  • NOT_DELIVERED: the message sent by your business failed to be sent to the user's device. The reason for the failure will be included in the causes field.
  • READ: the message sent by your business was read by the user. This status might not be sent, since it depends on the channel and the user's device configuration.
  • DELETED: the message sent by the user was deleted by the user. Support varies according to the channel.
  • CLICKED: an action item (like a link or a dial action) in the message has been clicked by the user. The payload of item clicked will be included in the causes field. Support varies according to the channel.
  • VERIFIED: The message sent by your business was delivered, and the device app acknowledged the sender as verified. Support varies according to the channel.

Description field

The description field is directly tied to the code field, and it may assume the following values:

  • SENT: "The message has been forwarded to the provider".
  • DELIVERED: "The message has been delivered by the provider".
  • READ: "The message has been read by the recipient".
  • REJECTED: "The message was rejected by the provider".
  • NOT_DELIVERED: "The provider was unable to deliver the message".
  • DELETED: "The message has been deleted by the contact".
  • CLICKED: "An action item in the message has been clicked by the contact".
  • VERIFIED: "The message has been verified by the device app/provider".

Zenvia outbound IP addresses

Webhook notifications sent from Zenvia come from any of the following ranges of IP addresses:

  • 45.233.20.0/24
  • 45.233.22.0/24
  • 45.233.23.0/24
  • 3.233.231.228/32

Subscription creation limit

Currently it is possible to create up to two subscriptions with the same criteria (Event Type and Channel).

Webhook request error handling

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

  • There will be at least 30 seconds between each request attempt for the same event
  • There will be at most 30 request attempts for the same event

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.

Webhook (quality) status handling

Multiple errors on a single webhook may change its (quality) status. The possible webhook statuses are:

  • ACTIVE: the initial status for every webhook created
  • DEGRADED: once some criteria are met, an ACTIVE webhook will be demoted to DEGRADED.
    Event requests for DEGRADED webhooks are handled separately from ACTIVE webhooks.
    This ensures that high-quality webhooks are not penalized by the handling of low-quality webhooks.
  • INACTIVE: once some other criteria are, a DEGRADED webhook will be demoted to INACTIVE. Events no longer will be posted on webhooks with an INACTIVE status.

The criteria which trigger status changes consist of the following:

  • 10 consecutive request fails on an ACTIVE webhook will result in demotion to DEGRADED
  • 500 consecutive request fails will result in demotion to INACTIVE.
    • Responses slower than 1 second also count as a fail and may result in status demotion
      • Only slow responses on the initial request count as a fail
      • Only slow responses on an ACTIVE webhook count as a fail.
        Therefore, slow responses should never result in demotion to INACTIVE.
    • All connection timeouts count as fail and may result in status demotion.
      The connection timeout is 8 seconds.
    • All response (read) timeouts count as a fail and may result in status demotion.
      The response timeout is 8 seconds.
  • 50 consecutive successful requests on a DEGRADED webhook are necessary for promotion back to ACTIVE
    • Successful requests on retry attempts also count toward status promotion
    • Responses slower than 1 second do not count either as a success or as a fail
  • Any manual update done to the webhook URL on the API console will automatically promote a DEGRADED webhook back to ACTIVE.

Both the success and fail counters automatically reset themselves 8 hours after the first increment.

Webhook supported channels

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 Facebook WhatsApp RCS Voice Telegram GBM* Instagram E-Mail
text
file
contacts
location
email
product_list_order
optin_response

*GBM stands for Google Business Messages

Create a new webhook

Create a new webhook

Authorizations:
JWTTOKEN
Request Body schema: application/json
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

Responses

Response Schema: application/json
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

Callbacks

Request samples

Content type
application/json
Example
{
  • "eventType": "MESSAGE",
  • "webhook": {
    • "url": "string",
    • "headers": { }
    },
  • "status": "ACTIVE",
  • "version": "v1",
  • "criteria": {
    • "channel": "string",
    • "direction": "IN"
    }
}

Response samples

Content type
application/json
Example
{
  • "id": "string",
  • "eventType": "MESSAGE",
  • "webhook": {
    • "url": "string",
    • "headers": { }
    },
  • "status": "ACTIVE",
  • "version": "v1",
  • "createdAt": "string",
  • "updatedAt": "string",
  • "criteria": {
    • "channel": "string",
    • "direction": "IN"
    }
}

Callback payload samples

Callback
POST: {$request.body#/webhook/url}
Content type
application/json
Example
{
  • "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

List all webhooks

Authorizations:
JWTTOKEN

Responses

Response Schema: application/json
Array
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

Response samples

Content type
application/json
[
  • {
    • "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

Retrieve one webhook by id

Authorizations:
JWTTOKEN
path Parameters
subscriptionId
required
string

The subscription identifier

Responses

Response Schema: application/json
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

Response samples

Content type
application/json
Example
{
  • "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

Delete one webhook by id

Authorizations:
JWTTOKEN
path Parameters
subscriptionId
required
string

The subscription identifier

Responses

Response samples

Content type
application/json
{
  • "code": "VALIDATION_ERROR",
  • "message": "Validation error",
  • "details": [
    • {
      • "code": "string",
      • "path": "string",
      • "message": "string"
      }
    ]
}

Update one webhook by id

Update one webhook by id

Authorizations:
JWTTOKEN
path Parameters
subscriptionId
required
string

The subscription identifier

Request Body schema: application/json
object (subscription.webhook)
status
string (Status of subscription)
Enum: "ACTIVE" "INACTIVE"

Responses

Response Schema: application/json
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

Request samples

Content type
application/json
{
  • "webhook": {
    • "url": "string",
    • "headers": { }
    },
  • "status": "ACTIVE"
}

Response samples

Content type
application/json
Example
{
  • "id": "string",
  • "eventType": "MESSAGE",
  • "webhook": {
    • "url": "string",
    • "headers": { }
    },
  • "status": "ACTIVE",
  • "version": "v1",
  • "createdAt": "string",
  • "updatedAt": "string",
  • "criteria": {
    • "channel": "string",
    • "direction": "IN"
    }
}

Templates

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:

  • Header
  • Body
  • Footer
  • Buttons
  • OTP
  • Carousel

The components object allows you to indicate the type of message and the message's parameters.

Standard message templates

The standard message templates allows you to send plain text-only messages using a body components object.

Media message templates

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

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.

ACTIONS

Allows your customer to visit a website, call a phone number or send a product catalog.

QUICK REPLIES

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.

MIXED

Allows that in RCS messages you can mix buttons like ACTIONS and QUICK REPLIES.

E-Mail templates

E-mail templates allows sending content up to 30MB to multiple contacts using a small payload.

Email templates have the following components:

  • Header
  • Body
  • Attachments
  • Email

Create a new template

Create a new template

Authorizations:
JWTTOKEN
Request Body schema: application/json
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.
In case you are creating a template with media, the key must be imageUrl, documentUrl or videoUrl, being assigned the example URL.
This field is mandatory only for the WhatsApp channel, in this channel each example must have the same name as each existing variable and it must not be composed of empty spaces only.

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

Responses

Response Schema: application/json
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.
In case you are creating a template with media, the key must be imageUrl, documentUrl or videoUrl, being assigned the example URL.
This field is mandatory only for the WhatsApp channel, in this channel each example must have the same name as each existing variable and it must not be composed of empty spaces only.

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

Request samples

Content type
application/json
Example
{
  • "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",
  • "examples": {},
  • "senderId": "string",
  • "metadata": {
    • "property1": "Zenvia",
    • "property2": "Zenvia"
    },
  • "notificationEmail": "string"
}

Response samples

Content type
application/json
Example
{
  • "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",
  • "examples": {},
  • "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

List all templates

Authorizations:
JWTTOKEN
query Parameters
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.

Responses

Response Headers
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.

Response Schema: application/json
Array
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.
In case you are creating a template with media, the key must be imageUrl, documentUrl or videoUrl, being assigned the example URL.
This field is mandatory only for the WhatsApp channel, in this channel each example must have the same name as each existing variable and it must not be composed of empty spaces only.

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

Response samples

Content type
application/json
[
  • {
    • "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",
    • "examples": {},
    • "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

Retrieve one template by id

Authorizations:
JWTTOKEN
path Parameters
templateId
required

Responses

Response Schema: application/json
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.
In case you are creating a template with media, the key must be imageUrl, documentUrl or videoUrl, being assigned the example URL.
This field is mandatory only for the WhatsApp channel, in this channel each example must have the same name as each existing variable and it must not be composed of empty spaces only.

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

Response samples

Content type
application/json
Example
{
  • "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",
  • "examples": {},
  • "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

Delete one template by id

Authorizations:
JWTTOKEN
path Parameters
templateId
required

Responses

Response samples

Content type
application/json
{
  • "code": "VALIDATION_ERROR",
  • "message": "Validation error",
  • "details": [
    • {
      • "code": "string",
      • "path": "string",
      • "message": "string"
      }
    ]
}

Update one template by id

Update one template by id

Authorizations:
JWTTOKEN
path Parameters
templateId
required
Request Body schema: application/json
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.
In case you are creating a template with media, the key must be imageUrl, documentUrl or videoUrl, being assigned the example URL.
This field is mandatory only for the WhatsApp channel, in this channel each example must have the same name as each existing variable and it must not be composed of empty spaces only.

notificationEmail
string (Notification e-mail)

E-mail list (comma-separated) to send notifications about the message template approving process

Responses

Response Schema: application/json
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.
In case you are creating a template with media, the key must be imageUrl, documentUrl or videoUrl, being assigned the example URL.
This field is mandatory only for the WhatsApp channel, in this channel each example must have the same name as each existing variable and it must not be composed of empty spaces only.

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

Request samples

Content type
application/json
{
  • "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"
        }
      }
    },
  • "examples": {},
  • "notificationEmail": "string"
}

Response samples

Content type
application/json
Example
{
  • "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",
  • "examples": {},
  • "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

Create a new comment

Authorizations:
JWTTOKEN
path Parameters
templateId
required
Request Body schema: application/json
author
required
string (Author)

Author

role
required
string (Role)
Enum: "REQUESTER" "REVIEWER" "WHATSAPP"

Author role

text
required
string (Text)

Comment text

Responses

Response Schema: application/json
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

Request samples

Content type
application/json
{
  • "author": "string",
  • "role": "REQUESTER",
  • "text": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "author": "string",
  • "role": "REQUESTER",
  • "text": "string",
  • "createdAt": "string",
  • "updatedAt": "string"
}

List all comments

List all comments

Authorizations:
JWTTOKEN
path Parameters
templateId
required

Responses

Response Schema: application/json
Array
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

Response samples

Content type
application/json
[
  • {
    • "id": "string",
    • "author": "string",
    • "role": "REQUESTER",
    • "text": "string",
    • "createdAt": "string",
    • "updatedAt": "string"
    }
]

Delete comment by id

Delete comment by id

Authorizations:
JWTTOKEN
path Parameters
templateId
required
templateCommentId
required
string

The comment identifier

Responses

Response samples

Content type
application/json
{
  • "code": "VALIDATION_ERROR",
  • "message": "Validation error",
  • "details": [
    • {
      • "code": "string",
      • "path": "string",
      • "message": "string"
      }
    ]
}

Files

This allows the storage files for later use elsewhere, usually for sending messages.

Create a new file

Allows the storage of files for later use.

Authorizations:
JWTTOKEN
Request Body schema:
content
required
string (Binary File)

Binary file content to be stored.

object (File object)

This is a file object model.

Responses

Response Headers
Location
string

The URL for created file object.

Response Schema: application/json
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.

Request samples

Content type

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--

Response samples

Content type
application/json
{}

List files

Lists all files available

Authorizations:
JWTTOKEN
query Parameters
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.

Responses

Response Headers
x-total
string
Example: "100"

The total number of results available.

Response Schema: application/json
Array
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.

Response samples

Content type
application/json
[]

Retrieve one file by id

Allows to retrieve information about one previously stored file.

Authorizations:
JWTTOKEN
path Parameters
fileId
required
string

The file identifier

Responses

Response Schema: application/json
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.

Response samples

Content type
application/json
{}

Delete file by id

Allows to delete one previously stored file.

Authorizations:
JWTTOKEN
path Parameters
fileId
required
string

The file identifier

Responses

Response samples

Content type
application/json
{
  • "code": "VALIDATION_ERROR",
  • "message": "Validation error",
  • "details": [
    • {
      • "code": "string",
      • "path": "string",
      • "message": "string"
      }
    ]
}

Flow Batches

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

Create a flow batch

Authorizations:
JWTTOKEN
Request Body schema:
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

Responses

Response Schema: application/json
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:
LOADING: Loading the batch
READY: Batch loaded and ready to be dispatched
QUEUED: Batch sent to dispatch queue
PROCESSING: Batch dispatch in progress
WAITING: Waiting confirmation of the batch status
COMPLETED: Batch completed
CANCELING: Batch being canceled
CANCELED: Batch canceled
TIMEOUT: Timeout to process the batch
ERROR: Error to proceed with the batch

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

Request samples

Content type
{
  • "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"
      ]
    }
}

Response samples

Content type
application/json
{
  • "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

Get list of flow-batches

Authorizations:
JWTTOKEN
query Parameters
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.

Responses

Response Headers
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.

Response Schema: application/json
Array
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:
LOADING: Loading the batch
READY: Batch loaded and ready to be dispatched
QUEUED: Batch sent to dispatch queue
PROCESSING: Batch dispatch in progress
WAITING: Waiting confirmation of the batch status
COMPLETED: Batch completed
CANCELING: Batch being canceled
CANCELED: Batch canceled
TIMEOUT: Timeout to process the batch
ERROR: Error to proceed with the batch

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

Response samples

Content type
application/json
[
  • {
    • "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

Retrieve one batch by id

Authorizations:
JWTTOKEN
path Parameters
flowBatchId
required
string
Example: b5agf1-y237-11e8-b127-1230f6c2d98m

Flow Batch identifier

Responses

Response Schema: application/json
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:
LOADING: Loading the batch
READY: Batch loaded and ready to be dispatched
QUEUED: Batch sent to dispatch queue
PROCESSING: Batch dispatch in progress
WAITING: Waiting confirmation of the batch status
COMPLETED: Batch completed
CANCELING: Batch being canceled
CANCELED: Batch canceled
TIMEOUT: Timeout to process the batch
ERROR: Error to proceed with the batch

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

Response samples

Content type
application/json
{
  • "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

Cancel a flow batch

Authorizations:
JWTTOKEN
path Parameters
flowBatchId
required
string
Example: b5agf1-y237-11e8-b127-1230f6c2d98m

Flow Batch identifier

Responses

Response samples

Content type
application/json
{
  • "code": "VALIDATION_ERROR",
  • "message": "Validation error",
  • "details": [
    • {
      • "code": "string",
      • "path": "string",
      • "message": "string"
      }
    ]
}

Pause a flow batch

Pause a flow batch

Authorizations:
JWTTOKEN
path Parameters
flowBatchId
required
string
Example: b5agf1-y237-11e8-b127-1230f6c2d98m

Flow Batch identifier

Responses

Response samples

Content type
application/json
{
  • "code": "VALIDATION_ERROR",
  • "message": "Validation error",
  • "details": [
    • {
      • "code": "string",
      • "path": "string",
      • "message": "string"
      }
    ]
}

Resume a flow batch

Resume a flow batch

Authorizations:
JWTTOKEN
path Parameters
flowBatchId
required
string
Example: b5agf1-y237-11e8-b127-1230f6c2d98m

Flow Batch identifier

Responses

Response samples

Content type
application/json
{
  • "code": "VALIDATION_ERROR",
  • "message": "Validation error",
  • "details": [
    • {
      • "code": "string",
      • "path": "string",
      • "message": "string"
      }
    ]
}

Chatbot Outbound

Send outbound message to Chatbot

Send outbound message to Chatbot

Authorizations:
JWTTOKEN
Request Body schema: application/json
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 "inactivityTime": 2, the message would not be sent. If the interaction had occurred 3 minutes ago, the message would be sent.

Responses

Response Schema: application/json
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 "inactivityTime": 2, the message would not be sent. If the interaction had occurred 3 minutes ago, the message would be sent.

Request samples

Content type
application/json
{
  • "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
}

Response samples

Content type
application/json
{
  • "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
}

Contacts

Create a new contact

Allows the creation of contacts.

Authorizations:
JWTTOKEN
Request Body schema: application/json
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.

Responses

Response Schema: application/json
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.

Request samples

Content type
application/json
{
  • "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"
    ]
}

Response samples

Content type
application/json
{
  • "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"
}

List contacts

Lists all contacts available

Authorizations:
JWTTOKEN
query Parameters
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.

Responses

Response Headers
x-total
string
Example: "100"

The total number of results available.

Response Schema: application/json
Array
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.

Response samples

Content type
application/json
[
  • {
    • "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"
    }
]

Retrieve one contact by id

Allows to retrieve a contact's information.

Authorizations:
JWTTOKEN
path Parameters
contactId
required
string

The contact identifier

Responses

Response Schema: application/json
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.

Response samples

Content type
application/json
{
  • "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"
}

Update one contact by id

Allows to update a contact's information.

Authorizations:
JWTTOKEN
path Parameters
contactId
required
string

The contact identifier

Request Body schema: application/json
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.

Responses

Response Schema: application/json
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.

Request samples

Content type
application/json
{
  • "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"
    ]
}

Response samples

Content type
application/json
{
  • "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"
}

Delete one contact by id

Allows to delete a contact.

Authorizations:
JWTTOKEN
path Parameters
contactId
required
string

The contact identifier

Responses

Response samples

Content type
application/json
{
  • "code": "VALIDATION_ERROR",
  • "message": "Validation error",
  • "details": [
    • {
      • "code": "string",
      • "path": "string",
      • "message": "string"
      }
    ]
}

Contact Lists

Create a new contact list

Allows the creation of contact lists.

Authorizations:
JWTTOKEN
Request Body schema: application/json
name
required
string (Name)

Contact list's name.

Responses

Response Schema: application/json
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.

Request samples

Content type
application/json
{
  • "name": "Technology interest"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "Technology interest",
  • "size": 10,
  • "createdAt": "2022-05-23T19:37:59.000Z",
  • "updatedAt": "2022-05-23T19:37:59.000Z"
}

List contact lists

Lists all contact lists available.

Authorizations:
JWTTOKEN
query Parameters
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.

Responses

Response Headers
x-total
string
Example: "100"

The total number of results available.

Response Schema: application/json
Array
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.

Response samples

Content type
application/json
[
  • {
    • "id": "string",
    • "name": "Technology interest",
    • "size": 10,
    • "createdAt": "2022-05-23T19:37:59.000Z",
    • "updatedAt": "2022-05-23T19:37:59.000Z"
    }
]

Retrieve one contact list by id

Allows to retrieve a contact list's information.

Authorizations:
JWTTOKEN
path Parameters
listId
required
string

The contact list identifier

Responses

Response Schema: application/json
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.

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "Technology interest",
  • "size": 10,
  • "createdAt": "2022-05-23T19:37:59.000Z",
  • "updatedAt": "2022-05-23T19:37:59.000Z"
}

Update one contact list by id

Allows to update a contact list's information.

Authorizations:
JWTTOKEN
path Parameters
listId
required
string

The contact list identifier

Request Body schema: application/json
name
string (Name)

Contact list's name.

Responses

Response Schema: application/json
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.

Request samples

Content type
application/json
{
  • "name": "Technology interest"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "Technology interest",
  • "size": 10,
  • "createdAt": "2022-05-23T19:37:59.000Z",
  • "updatedAt": "2022-05-23T19:37:59.000Z"
}

Delete one contact list by id

Allows to delete a contact list. Only the list is deleted, not the contacts.

Authorizations:
JWTTOKEN
path Parameters
listId
required
string

The contact list identifier

Responses

Response samples

Content type
application/json
{
  • "code": "VALIDATION_ERROR",
  • "message": "Validation error",
  • "details": [
    • {
      • "code": "string",
      • "path": "string",
      • "message": "string"
      }
    ]
}

List the contacts in a list

Virtual collection to list the contacts in the list.

Authorizations:
JWTTOKEN
path Parameters
listId
required
string

The contact list identifier

query Parameters
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.

Responses

Response Headers
x-total
string
Example: "100"

The total number of results available.

Response Schema: application/json
Array
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.

Response samples

Content type
application/json
[
  • {
    • "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"
    }
]

Contact Custom Data Fields

Create a new contact custom data field

Allows the creation of custom data fields to be used in the contacts API.

Authorizations:
JWTTOKEN
Request Body schema: application/json
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.

Responses

Response Schema: application/json
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.

Request samples

Content type
application/json
{
  • "name": "My Field",
  • "type": "date"
}

Response samples

Content type
application/json
{
  • "id": "my_field",
  • "name": "My Field",
  • "type": "date",
  • "createdAt": "2022-05-23T19:37:59.000Z"
}

List contact data fields

Lists all contact custom data fields available.

Authorizations:
JWTTOKEN
query Parameters
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.

Responses

Response Headers
x-total
string
Example: "100"

The total number of results available.

Response Schema: application/json
Array
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.

Response samples

Content type
application/json
[
  • {
    • "id": "my_field",
    • "name": "My Field",
    • "type": "date",
    • "createdAt": "2022-05-23T19:37:59.000Z"
    }
]

Message Report

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

Retrieve all entries applying the given filters

Authorizations:
JWTTOKEN
query Parameters
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

Responses

Response Schema: application/json
Array
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.

Response samples

Content type
application/json
[
  • {
    • "channel": "string",
    • "type": "string",
    • "directionInTotal": 0,
    • "directionOutTotal": 0,
    • "total": 0
    }
]

Flow Report

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

Retrieve all entries applying the given filters

Authorizations:
JWTTOKEN
query Parameters
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.

Responses

Response Schema: application/json
Array
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

Response samples

Content type
application/json
[
  • {
    • "flowId": "string",
    • "dispatchId": "string",
    • "sessionId": "string",
    • "firstEventTimestamp": "string",
    • "lastEventTimestamp": "string",
    • "variables": { }
    }
]

Marketing Automations

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.

Dispatch a marketing automation

Allows the execution of a marketing automation

Authorizations:
JWTTOKEN
path Parameters
automationId
required
string

The marketing automation identifier

Request Body schema: application/json
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

Responses

Response Schema: application/json
id
string

The dispatch identifier

status
string

The dispatch status

marketingAutomationId
string

The marketing automation identifier

Request samples

Content type
application/json
{
  • "recipientChannels": {
    • "sms": "5511999999999",
    • "email": "email@email.com"
    },
  • "variables": {
    • "name": "John Doe",
    • "birthdate": "01/01/1979"
    }
}

Response samples

Content type
application/json
{
  • "id": "7388c68e-675e-435b-b2ec-f72677798678",
  • "status": "SENT",
  • "marketingAutomationId": "5c408dd6-a39a-4eb1-b3b0-bf6f2f34ea39"
}

Status Groups

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.

Check groups status

Allows monitoring of the status of Zenvia platforms and solutions.

Responses

Response Schema: application/json
Array
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.

Response samples

Content type
application/json
[
  • {
    • "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"
        }
      ]
    }
]

Check groups status by id

Allows monitoring of the status of a single Zenvia platform and solution.

path Parameters
componentId
required
string

The component of the status groups identifier

Responses

Response Schema: application/json
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.

Response samples

Content type
application/json
{
  • "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"
      }
    ]
}