openapi: 3.0.2
info:
  version: 2.0.0
  title: Zenvia APIs
  description: |
    API Support: https://atendimento.zenvia.com/<span class="link-content">[OpenAPI specification source](https://github.com/zenvia/zenvia-openapi-spec)</span>


    # 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](#section/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](https://app.zenvia.com/)
    * **Integrations**: configure desired channels to send and/or receive messages on the [integrations page](https://app.zenvia.com/home/credentials)
    * **API Token**: create an API token on the [API console](https://app.zenvia.com/home/api)
    * **Webhook**: subscribe to events using [subscriptions API resources](#tag/Subscriptions)
        * _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](#section/Getting-started-with-Sandbox) to start using and testing this API immediately.

    ## View your Usage Report
    You can also access Zenvia platform to view your [Usage Report](https://app.zenvia.com/notifications/dashboard/api)

    # Getting started with Sandbox

    The fastest way to begin utilizing this API is with our [Sandbox (available on the Zenvia platform)](https://app.zenvia.com/home/sandbox).

    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.](https://app.zenvia.com/home/sandbox)

    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](https://zenvia.github.io/zenvia-openapi-spec/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](https://zenvia.github.io/zenvia-openapi-spec/v1/).

    # SDKs

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

    These helper libraries are available on [Node](https://github.com/zenvia/zenvia-sdk-node) and [Java](https://github.com/zenvia/zenvia-sdk-java) programming languages and located on our [GitHub](https://github.com/zenvia) 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:

    <SchemaDefinition schemaRef="#/components/schemas/error.base" />

    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](https://app.zenvia.com/home/api) on Zenvia platform.

    ## Signature
    This is an advanced version of the [token authentication](#section/Authentication/Token).

    In this approach, alongside the `X-API-Token` http header, it is necessary to send a request signature.
    <br>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.
    <br>Both types of token can be created in the [API console](https://app.zenvia.com/home/api) on Zenvia platform.

    #### Example:
    ```
    X-API-Token: hKp94crjv9OF3UGrCpSXUJw1-UYHhRvLKNLt
    X-API-Signature: rtHTyAfsJFD5UFpPDeztUI3JE0Guea5pqG9iJqrT2EY=
    ```
    <br>

    ### 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](https://app.zenvia.com/home/api), 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.
    <br>*Ex: `POST`, `GET`.*

    2. The MD5 hash of the request body.
    <br>*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.
    <br>*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.
    <br>*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*.
    <br>*Ex: `api.zenvia.com`.*

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

    <br>

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

    <br>

    #### Signature generation example in NodeJS
    ```javascript
    const crypto = require('crypto');
    const axios = require('axios');

    const payload = JSON.stringify({
      from: 'sender',
      to: 'recipient',
      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/whatsapp/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,
    }

    const response = await axios.post('https://api.zenvia.com/v2/channels/whatsapp/messages', payload, { headers });

    console.log(response.data);
    ```

    ## JWT

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

    For server-to-server integrations use the [token authentication](#section/Authentication/Token) approach.
  termsOfService: 'https://zenvia.com/'
  contact:
    name: API Support
    url: 'https://devs.zenvia.com/'
  license:
    name: MIT
    url: 'https://raw.githubusercontent.com/zenvia/zenvia-openapi-spec/master/LICENSE.md'
  x-logo:
    url: 'https://zenvia-static.s3.amazonaws.com/brand/zenvia-brand-mark-regular.svg'
servers:
  - url: 'https://api.zenvia.com/v2'
paths:
  /2fa-configurations:
    post:
      description: Create a configuration
      tags:
        - Two Factor Authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/2fa.configuration.requests.all'
      responses:
        '201':
          description: Returns the created configuration
          headers:
            Location:
              description: 'Resource created: https://api.zenvia.com/v2/2fa-configurations/{configurationId}'
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/2fa.configuration.responses.token-created'
        default:
          $ref: '#/components/responses/error'
    get:
      description: List all configurations
      tags:
        - Two Factor Authentication
      parameters:
        - $ref: '#/components/parameters/page-legacy'
        - $ref: '#/components/parameters/limit'
      responses:
        '200':
          description: Return all token configurations.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/2fa.configuration.responses.base'
        default:
          $ref: '#/components/responses/error'
  '/2fa-configurations/{configurationId}':
    get:
      description: List a configuration by id
      tags:
        - Two Factor Authentication
      responses:
        '200':
          description: Return the specific configuration by id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/2fa.configuration.requests.all'
        default:
          $ref: '#/components/responses/error'
    delete:
      description: Delete a configuration by configuration id
      tags:
        - Two Factor Authentication
      responses:
        '204':
          description: No content
        default:
          $ref: '#/components/responses/error'
    patch:
      description: Patch configuration
      tags:
        - Two Factor Authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/2fa.configuration.requests.patch-config'
      responses:
        '200':
          description: Returns success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/2fa.configuration.responses.token-created'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/configurationId'
  '/2fa-configurations/{configurationId}/actions/website-key-recreate':
    post:
      description: Recreate websitekey
      tags:
        - Two Factor Authentication
      responses:
        '200':
          description: Returns success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/2fa.configuration.responses.websitekey-recreated'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/configurationId'
  /2fa-tokens:
    post:
      description: Send token
      tags:
        - Two Factor Authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/2fa.token.requests.token'
      responses:
        '200':
          description: Returns Information about the configuration status after sending a code to the user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/2fa.token.responses.token'
        default:
          $ref: '#/components/responses/error'
  /2fa-tokens/actions/resend:
    post:
      description: Resend token
      tags:
        - Two Factor Authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/2fa.token.requests.to-channel'
      responses:
        '204':
          description: No content
        default:
          $ref: '#/components/responses/error'
  /2fa-tokens/actions/verify:
    post:
      description: Verify token
      tags:
        - Two Factor Authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/2fa.token.requests.recipient'
      responses:
        '200':
          description: Returns information about the configuration status after verifying a code sent by the user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/2fa.token.responses.token-verified'
        default:
          $ref: '#/components/responses/error'
  '/2fa-tokens/{tokenId}/actions/resend':
    post:
      description: Resend the token by token id
      tags:
        - Two Factor Authentication
      responses:
        '204':
          description: No content
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/tokenId'
  '/2fa-tokens/{tokenId}/actions/verify':
    post:
      description: Verify a token by token id
      tags:
        - Two Factor Authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/2fa.token.requests.code'
      responses:
        '200':
          description: Returns information about the configuration status after verifying a code sent by the user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/2fa.token.responses.token-verified'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/tokenId'
  /message-batches:
    post:
      description: Create batch
      tags:
        - Message Batches
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                contacts:
                  type: string
                  title: Binary CSV File
                  description: Binary csv file with recipients and variable values when necessary.
                batch:
                  $ref: '#/components/schemas/batches.multipart-batch'
              required:
                - contacts
                - batch
      responses:
        '200':
          description: Created batch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/batches.multipart-batch'
        default:
          $ref: '#/components/responses/error'
      x-code-samples:
        - lang: Shell
          label: Bash
          source: |
            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'
  /channels/email/messages:
    post:
      description: Send a E-Mail message
      tags:
        - E-Mail
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/message.email'
            examples:
              email:
                value:
                  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:
                        - fileUrl: 'https://zenvia.com/example1.pdf'
                        - fileUrl: 'https://zenvia.com/example2.jpg'
                          fileName: example2.jpeg
                      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
              template:
                value:
                  from: sac@brand.domain
                  to: user@zenvia.com
                  contents:
                    - type: template
                      templateId: template_id
                      fields:
                        name: Jhon
                        product: Zenvia Chat
                  representative:
                    name: Sender Name
      responses:
        '200':
          description: Created message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/message.email'
        default:
          $ref: '#/components/responses/error'
  /channels/facebook/messages:
    post:
      description: Send a Facebook message
      tags:
        - Facebook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/message.facebook'
            examples:
              text:
                value:
                  externalId: my-campaign-name
                  from: fb-page-id
                  to: fb-contact-id
                  contents:
                    - type: text
                      text: Hi Zenvia!
              file:
                value:
                  from: fb-page-id
                  to: fb-contact-id
                  contents:
                    - type: file
                      fileUrl: 'https://zenvia.com/zenvia-team.png'
                      fileMimeType: image/png
                      fileCaption: 'Our pic :)'
                      fileName: team.png
              template:
                value:
                  from: fb-page-id
                  to: fb-contact-id
                  contents:
                    - type: template
                      templateId: template_id
                      fields:
                        name: Jhon
                        product: Zenvia Chat
              card:
                value:
                  from: fb-page-id
                  to: fb-contact-id
                  contents:
                    - type: card
                      title: Card from Zenvia
                      text: This is our products
                      media:
                        url: 'https://zenvia.com/zenvia-office.png'
                        disposition: ON_THE_TOP_MEDIUM_HEIGHT
                        caption: Our amazing office!
                      buttons:
                        - type: link
                          text: Site
                          url: 'https://www.zenvia.com/'
                      quickReplyButtons:
                        - type: text
                          text: Click here
                          payload: success
              carousel:
                value:
                  from: fb-page-id
                  to: fb-contact-id
                  contents:
                    - type: carousel
                      cardWidth: MEDIUM
                      cards:
                        - title: Card from Zenvia
                          text: This is our products
                          media:
                            url: 'https://zenvia.com/zenvia-office.png'
                            disposition: ON_THE_TOP_MEDIUM_HEIGHT
                            caption: Our amazing office!
                          buttons:
                            - type: link
                              text: Site
                              url: 'https://www.zenvia.com/'
                          quickReplyButtons:
                            - type: text
                              text: Click here
                              payload: success
              replyable_text:
                value:
                  from: fb-page-id
                  to: fb-contact-id
                  contents:
                    - type: replyable_text
                      text: Hi Zenvia!
                      quickReplyButtons:
                        - type: text
                          text: Click here
                          payload: success
              optin_request:
                value:
                  from: fb-page-id
                  to: fb-contact-id
                  contents:
                    - type: optin_request
                      mediaUrl: 'https://zenvia.com/zenvia-office.png'
                      title: Weekly Amazing Deals
                      frequency: WEEKLY
                      reOptIn: ENABLED
                      payload: weekly-deals
                      timezone: America/Sao_Paulo
      responses:
        '200':
          description: Created message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/message.facebook'
        default:
          $ref: '#/components/responses/error'
      x-code-samples:
        - lang: Shell
          label: Bash
          source: |
            curl "https://api.zenvia.com/v2/channels/facebook/messages" \
            -H "Content-Type: application/json" \
            -H "X-API-TOKEN: YOUR_API_TOKEN" \
            -d '{
              "from": "sender-identifier",
              "to": "recipient-identifier",
              "contents": [{
                "type": "text",
                "text": "Some text message"
              }]
            }'
        - lang: JavaScript
          label: Node.js
          source: |
            const { post } = require('request-promise');

            post({
              uri: 'https://api.zenvia.com/v2/channels/facebook/messages',
              headers: {
                'X-API-TOKEN': 'YOUR_API_TOKEN',
              },
              body: {
                from: 'sender-identifier',
                to: 'recipient-identifier',
                contents: [{
                  type: 'text',
                  text: 'Some text message',
                }],
              },
              json: true,
            })
            .then((response) => {
              console.log('Response:', response);
            })
            .catch((error) => {
              console.log('Error:', error);
            });
        - lang: JavaScript
          label: Node.js SDK
          source: |
            /**
             * Example: https://github.com/zenvia/zenvia-sdk-node/blob/master/examples/facebook-send-text-message.js
             */

            import { Client, TextContent } from '@zenvia/sdk';

            const client = new Client('YOUR_API_TOKEN');

            const facebook = client.getChannel('facebook');

            const content = new TextContent('Some text message');

            facebook.sendMessage('sender-identifier', 'recipient-identifier', content)
            .then((response) => {
              console.log('Response:', response);
            })
            .catch((error) => {
              console.log('Error:', error);
            });
        - lang: Java
          label: Java SDK
          source: |
            import com.zenvia.api.sdk.client.Channel;
            import com.zenvia.api.sdk.client.apache.Client;
            import com.zenvia.api.sdk.contents.TextContent;
            import com.zenvia.api.sdk.messages.Message;

            public class FacebookSendTextMessage {

              public static void main (String arg []) {
                Client client = new Client("YOUR_API_TOKEN");

                Channel facebook = client.getChannel("facebook");

                TextContent content = new TextContent("Some text message");

                try {
                  Message response = facebook.sendMessage("sender-identifier", "recipient-identifier", content);
                  System.out.println("Response: " + response.toString());
                } catch(Exception e) {
                  System.out.println("Error: " + e.getMessage());
                }
              }

            }
  /channels/gbm/messages:
    post:
      description: Send a Google Business Messages message
      tags:
        - Google Business Messages
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/message.gbm'
            examples:
              text:
                value:
                  externalId: my-campaign-name
                  from: gbm-agent-id
                  to: gbm-contact-id
                  contents:
                    - type: text
                      text: Hi Zenvia!
                  representative:
                    type: HUMAN
                    name: Agent Name
                    avatar: 'https://zenvia.com/favicon.ico'
              file:
                value:
                  from: gbm-agent-id
                  to: gbm-contact-id
                  contents:
                    - type: file
                      fileUrl: 'https://zenvia.com/zenvia-team.png'
                      fileMimeType: image/png
                      fileCaption: 'Our pic :)'
                      fileName: team.png
                  representative:
                    type: HUMAN
                    name: Agent Name
                    avatar: 'https://zenvia.com/favicon.ico'
              card:
                value:
                  from: gbm-agent-id
                  to: gbm-contact-id
                  contents:
                    - type: card
                      title: Card from Zenvia
                      text: This is our products
                      media:
                        url: 'https://zenvia.com/zenvia-office.png'
                        disposition: ON_THE_TOP_MEDIUM_HEIGHT
                        caption: Our amazing office!
                      buttons:
                        - type: link
                          text: Site
                          url: 'https://www.zenvia.com/'
                      quickReplyButtons:
                        - type: text
                          text: Click here
                          payload: success
                  representative:
                    type: HUMAN
                    name: Agent Name
                    avatar: 'https://zenvia.com/favicon.ico'
              carousel:
                value:
                  from: gbm-agent-id
                  to: gbm-contact-id
                  contents:
                    - type: carousel
                      cardWidth: MEDIUM
                      cards:
                        - title: Card from Zenvia
                          text: This is our products
                          media:
                            url: 'https://zenvia.com/zenvia-office.png'
                            disposition: ON_THE_TOP_MEDIUM_HEIGHT
                            caption: Our amazing office!
                          buttons:
                            - type: link
                              text: Site
                              url: 'https://www.zenvia.com/'
                          quickReplyButtons:
                            - type: text
                              text: Click here
                              payload: success
                  representative:
                    type: HUMAN
                    name: Agent Name
                    avatar: 'https://zenvia.com/favicon.ico'
              replyable_text:
                value:
                  from: gbm-agent-id
                  to: gbm-contact-id
                  contents:
                    - type: replyable_text
                      text: Hi Zenvia!
                      quickReplyButtons:
                        - type: text
                          text: Click here
                          payload: success
                  representative:
                    type: HUMAN
                    name: Agent Name
                    avatar: 'https://zenvia.com/favicon.ico'
      responses:
        '200':
          description: Created message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/message.gbm'
        default:
          $ref: '#/components/responses/error'
      x-code-samples:
        - lang: Shell
          label: Bash
          source: |
            curl "https://api.zenvia.com/v2/channels/gbm/messages" \
            -H "Content-Type: application/json" \
            -H "X-API-TOKEN: YOUR_API_TOKEN" \
            -d '{
              "from": "sender-identifier",
              "to": "recipient-identifier",
              "contents": [{
                "type": "text",
                "text": "Some text message"
              }]
            }'
        - lang: JavaScript
          label: Node.js
          source: |
            const { post } = require('request-promise');

            post({
              uri: 'https://api.zenvia.com/v2/channels/gbm/messages',
              headers: {
                'X-API-TOKEN': 'YOUR_API_TOKEN',
              },
              body: {
                from: 'sender-identifier',
                to: 'recipient-identifier',
                contents: [{
                  type: 'text',
                  text: 'Some text message',
                }],
              },
              json: true,
            })
            .then((response) => {
              console.log('Response:', response);
            })
            .catch((error) => {
              console.log('Error:', error);
            });
        - lang: JavaScript
          label: Node.js SDK
          source: |
            /**
             * Example: https://github.com/zenvia/zenvia-sdk-node/blob/master/examples/gbm-send-text-message.js
             */

            import { Client, TextContent } from '@zenvia/sdk';

            const client = new Client('YOUR_API_TOKEN');

            const gbm = client.getChannel('gbm');

            const content = new TextContent('Some text message');

            gbm.sendMessage('sender-identifier', 'recipient-identifier', content)
            .then((response) => {
              console.log('Response:', response);
            })
            .catch((error) => {
              console.log('Error:', error);
            });
        - lang: Java
          label: Java SDK
          source: |
            import com.zenvia.api.sdk.client.Channel;
            import com.zenvia.api.sdk.client.apache.Client;
            import com.zenvia.api.sdk.contents.TextContent;
            import com.zenvia.api.sdk.messages.Message;

            public class GBMSendTextMessage {

              public static void main (String arg []) {
                Client client = new Client("YOUR_API_TOKEN");

                Channel gbm = client.getChannel("gbm");

                TextContent content = new TextContent("Some text message");

                try {
                  Message response = gbm.sendMessage("sender-identifier", "recipient-identifier", content);
                  System.out.println("Response: " + response.toString());
                } catch(Exception e) {
                  System.out.println("Error: " + e.getMessage());
                }
              }

            }
  /channels/instagram/messages:
    post:
      description: Send a Instagram message
      tags:
        - Instagram
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/message.instagram'
            examples:
              text:
                value:
                  externalId: my-campaign-name
                  from: ig-account-id
                  to: ig-contact-id
                  contents:
                    - type: text
                      text: Hi Zenvia!
              file:
                value:
                  from: ig-account-id
                  to: ig-contact-id
                  contents:
                    - type: file
                      fileUrl: 'https://zenvia.com/zenvia-team.png'
                      fileMimeType: image/png
                      fileCaption: 'Our pic :)'
                      fileName: team.png
              replyable_text:
                value:
                  from: ig-account-id
                  to: ig-contact-id
                  contents:
                    - type: replyable_text
                      text: Hi Zenvia!
                      quickReplyButtons:
                        - type: text
                          text: Click here
                          payload: success
              card:
                value:
                  from: ig-account-id
                  to: ig-contact-id
                  contents:
                    - type: card
                      title: Card from Zenvia
                      text: This is our products
                      media:
                        url: 'https://zenvia.com/zenvia-office.png'
                        disposition: ON_THE_TOP_MEDIUM_HEIGHT
                        caption: Our amazing office!
                      buttons:
                        - type: link
                          text: Site
                          url: 'https://www.zenvia.com/'
                      quickReplyButtons:
                        - type: text
                          text: Click here
                          payload: success
              carousel:
                value:
                  from: ig-account-id
                  to: ig-contact-id
                  contents:
                    - type: carousel
                      cardWidth: MEDIUM
                      cards:
                        - title: Card from Zenvia
                          text: This is our products
                          media:
                            url: 'https://zenvia.com/zenvia-office.png'
                            disposition: ON_THE_TOP_MEDIUM_HEIGHT
                            caption: Our amazing office!
                          buttons:
                            - type: link
                              text: Site
                              url: 'https://www.zenvia.com/'
                          quickReplyButtons:
                            - type: text
                              text: Click here
                              payload: success
              optin_request:
                value:
                  from: ig-account-id
                  to: ig-contact-id
                  contents:
                    - type: optin_request
                      mediaUrl: 'https://zenvia.com/zenvia-office.png'
                      title: Weekly Amazing Deals
                      frequency: WEEKLY
                      reOptIn: ENABLED
                      payload: weekly-deals
                      timezone: America/Sao_Paulo
      responses:
        '200':
          description: Created message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/message.instagram'
        default:
          $ref: '#/components/responses/error'
  /channels/rcs/messages:
    post:
      description: Send a RCS message
      tags:
        - RCS
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/message.rcs'
            examples:
              text:
                value:
                  externalId: my-campaign-name
                  from: rcs-agent-id
                  to: '55108888888888'
                  contents:
                    - type: text
                      text: Hi Zenvia!
              template:
                value:
                  from: rcs-agent-id
                  to: '55108888888888'
                  contents:
                    - type: template
                      templateId: template_id
                      fields:
                        name: Jhon
                        product: Zenvia Chat
              file:
                value:
                  from: rcs-agent-id
                  to: '55108888888888'
                  contents:
                    - type: file
                      fileUrl: 'https://zenvia.com/zenvia-team.png'
                      fileMimeType: image/png
                      fileCaption: 'Our pic :)'
                      fileName: team.png
              card:
                value:
                  from: rcs-agent-id
                  to: '55108888888888'
                  contents:
                    - type: card
                      title: Card from Zenvia
                      text: This is our products
                      media:
                        url: 'https://zenvia.com/zenvia-office.png'
                        disposition: ON_THE_TOP_MEDIUM_HEIGHT
                        caption: Our amazing office!
                      buttons:
                        - type: link
                          text: Site
                          url: 'https://www.zenvia.com/'
                      quickReplyButtons:
                        - type: text
                          text: Click here
                          payload: success
              carousel:
                value:
                  from: rcs-agent-id
                  to: '55108888888888'
                  contents:
                    - type: carousel
                      cardWidth: MEDIUM
                      cards:
                        - title: Card from Zenvia
                          text: This is our products
                          media:
                            url: 'https://zenvia.com/zenvia-office.png'
                            disposition: ON_THE_TOP_MEDIUM_HEIGHT
                            caption: Our amazing office!
                          buttons:
                            - type: link
                              text: Site
                              url: 'https://www.zenvia.com/'
                          quickReplyButtons:
                            - type: text
                              text: Click here
                              payload: success
              replyable_text:
                value:
                  from: rcs-agent-id
                  to: '55108888888888'
                  contents:
                    - type: replyable_text
                      text: Hi Zenvia!
                      quickReplyButtons:
                        - type: text
                          text: Click here
                          payload: success
      responses:
        '200':
          description: Created message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/message.rcs'
        default:
          $ref: '#/components/responses/error'
  /channels/sms/messages:
    post:
      description: Send a SMS message
      tags:
        - SMS
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/message.sms'
            examples:
              text:
                value:
                  externalId: my-campaign-name
                  from: sms-account
                  to: '55108888888888'
                  contents:
                    - type: text
                      text: Hi Zenvia!
              template:
                value:
                  from: sms-account
                  to: '55108888888888'
                  contents:
                    - type: template
                      templateId: template_id
                      fields:
                        name: Jhon
                        product: Zenvia Chat
      responses:
        '200':
          description: Created message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/message.sms'
        default:
          $ref: '#/components/responses/error'
      x-code-samples:
        - lang: Shell
          label: Bash
          source: |
            curl "https://api.zenvia.com/v2/channels/sms/messages" \
            -H "Content-Type: application/json" \
            -H "X-API-TOKEN: YOUR_API_TOKEN" \
            -d '{
              "from": "sender-identifier",
              "to": "recipient-identifier",
              "contents": [{
                "type": "text",
                "text": "Some text message"
              }]
            }'
        - lang: JavaScript
          label: Node.js
          source: |
            const { post } = require('request-promise');

            post({
              uri: 'https://api.zenvia.com/v2/channels/sms/messages',
              headers: {
                'X-API-TOKEN': 'YOUR_API_TOKEN',
              },
              body: {
                from: 'sender-identifier',
                to: 'recipient-identifier',
                contents: [{
                  type: 'text',
                  text: 'Some text message',
                }],
              },
              json: true,
            })
            .then((response) => {
              console.log('Response:', response);
            })
            .catch((error) => {
              console.log('Error:', error);
            });
        - lang: JavaScript
          label: Node.js SDK
          source: |
            /**
             * Example: https://github.com/zenvia/zenvia-sdk-node/blob/master/examples/sms-send-text-message.js
             */

            import { Client, TextContent } from '@zenvia/sdk';

            const client = new Client('YOUR_API_TOKEN');

            const sms = client.getChannel('sms');

            const content = new TextContent('Some text message');

            sms.sendMessage('sender-identifier', 'recipient-identifier', content)
            .then((response) => {
              console.log('Response:', response);
            })
            .catch((error) => {
              console.log('Error:', error);
            });
        - lang: Java
          label: Java SDK
          source: |
            import com.zenvia.api.sdk.client.Channel;
            import com.zenvia.api.sdk.client.apache.Client;
            import com.zenvia.api.sdk.contents.TextContent;
            import com.zenvia.api.sdk.messages.Message;

            public class SmsSendTextMessage {

              public static void main (String arg []) {
                Client client = new Client("YOUR_API_TOKEN");

                Channel sms = client.getChannel("sms");

                TextContent content = new TextContent("Some text message");

                try {
                  Message response = sms.sendMessage("sender-identifier", "recipient-identifier", content);
                  System.out.println("Response: " + response.toString());
                } catch(Exception e) {
                  System.out.println("Error: " + e.getMessage());
                }
              }

            }
  /channels/telegram/messages:
    post:
      description: Send a Telegram message
      tags:
        - Telegram
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/message.telegram'
            examples:
              text:
                value:
                  externalId: my-campaign-name
                  from: YourBot
                  to: tg-chat-id
                  contents:
                    - type: text
                      text: Hi Zenvia!
              file:
                value:
                  from: YourBot
                  to: tg-chat-id
                  contents:
                    - type: file
                      fileUrl: 'https://zenvia.com/zenvia-team.png'
                      fileMimeType: image/png
                      fileCaption: 'Our pic :)'
                      fileName: team.png
              card:
                value:
                  from: YourBot
                  to: tg-chat-id
                  contents:
                    - type: card
                      title: Card from Zenvia
                      text: This is our products
                      media:
                        url: 'https://zenvia.com/zenvia-office.png'
                        disposition: ON_THE_TOP_MEDIUM_HEIGHT
                        caption: Our amazing office!
                      buttons:
                        - type: link
                          text: Site
                          url: 'https://www.zenvia.com/'
                      quickReplyButtons:
                        - type: text
                          text: Click here
                          payload: success
              replyable_text:
                value:
                  from: YourBot
                  to: tg-chat-id
                  contents:
                    - type: replyable_text
                      text: Hi Zenvia!
                      quickReplyButtons:
                        - type: text
                          text: Click here
                          payload: success
      responses:
        '200':
          description: Created message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/message.telegram'
        default:
          $ref: '#/components/responses/error'
      x-code-samples:
        - lang: Shell
          label: Bash
          source: |
            curl "https://api.zenvia.com/v2/channels/telegram/messages" \
            -H "Content-Type: application/json" \
            -H "X-API-TOKEN: YOUR_API_TOKEN" \
            -d '{
              "from": "sender-identifier",
              "to": "recipient-identifier",
              "contents": [{
                "type": "text",
                "text": "Some text message"
              }]
            }'
        - lang: JavaScript
          label: Node.js
          source: |
            const { post } = require('request-promise');

            post({
              uri: 'https://api.zenvia.com/v2/channels/telegram/messages',
              headers: {
                'X-API-TOKEN': 'YOUR_API_TOKEN',
              },
              body: {
                from: 'sender-identifier',
                to: 'recipient-identifier',
                contents: [{
                  type: 'text',
                  text: 'Some text message',
                }],
              },
              json: true,
            })
            .then((response) => {
              console.log('Response:', response);
            })
            .catch((error) => {
              console.log('Error:', error);
            });
        - lang: JavaScript
          label: Node.js SDK
          source: |
            /**
             * Example: https://github.com/zenvia/zenvia-sdk-node/blob/master/examples/telegram-send-text-message.js
             */

            import { Client, TextContent } from '@zenvia/sdk';

            const client = new Client('YOUR_API_TOKEN');

            const telegram = client.getChannel('telegram');

            const content = new TextContent('Some text message');

            telegram.sendMessage('sender-identifier', 'recipient-identifier', content)
            .then((response) => {
              console.log('Response:', response);
            })
            .catch((error) => {
              console.log('Error:', error);
            });
        - lang: Java
          label: Java SDK
          source: |
            import com.zenvia.api.sdk.client.Channel;
            import com.zenvia.api.sdk.client.apache.Client;
            import com.zenvia.api.sdk.contents.TextContent;
            import com.zenvia.api.sdk.messages.Message;

            public class TelegramSendTextMessage {

              public static void main (String arg []) {
                Client client = new Client("YOUR_API_TOKEN");

                Channel telegram = client.getChannel("telegram");

                TextContent content = new TextContent("Some text message");

                try {
                  Message response = telegram.sendMessage("sender-identifier", "recipient-identifier", content);
                  System.out.println("Response: " + response.toString());
                } catch(Exception e) {
                  System.out.println("Error: " + e.getMessage());
                }
              }

            }
  /channels/voice/messages:
    post:
      description: Send a Voice message
      tags:
        - Voice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/message.voice'
            examples:
              call_tts:
                value:
                  from: sender-id
                  to: '55108888888888'
                  contents:
                    - type: call
                      audio:
                        - type: tts
                          text: Hi Zenvia!
                          voiceStyle: br-Vitoria
                          awaitRecipientAnswer: true
                  recordAudio: true
                  hangUpOnVoiceMail: true
              call_tts_transferTo:
                value:
                  from: sender-id
                  to: '55108888888888'
                  contents:
                    - type: call
                      audio:
                        - type: tts
                          text: Hi Zenvia!
                          voiceStyle: br-Vitoria
                          awaitRecipientAnswer: true
                  transferTo: '5511999999999'
                  recordAudio: true
                  hangUpOnVoiceMail: true
              call_file:
                value:
                  from: sender-id
                  to: '55108888888888'
                  contents:
                    - type: call
                      audio:
                        - type: file
                          fileUrl: 'http://fooooo.bar/audio.mp3'
                  recordAudio: true
                  hangUpOnVoiceMail: true
              call_file_transferTo:
                value:
                  from: sender-id
                  to: '55108888888888'
                  contents:
                    - type: call
                      audio:
                        - type: file
                          fileUrl: 'http://fooooo.bar/audio.mp3'
                  transferTo: '5511999999999'
                  recordAudio: true
                  hangUpOnVoiceMail: true
      responses:
        '200':
          description: Created message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/message.voice'
        default:
          $ref: '#/components/responses/error'
      x-code-samples:
        - lang: Shell
          label: Bash
          source: |
            curl "https://api.zenvia.com/v2/channels/voice/messages" \
            -H "Content-Type: application/json" \
            -H "X-API-TOKEN: YOUR_API_TOKEN" \
            -d '{
              "from": "sender-identifier",
              "to": "recipient-identifier",
              "contents": [{
                "type": "text",
                "text": "Some text message"
              }]
            }'
        - lang: JavaScript
          label: Node.js
          source: |
            const { post } = require('request-promise');

            post({
              uri: 'https://api.zenvia.com/v2/channels/voice/messages',
              headers: {
                'X-API-TOKEN': 'YOUR_API_TOKEN',
              },
              body: {
                from: 'sender-identifier',
                to: 'recipient-identifier',
                contents: [{
                  type: 'text',
                  text: 'Some text message',
                }],
              },
              json: true,
            })
            .then((response) => {
              console.log('Response:', response);
            })
            .catch((error) => {
              console.log('Error:', error);
            });
        - lang: JavaScript
          label: Node.js SDK
          source: |
            /**
             * Example: https://github.com/zenvia/zenvia-sdk-node/blob/master/examples/whatsapp-send-text-message.js
             */

            import { Client, TextContent } from '@zenvia/sdk';

            const client = new Client('YOUR_API_TOKEN');

            const voice = client.getChannel('voice');

            const content = new TextContent('Some text message');

            voice.sendMessage('sender-identifier', 'recipient-identifier', content)
            .then((response) => {
              console.log('Response:', response);
            })
            .catch((error) => {
              console.log('Error:', error);
            });
        - lang: Java
          label: Java SDK
          source: |
            import com.zenvia.api.sdk.client.Channel;
            import com.zenvia.api.sdk.client.apache.Client;
            import com.zenvia.api.sdk.contents.TextContent;
            import com.zenvia.api.sdk.messages.Message;

            public class VoiceSendTextMessage {

              public static void main (String arg []) {
                Client client = new Client("YOUR_API_TOKEN");

                Channel voice = client.getChannel("voice");

                TextContent content = new TextContent("Some text message");

                try {
                  Message response = voice.sendMessage("sender-identifier", "recipient-identifier", content);
                  System.out.println("Response: " + response.toString());
                } catch(Exception e) {
                  System.out.println("Error: " + e.getMessage());
                }
              }

            }
  /channels/whatsapp/messages:
    post:
      description: Send a WhatsApp message
      tags:
        - WhatsApp
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/message.whatsapp'
            examples:
              text:
                value:
                  externalId: my-campaign-name
                  from: '5510999999999'
                  to: '55108888888888'
                  contents:
                    - type: text
                      text: Hi Zenvia!
              file:
                value:
                  from: '5510999999999'
                  to: '55108888888888'
                  contents:
                    - type: file
                      fileUrl: 'https://zenvia.com/zenvia-team.png'
                      fileMimeType: image/png
                      fileCaption: 'Our pic :)'
                      fileName: team.png
              template:
                value:
                  from: '5510999999999'
                  to: '55108888888888'
                  contents:
                    - type: template
                      templateId: template_id
                      fields:
                        name: Jhon
                        product: Zenvia Chat
                        orderDetailsParameters:
                          referenceId: OPTIONAL_UNIQUE_REFERENCE_ID_123
                          type: digital_goods
                          paymentSettings:
                            - type: boleto
                              digitableLine: 03399026944140000002628346101018898510000008848
                            - type: pix_dynamic_code
                              code: 00020101021226700014br.gov.bcb.pix2548pix.example.com
                              merchantName: Zenvia Brazil
                              key: 01234567890
                              keyType: CPF
                          totalAmount: 500
                          order:
                            items:
                              - productId: '1234567890'
                                name: Zenvia Brazil
                                amount: 500
                                quantity: 1
                            tax:
                              value: 0
                            subtotal: 500
              contacts:
                value:
                  from: '5510999999999'
                  to: '55108888888888'
                  contents:
                    - type: contacts
                      contacts:
                        - addresses:
                            - street: 'Av. Paulista, 2300'
                              city: São Paulo
                              state: São Paulo
                              zip: 01310-300
                              county: Brazil
                              countryCode: BR
                              type: WORK
                          birthday: ''
                          contactImage: ''
                          emails:
                            - email: jhon@zenvia.com
                              type: WORK
                          name:
                            formattedName: Jhon Zenvia
                            firstName: Jhon
                            lastName: Zenvia
                            middleName: ''
                            suffix: ''
                            prefix: ''
                          org:
                            company: Zenvia
                            department: Sales
                            title: Sales
                          phones:
                            - phone: 08006464777
                              type: WORK
                              waId: '132465'
                          urls:
                            - url: 'https://www.zenvia.com/'
                              type: WORK
              location:
                value:
                  from: '5510999999999'
                  to: '55108888888888'
                  contents:
                    - type: location
                      latitude: -23.55726
                      longitude: -46.66103
                      name: Zenvia
                      address: 'Av. Paulista, 2300 - 18º Andar - Bela Vista, São Paulo - SP, 01310-300'
                      url: 'https://www.zenvia.com/'
              button:
                value:
                  from: '5510999999999'
                  to: '55108888888888'
                  contents:
                    - type: button
                      header:
                        type: file
                        fileUrl: 'https://zenvia.com/zenvia-team.png'
                      body: Your message body text here
                      footer: Your message footer text here
                      buttons:
                        - id: btn1
                          title: Button One
                        - id: btn2
                          title: Button Two
              list:
                value:
                  from: '5510999999999'
                  to: '55108888888888'
                  contents:
                    - type: list
                      header: Message Header
                      body: Your message body text here
                      footer: Your message footer text here
                      button: Button Text
                      sections:
                        - title: Section Title
                          rows:
                            - id: row1
                              title: Item One
                              description: Item one description.
                            - id: row2
                              title: Item Two
                              description: Item two description.
                            - id: row3
                              title: Item Three
                              description: Item three description.
              product:
                value:
                  from: '5510999999999'
                  to: '55108888888888'
                  contents:
                    - type: product
                      body: Your message body text here
                      footer: Your message footer text here
                      catalogId: CATALOG_ID
                      productId: product-SKU-in-catalog
              product_list:
                value:
                  from: '5510999999999'
                  to: '55108888888888'
                  contents:
                    - type: product_list
                      header: Message Header
                      body: Your message body text here
                      footer: Your message footer text here
                      catalogId: CATALOG_ID
                      sections:
                        - title: Section Title
                          productItems:
                            - productId: product-SKU-in-catalog
                            - productId: product-SKU-in-catalog
              flow:
                value:
                  from: '5510999999999'
                  to: '55108888888888'
                  contents:
                    - type: flow
                      header: Text header content
                      body: Text body content
                      footer: Text footer content
                      flow:
                        mode: draft
                        token: TOKEN_FLOW
                        id: TOKEN_ID
                        buttonText: Click here!
                        action:
                          type: navigate
                          screen: SCREEN_ID
                          data:
                            property1: '2022-06-13'
                            property2: '2022-06-13'
      responses:
        '200':
          description: Created message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/message.whatsapp'
        default:
          $ref: '#/components/responses/error'
      x-code-samples:
        - lang: Shell
          label: Bash
          source: |
            curl "https://api.zenvia.com/v2/channels/whatsapp/messages" \
            -H "Content-Type: application/json" \
            -H "X-API-TOKEN: YOUR_API_TOKEN" \
            -d '{
              "from": "sender-identifier",
              "to": "recipient-identifier",
              "contents": [{
                "type": "text",
                "text": "Some text message"
              }]
            }'
        - lang: JavaScript
          label: Node.js
          source: |
            const { post } = require('request-promise');

            post({
              uri: 'https://api.zenvia.com/v2/channels/whatsapp/messages',
              headers: {
                'X-API-TOKEN': 'YOUR_API_TOKEN',
              },
              body: {
                from: 'sender-identifier',
                to: 'recipient-identifier',
                contents: [{
                  type: 'text',
                  text: 'Some text message',
                }],
              },
              json: true,
            })
            .then((response) => {
              console.log('Response:', response);
            })
            .catch((error) => {
              console.log('Error:', error);
            });
        - lang: JavaScript
          label: Node.js SDK
          source: |
            /**
             * Example: https://github.com/zenvia/zenvia-sdk-node/blob/master/examples/whatsapp-send-text-message.js
             */

            import { Client, TextContent } from '@zenvia/sdk';

            const client = new Client('YOUR_API_TOKEN');

            const whatsapp = client.getChannel('whatsapp');

            const content = new TextContent('Some text message');

            whatsapp.sendMessage('sender-identifier', 'recipient-identifier', content)
            .then((response) => {
              console.log('Response:', response);
            })
            .catch((error) => {
              console.log('Error:', error);
            });
        - lang: Java
          label: Java SDK
          source: |
            import com.zenvia.api.sdk.client.Channel;
            import com.zenvia.api.sdk.client.apache.Client;
            import com.zenvia.api.sdk.contents.TextContent;
            import com.zenvia.api.sdk.messages.Message;

            public class WhatsAppSendTextMessage {

              public static void main (String arg []) {
                Client client = new Client("YOUR_API_TOKEN");

                Channel whatsapp = client.getChannel("whatsapp");

                TextContent content = new TextContent("Some text message");

                try {
                  Message response = whatsapp.sendMessage("sender-identifier", "recipient-identifier", content);
                  System.out.println("Response: " + response.toString());
                } catch(Exception e) {
                  System.out.println("Error: " + e.getMessage());
                }
              }

            }
  /chatbot-outbounds:
    post:
      description: Send outbound message to Chatbot
      tags:
        - Chatbot Outbound
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/chatbot.chatbot-outbound'
      responses:
        '200':
          description: Success response of sent outbound
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/chatbot.chatbot-outbound'
        default:
          $ref: '#/components/responses/error'
  /contact-batches:
    post:
      summary: Import a batch of contacts
      description: Import a batch of contacts to be processed.
      tags:
        - Contact Batches
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: CSV file to be imported.
                  minLength: 8
              required:
                - file
      responses:
        '201':
          description: Batch imported successfully.
          headers:
            Location:
              description: The URL where the newly created batch can be found.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/partners-batches.batch-create-response'
        default:
          $ref: '#/components/responses/error'
    get:
      summary: List all batches of contacts
      description: List all created batches of contacts.
      tags:
        - Contact Batches
      parameters:
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/page'
      security:
        - TOKEN: []
      responses:
        '200':
          description: Batches listed successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/partners-batches.batch-list-response'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
            x-page-size:
              schema:
                description: The number of results per page.
                type: string
                example: '10'
            x-page:
              schema:
                description: The current page.
                type: string
                example: '5'
        default:
          $ref: '#/components/responses/error'
  '/contact-batches/{batchId}':
    get:
      summary: Retrieve batch by id
      description: Retrieve a contact batch by its id.
      tags:
        - Contact Batches
      security:
        - TOKEN: []
      responses:
        '200':
          description: Batch retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/partners-batches.batch-list-response'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/batchId'
  /contact-custom-data-fields:
    post:
      summary: Create a new contact custom data field
      description: 'Allows the creation of custom data fields to be used in the [contacts API](#tag/Contacts/paths/~1contacts/post).'
      tags:
        - Contact Custom Data Fields
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/contacts-management.contact-custom-data-field'
      responses:
        '200':
          description: Created contact custom data field
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contacts-management.contact-custom-data-field'
        default:
          $ref: '#/components/responses/error'
    get:
      summary: List contact data fields
      description: Lists all contact custom data fields available.
      tags:
        - Contact Custom Data Fields
      parameters:
        - $ref: '#/components/parameters/page-legacy'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: Contact custom data fields available
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/contacts-management.contact-custom-data-field'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
        default:
          $ref: '#/components/responses/error'
  /contact-lists:
    post:
      summary: Create a new contact list
      description: Allows the creation of contact lists.
      tags:
        - Contact Lists
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/contacts-management.contact-list'
                - type: object
                  required:
                    - name
      responses:
        '200':
          description: Created contact list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contacts-management.contact-list'
        default:
          $ref: '#/components/responses/error'
    get:
      summary: List contact lists
      description: Lists all contact lists available.
      tags:
        - Contact Lists
      parameters:
        - $ref: '#/components/parameters/page-legacy'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: Contact lists available
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/contacts-management.contact-list'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
        default:
          $ref: '#/components/responses/error'
  '/contact-lists/{listId}':
    get:
      summary: Retrieve one contact list by id
      description: Allows to retrieve a contact list's information.
      tags:
        - Contact Lists
      responses:
        '200':
          description: Contact object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contacts-management.contact-list'
        default:
          $ref: '#/components/responses/error'
    patch:
      summary: Update one contact list by id
      description: Allows to update a contact list's information.
      tags:
        - Contact Lists
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/contacts-management.contact-list'
      responses:
        '200':
          description: Updated contact list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contacts-management.contact-list'
        default:
          $ref: '#/components/responses/error'
    delete:
      summary: Delete one contact list by id
      description: 'Allows to delete a contact list. Only the list is deleted, not the contacts.'
      tags:
        - Contact Lists
      responses:
        '204':
          description: No content
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/contacts-management.listId'
  '/contact-lists/{listId}/contacts':
    get:
      summary: List the contacts in a list
      description: Virtual collection to list the contacts in the list.
      tags:
        - Contact Lists
      parameters:
        - $ref: '#/components/parameters/page-legacy'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: Contact IDs
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/contacts-management.contact'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/contacts-management.listId'
  /contacts:
    post:
      summary: Create a new contact
      description: Allows the creation of contacts.
      tags:
        - Contacts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - title: Contact with channelList
                  allOf:
                    - $ref: '#/components/schemas/contacts-management.contact-channelList'
                - title: Contact with channels
                  allOf:
                    - $ref: '#/components/schemas/contacts-management.contact'
            examples:
              preferred:
                summary: Create contact with channelList (preferred)
                value:
                  channelList:
                    - type: email
                      id: contact@domain.example
                    - type: phone
                      id: '5510888883333'
                      idType: mobile
                    - type: phone
                      id: '551044443333'
                      idType: landline
                    - type: facebook
                      id: '8484848448'
                    - type: instagram
                      id: '123123123123'
                      username: '@username'
                    - type: twitter
                      id: '@username'
                    - type: meli
                      id: meliUser_123
                    - type: whatsapp
                      id: '181818181'
                      idType: bsuid
                      username: '@username'
                      senderId: '123123123'
                  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
              deprecated:
                summary: Create contact with channels (deprecated)
                value:
                  channels:
                    email: contact@domain.example
                    mobile: '5510888883333'
                    landline: '551044443333'
                    facebook: user.name.123
                    instagram: user_name
                    twitter: '@username'
                    meli: meliUser_123
                  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
      responses:
        '200':
          description: Contact created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contacts-management.responses.contact-response'
        '400':
          description: Validation error. Returned when the request body is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.base'
              examples:
                mutuallyExclusiveFields:
                  summary: channels and channelList sent together
                  value:
                    code: VALIDATION_ERROR
                    message: Validation error
                    details:
                      - code: MUTUALLY_EXCLUSIVE_FIELDS
                        path: channelList
                        message: 'The fields ''channels'' and ''channelList'' cannot be used together. Note: ''channels'' is deprecated, please migrate to ''channelList''.'
        default:
          $ref: '#/components/responses/error'
    get:
      summary: List contacts
      description: Lists all contacts available
      tags:
        - Contacts
      parameters:
        - $ref: '#/components/parameters/contacts-management.listIds'
        - $ref: '#/components/parameters/page-legacy'
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/contacts-management.channelList.id'
        - $ref: '#/components/parameters/contacts-management.email'
        - $ref: '#/components/parameters/contacts-management.mobile'
        - $ref: '#/components/parameters/contacts-management.landline'
        - $ref: '#/components/parameters/contacts-management.facebook'
        - $ref: '#/components/parameters/contacts-management.instagram'
        - $ref: '#/components/parameters/contacts-management.twitter'
        - $ref: '#/components/parameters/contacts-management.meli'
      responses:
        '200':
          description: Contacts available
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/contacts-management.responses.contact-response'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
        default:
          $ref: '#/components/responses/error'
  '/contacts/{contactId}':
    get:
      summary: Retrieve one contact by id
      description: Allows to retrieve a contact's information.
      tags:
        - Contacts
      responses:
        '200':
          description: Contact object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contacts-management.responses.contact-response'
        default:
          $ref: '#/components/responses/error'
    patch:
      summary: Update one contact by id
      description: Allows to update a contact's information.
      tags:
        - Contacts
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - title: Contact with channelList
                  allOf:
                    - $ref: '#/components/schemas/contacts-management.contact-channelList'
                - title: Contact with channels
                  allOf:
                    - $ref: '#/components/schemas/contacts-management.contact'
      responses:
        '200':
          description: Updated contact
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contacts-management.responses.contact-response'
        '400':
          description: Validation error. Returned when the request body is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.base'
              examples:
                mutuallyExclusiveFields:
                  summary: channels and channelList sent together
                  value:
                    code: VALIDATION_ERROR
                    message: Validation error
                    details:
                      - code: MUTUALLY_EXCLUSIVE_FIELDS
                        path: channelList
                        message: 'The fields ''channels'' and ''channelList'' cannot be used together. Note: ''channels'' is deprecated, please migrate to ''channelList''.'
        default:
          $ref: '#/components/responses/error'
    delete:
      summary: Delete one contact by id
      description: Allows to delete a contact.
      tags:
        - Contacts
      responses:
        '204':
          description: No content
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/contacts-management.contactId'
  /conversations:
    get:
      description: 'List conversations for the organization, optionally filtered.'
      tags:
        - Conversations
      parameters:
        - $ref: '#/components/parameters/conversations.id'
        - $ref: '#/components/parameters/conversations.status'
        - $ref: '#/components/parameters/conversations.groupId'
        - $ref: '#/components/parameters/conversations.contactId'
        - $ref: '#/components/parameters/conversations.userId'
        - $ref: '#/components/parameters/conversations.search'
        - $ref: '#/components/parameters/conversations.sort'
        - $ref: '#/components/parameters/conversations.page'
        - $ref: '#/components/parameters/conversations.size'
      responses:
        '200':
          description: Conversations available
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/conversations.conversation'
          headers:
            x-page:
              schema:
                description: The page number that was applied.
                type: string
                example: '1'
            x-page-size:
              schema:
                description: The page size that was applied.
                type: string
                example: '20'
            x-total:
              schema:
                description: The total number of conversations matching the filters.
                type: string
                example: '134'
        default:
          $ref: '#/components/responses/error'
    post:
      description: 'Create a conversation for a contact, or resume an existing one for the same contact.'
      tags:
        - Conversations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/conversations.create-request'
      responses:
        '201':
          description: Conversation created (or resumed)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/conversations.conversation'
        default:
          $ref: '#/components/responses/error'
  '/conversations/{conversationId}/actions/archive':
    post:
      description: Archive (close) the conversation with the given close reason.
      tags:
        - Conversations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/conversations.archive-request'
      responses:
        '200':
          description: Conversation archived
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/conversations.conversationId'
  '/conversations/{conversationId}/actions/transfer':
    post:
      description: Transfer the conversation to a user or a group. Transferring to a user is synchronous and answers 200; transferring to a group answers 202 and the conversation is queued for distribution.
      tags:
        - Conversations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/conversations.transfer-request'
      responses:
        '200':
          description: Conversation transferred to a user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/conversations.conversation'
        '202':
          description: Conversation transferred to a group and queued for distribution
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/conversations.conversation'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/conversations.conversationId'
  '/conversations/{conversationId}/messages':
    post:
      description: 'Send an outbound message on the conversation, as the acting agent. Fails with SESSION_REQUIRED when there is no active messaging session with the contact.'
      tags:
        - Conversations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/conversations.send-message-request'
      responses:
        '201':
          description: Message sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/conversations.message-response'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/conversations.conversationId'
  '/conversations/{conversationId}/notes':
    post:
      description: 'Add an internal note to the conversation. A note is a message with direction INTERNAL, never delivered to the contact.'
      tags:
        - Conversations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/conversations.send-note-request'
      responses:
        '201':
          description: Note added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/conversations.message-response'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/conversations.conversationId'
  /files:
    post:
      summary: Create a new file
      description: Allows the storage of files for later use.
      tags:
        - Files
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                content:
                  title: Binary File
                  description: Binary file content to be stored.
                  type: string
                file:
                  $ref: '#/components/schemas/files.multipart-data'
              required:
                - content
            examples:
              multipart:
                description: 'Content-Type: multipart/form-data; boundary=3bb873df66f5202e15d4b3b9a7eff'
                value: "--3bb873df66f5202e15d4b3b9a7eff\r\nContent-Disposition: form-data; name=\"file\"\r\nContent-Type: application/json\r\n\r\n{\n  \"mimeType\": \"image/png\",\n  \"name\": \"my-image.png\"\n}\r\n--3bb873df66f5202e15d4b3b9a7eff\r\nContent-Disposition: form-data; name=\"content\"; filename=\"original-name.png\"\r\nContent-Type: image/png\r\n\r\nBINARY-CONTENT\r\n--3bb873df66f5202e15d4b3b9a7eff--\r\n\r\n"
          application/json:
            schema:
              $ref: '#/components/schemas/files.file'
          '*/*':
            schema:
              title: Binary File
              description: |-
                The entire request body will be the file content to be stored.
                                        <br><br>The main usage for this is for easier binary content streaming in the applications using this API.
              type: string
            examples:
              binary:
                description: 'Content-Type: image/png'
                value: BINARY-CONTENT
      responses:
        '201':
          description: Created file
          headers:
            Location:
              description: The URL for created file object.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/files.file'
        default:
          $ref: '#/components/responses/error'
      x-code-samples:
        - lang: Shell
          label: 'Bash: multipart with data'
          source: |
            curl 'https://api.zenvia.com/v2/files' \
            -H 'X-API-TOKEN: YOUR_API_TOKEN' \
            -F 'file={
              "mimeType": "image/png",
              "name": "my-image.png"
            };type=application/json' \
            -F 'content=@./image-source.png'
        - lang: Shell
          label: 'Bash: multipart'
          source: |
            curl 'https://api.zenvia.com/v2/files' \
            -H 'X-API-TOKEN: YOUR_API_TOKEN' \
            -F 'content=@./image-source.png;type=image/png;filename=my-image.png'
        - lang: Shell
          label: 'Bash: raw multipart with data'
          source: |
            curl 'https://api.zenvia.com/v2/files' \
            -H 'X-API-TOKEN: YOUR_API_TOKEN' \
            -H 'Content-Type: multipart/form-data; boundary=3bb873df66f5202e15d4b3b9a7eff' \
            --data-binary "`echo -e '--3bb873df66f5202e15d4b3b9a7eff\r
            Content-Disposition: form-data; name="file"\r
            Content-Type: application/json\r
            \r
            {
              "mimeType": "text/plain",
              "name": "my-text.txt"
            }\r
            --3bb873df66f5202e15d4b3b9a7eff\r
            Content-Disposition: form-data; name="content"; filename="original-name.txt"\r
            Content-Type: text/plain\r
            \r
            BINARY-CONTENT\r
            --3bb873df66f5202e15d4b3b9a7eff--\r
            '`"
        - lang: Shell
          label: 'Bash: URL'
          source: |
            curl 'https://api.zenvia.com/v2/files' \
            -H 'X-API-TOKEN: YOUR_API_TOKEN' \
            -H 'Content-Type: application/json' \
            -d '{
              "sourceUrl": "https://zenvia.com/example",
              "sourceHeaders": {
                "Authorization": "Basic dXNlcjpwd2Q=",
                "X-Custom-Token": "TOKEN"
              },
              "mimeType": "image/png",
              "name": "my-image.png"
            }'
        - lang: Shell
          label: 'Bash: binary'
          source: |
            curl 'https://api.zenvia.com/v2/files' \
            -H 'X-API-TOKEN: YOUR_API_TOKEN' \
            -H 'Content-Type: image/png' \
            -H 'Content-Disposition: inline;filename=my-image.png' \
            --data-binary '@./image-source.png'
    get:
      summary: List files
      description: Lists all files available
      tags:
        - Files
      parameters:
        - $ref: '#/components/parameters/files.startTimestamp'
        - $ref: '#/components/parameters/files.endTimestamp'
        - $ref: '#/components/parameters/files.limit'
      responses:
        '200':
          description: Files found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/files.file'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
        default:
          $ref: '#/components/responses/error'
  '/files/{fileId}':
    get:
      summary: Retrieve one file by id
      description: Allows to retrieve information about one previously stored file.
      tags:
        - Files
      responses:
        '200':
          description: File object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/files.file'
        default:
          $ref: '#/components/responses/error'
    delete:
      summary: Delete file by id
      description: Allows to delete one previously stored file.
      tags:
        - Files
      responses:
        '204':
          description: No content
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/files.fileId'
  /flow-batches:
    post:
      description: Create a flow batch
      tags:
        - Flow Batches
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flow.batches.json'
          multipart/form-data:
            schema:
              type: object
              properties:
                csv:
                  type: string
                  title: Binary CSV File
                  description: |-
                    Binary csv file with recipients and variable values when necessary.

                     **Requirements**:
                     * 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 has the recipients phone numbers. If your content has variables, there must be corresponding columns.
                request:
                  $ref: '#/components/schemas/flow.batches.multipart'
              required:
                - csv
                - request
      responses:
        '200':
          description: Created flow batch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/flow.batches.item'
        default:
          $ref: '#/components/responses/error'
    get:
      description: Get list of flow-batches
      tags:
        - Flow Batches
      parameters:
        - $ref: '#/components/parameters/flowId'
        - $ref: '#/components/parameters/page-legacy'
        - $ref: '#/components/parameters/size'
      responses:
        '200':
          description: Flow-batches found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/flow.batches.item'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
            x-page-size:
              schema:
                description: The number of results per page.
                type: string
                example: '10'
            x-page:
              schema:
                description: The current page.
                type: string
                example: '5'
        default:
          $ref: '#/components/responses/error'
  '/flow-batches/{flowBatchId}':
    get:
      description: Retrieve one batch by id
      tags:
        - Flow Batches
      parameters:
        - $ref: '#/components/parameters/flowBatchId'
      responses:
        '200':
          description: Flow Batch found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/flow.batches.item'
        default:
          $ref: '#/components/responses/error'
  '/flow-batches/{flowBatchId}/actions/cancel':
    post:
      description: Cancel a flow batch
      tags:
        - Flow Batches
      responses:
        '204':
          description: Flow batch canceled
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/flowBatchId'
  '/flow-batches/{flowBatchId}/actions/pause':
    post:
      description: Pause a flow batch
      tags:
        - Flow Batches
      responses:
        '204':
          description: Flow batch paused
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/flowBatchId'
  '/flow-batches/{flowBatchId}/actions/resume':
    post:
      description: Resume a flow batch
      tags:
        - Flow Batches
      responses:
        '204':
          description: Flow batch resumed
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/flowBatchId'
  /groups:
    get:
      description: List the organization's enabled groups.
      tags:
        - Groups
      responses:
        '200':
          description: Groups available
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/groups.group'
          headers:
            x-total:
              schema:
                description: The total number of groups.
                type: string
                example: '5'
        default:
          $ref: '#/components/responses/error'
  '/groups/{groupId}/agents':
    get:
      description: 'List the agents belonging to a group, with their current availability.'
      tags:
        - Groups
      responses:
        '200':
          description: Agents available
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/groups.agent'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/groups.groupId'
  /invoice-batches:
    post:
      summary: Import a batch of invoices
      description: Import a batch of invoices to be processed.
      tags:
        - Invoice Batches
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: CSV file to be imported.
                  minLength: 8
              required:
                - file
      responses:
        '201':
          description: Batch imported successfully.
          headers:
            Location:
              description: The URL where the newly created batch can be found.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/partners-batches.batch-create-response'
        default:
          $ref: '#/components/responses/error'
    get:
      summary: List all batches of invoices
      description: List all created batches of invoices.
      tags:
        - Invoice Batches
      parameters:
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/page'
      security:
        - TOKEN: []
      responses:
        '200':
          description: Batches listed successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/partners-batches.batch-list-response'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
            x-page-size:
              schema:
                description: The number of results per page.
                type: string
                example: '10'
            x-page:
              schema:
                description: The current page.
                type: string
                example: '5'
        default:
          $ref: '#/components/responses/error'
  '/invoice-batches/{batchId}':
    get:
      summary: Retrieve batch by id
      description: Retrieve a invoice batch by its id.
      tags:
        - Invoice Batches
      security:
        - TOKEN: []
      responses:
        '200':
          description: Batch retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/partners-batches.batch-list-response'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/batchId'
  '/marketing-automations/{automationId}/dispatches':
    post:
      summary: Dispatch a marketing automation
      description: Allows the execution of a marketing automation
      tags:
        - Marketing Automations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/marketing-automations.marketing-automation'
      responses:
        '200':
          description: Automation successfully executed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/marketing-automations.marketing-automation-response'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/automationId'
  /order-batches:
    post:
      summary: Import a batch of orders
      description: Import a batch of orders to be processed.
      tags:
        - Order Batches
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: CSV file to be imported.
                  minLength: 8
              required:
                - file
      responses:
        '201':
          description: Batch imported successfully.
          headers:
            Location:
              description: The URL where the newly created batch can be found.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/partners-batches.batch-create-response'
        default:
          $ref: '#/components/responses/error'
    get:
      summary: List all batches of orders
      description: List all created batches of orders.
      tags:
        - Order Batches
      parameters:
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/page'
      security:
        - TOKEN: []
      responses:
        '200':
          description: Batches listed successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/partners-batches.batch-list-response'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
            x-page-size:
              schema:
                description: The number of results per page.
                type: string
                example: '10'
            x-page:
              schema:
                description: The current page.
                type: string
                example: '5'
        default:
          $ref: '#/components/responses/error'
  '/order-batches/{batchId}':
    get:
      summary: Retrieve batch by id
      description: Retrieve a order batch by its id.
      tags:
        - Order Batches
      security:
        - TOKEN: []
      responses:
        '200':
          description: Batch retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/partners-batches.batch-list-response'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/batchId'
  /product-batches:
    post:
      summary: Import a batch of products
      description: Import a batch of products to be processed.
      tags:
        - Product Batches
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: CSV file to be imported.
                  minLength: 8
              required:
                - file
      responses:
        '201':
          description: Batch imported successfully.
          headers:
            Location:
              description: The URL where the newly created batch can be found.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/partners-batches.batch-create-response'
        default:
          $ref: '#/components/responses/error'
    get:
      summary: List all batches of products
      description: List all created batches of products.
      tags:
        - Product Batches
      parameters:
        - $ref: '#/components/parameters/size'
        - $ref: '#/components/parameters/page'
      security:
        - TOKEN: []
      responses:
        '200':
          description: Batches listed successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/partners-batches.batch-list-response'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
            x-page-size:
              schema:
                description: The number of results per page.
                type: string
                example: '10'
            x-page:
              schema:
                description: The current page.
                type: string
                example: '5'
        default:
          $ref: '#/components/responses/error'
  '/product-batches/{batchId}':
    get:
      summary: Retrieve batch by id
      description: Retrieve a product batch by its id.
      tags:
        - Product Batches
      security:
        - TOKEN: []
      responses:
        '200':
          description: Batch retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/partners-batches.batch-list-response'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/batchId'
  /reports/flow/entries:
    get:
      description: Retrieve all entries applying the given filters
      tags:
        - Flow Report
      responses:
        '200':
          description: Flow report entries
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/reports.flow.entries.base'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/reports.flow.startDate'
      - $ref: '#/components/parameters/reports.flow.endDate'
      - $ref: '#/components/parameters/reports.flow.flowId'
      - $ref: '#/components/parameters/reports.flow.dispatchId'
      - $ref: '#/components/parameters/reports.flow.sessionId'
  /reports/message/entries:
    get:
      description: Retrieve all entries applying the given filters
      tags:
        - Message Report
      responses:
        '200':
          description: Message report entries
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/reports.message.entry.base'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/reports.message.startDate'
      - $ref: '#/components/parameters/reports.message.endDate'
      - $ref: '#/components/parameters/reports.message.channels'
      - $ref: '#/components/parameters/reports.message.type'
  /status-groups:
    get:
      summary: Check groups status
      description: Allows monitoring of the status of Zenvia platforms and solutions.
      tags:
        - Status Groups
      security: []
      responses:
        '200':
          description: Status Groups successfully executed
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/status-groups.status-groups'
        default:
          $ref: '#/components/responses/error'
  '/status-groups/{componentId}':
    get:
      summary: Check groups status by id
      description: Allows monitoring of the status of a single Zenvia platform and solution.
      tags:
        - Status Groups
      security: []
      parameters:
        - $ref: '#/components/parameters/statusGroupsId'
      responses:
        '200':
          description: Status Groups object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/status-groups.status-groups'
        default:
          $ref: '#/components/responses/error'
  /subscriptions:
    post:
      description: Create a new webhook
      tags:
        - Webhooks
      responses:
        '200':
          description: Created subscription
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/subscription.partial-status.all'
        default:
          $ref: '#/components/responses/error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/subscription.partial-status.all'
      callbacks:
        onEvent:
          $ref: '#/components/callbacks/subscription-event'
    get:
      description: List all webhooks
      tags:
        - Webhooks
      responses:
        '200':
          description: Webhook Object List
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/subscription.all'
        default:
          $ref: '#/components/responses/error'
  '/subscriptions/{subscriptionId}':
    get:
      description: Retrieve one webhook by id
      tags:
        - Webhooks
      responses:
        '200':
          description: Webhook Object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/subscription.all'
        default:
          $ref: '#/components/responses/error'
    delete:
      description: Delete one webhook by id
      tags:
        - Webhooks
      responses:
        '204':
          description: No content
        default:
          $ref: '#/components/responses/error'
    patch:
      description: Update one webhook by id
      tags:
        - Webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/subscription.partial-subscription'
      responses:
        '200':
          description: Webhook Object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/subscription.all'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/subscriptionId'
  /tickets:
    post:
      summary: Create a new ticket
      description: Allows the creation of tickets.
      tags:
        - Tickets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/support-service.ticket'
      responses:
        '201':
          description: Ticket created
          headers:
            Location:
              description: The URL where the newly created ticket can be found.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/support-service.ticket'
        default:
          $ref: '#/components/responses/error'
    get:
      summary: List tickets
      description: Lists all tickets available.
      tags:
        - Tickets
      security:
        - TOKEN: []
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/support-service.size'
        - $ref: '#/components/parameters/support-service.createdAt'
        - $ref: '#/components/parameters/support-service.updatedAt'
        - $ref: '#/components/parameters/support-service.statusId'
      responses:
        '200':
          description: Tickets available
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/support-service.ticket'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
            x-page-size:
              schema:
                description: The number of results per page.
                type: string
                example: '10'
            x-page:
              schema:
                description: The current page.
                type: string
                example: '5'
        default:
          $ref: '#/components/responses/error'
  '/tickets/{ticketId}':
    get:
      summary: Retrieve ticket by id
      description: Retrieve all ticket information by id.
      tags:
        - Tickets
      security:
        - TOKEN: []
      parameters: []
      responses:
        '200':
          description: Ticket object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/support-service.ticket'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/actions':
    get:
      summary: List ticket actions
      description: Lists all ticket actions available.
      tags:
        - Ticket Actions
      security:
        - TOKEN: []
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/support-service.size'
      responses:
        '200':
          description: Ticket actions available
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/support-service.ticket-action'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
            x-page-size:
              schema:
                description: The number of results per page.
                type: string
                example: '10'
            x-page:
              schema:
                description: The current page.
                type: string
                example: '5'
        default:
          $ref: '#/components/responses/error'
    post:
      summary: Create ticket action
      description: Allows creation of ticket actions.
      tags:
        - Ticket Actions
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/support-service.ticket-action'
      responses:
        '201':
          description: Ticket action created
          headers:
            Location:
              description: The URL where the newly created ticket action can be found.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/support-service.ticket-action'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/attributes/category':
    patch:
      summary: Update ticket category
      description: Allows to update ticket category.
      tags:
        - Tickets
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/support-service.ticket-attribute-category'
      responses:
        '200':
          description: Ticket category updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/support-service.ticket-attribute-category'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/attributes/clients':
    patch:
      summary: Update ticket clients
      description: Allows to update ticket clients.
      tags:
        - Tickets
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/support-service.ticket-attribute-clients'
      responses:
        '200':
          description: Ticket clients updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/support-service.ticket-attribute-clients'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/attributes/owner':
    patch:
      summary: Update ticket owner
      description: Allows to update ticket owner.
      tags:
        - Tickets
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/support-service.ticket-attribute-owner'
      responses:
        '200':
          description: Ticket owner updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/support-service.ticket-attribute-owner'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/attributes/service':
    patch:
      summary: Update ticket service
      description: Allows to update ticket service.
      tags:
        - Tickets
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/support-service.ticket-attribute-service'
      responses:
        '200':
          description: Ticket service updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/support-service.ticket-attribute-service'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/attributes/solution':
    patch:
      summary: Update ticket solution
      description: Allows to update ticket solution.
      tags:
        - Tickets
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/support-service.ticket-attribute-solution'
      responses:
        '200':
          description: Ticket solution at updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/support-service.ticket-attribute-solution'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/attributes/status':
    patch:
      summary: Update ticket status
      description: Allows to update ticket status.
      tags:
        - Tickets
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/support-service.ticket-attribute-status'
      responses:
        '200':
          description: Ticket status updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/support-service.ticket-attribute-status'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/attributes/subject':
    patch:
      summary: Update ticket subject
      description: Allows to update ticket subject.
      tags:
        - Tickets
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/support-service.ticket-attribute-subject'
      responses:
        '200':
          description: Ticket subject updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/support-service.ticket-attribute-subject'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/attributes/type':
    patch:
      summary: Update ticket type
      description: Allows to update ticket type.
      tags:
        - Tickets
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/support-service.ticket-attribute-type'
      responses:
        '200':
          description: Ticket type updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/support-service.ticket-attribute-type'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/attributes/urgency':
    patch:
      summary: Update ticket urgency
      description: Allows to update ticket urgency.
      tags:
        - Tickets
      security:
        - TOKEN: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/support-service.ticket-attribute-urgency'
      responses:
        '200':
          description: Ticket urgency updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/support-service.ticket-attribute-urgency'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/owner-changes':
    get:
      summary: List ticket owner changes
      description: Lists all ticket owner changes available.
      tags:
        - Tickets
      security:
        - TOKEN: []
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/support-service.size'
      responses:
        '200':
          description: Ticket owner changes available
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/support-service.ticket-owner-changes'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
            x-page-size:
              schema:
                description: The number of results per page.
                type: string
                example: '10'
            x-page:
              schema:
                description: The current page.
                type: string
                example: '5'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/status-changes':
    get:
      summary: List ticket status changes
      description: Lists all ticket status changes.
      tags:
        - Tickets
      security:
        - TOKEN: []
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/support-service.size'
      responses:
        '200':
          description: Ticket status changes
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/support-service.ticket-status-changes'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
            x-page-size:
              schema:
                description: The number of results per page.
                type: string
                example: '10'
            x-page:
              schema:
                description: The current page.
                type: string
                example: '5'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/tags':
    get:
      summary: List ticket tags
      description: Lists all ticket tags available.
      tags:
        - Ticket Tags
      security:
        - TOKEN: []
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/support-service.size'
      responses:
        '200':
          description: Ticket tags available
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/support-service.context.tag'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
            x-page-size:
              schema:
                description: The number of results per page.
                type: string
                example: '10'
            x-page:
              schema:
                description: The current page.
                type: string
                example: '5'
        default:
          $ref: '#/components/responses/error'
    post:
      summary: Attach a tag to a ticket
      description: Allows the creation of a relationship between a ticket and a tag.
      tags:
        - Ticket Tags
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/support-service.ticket-tag'
      responses:
        '200':
          description: The tag attached to the ticket
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/support-service.ticket-tag'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
  '/tickets/{ticketId}/tags/{tagId}':
    delete:
      summary: Delete the relationship between a tag and a ticket
      description: Allows to delete the relationship between a tag and a ticket.
      tags:
        - Ticket Tags
      parameters:
        - $ref: '#/components/parameters/support-service.updatedById'
      responses:
        '204':
          description: No content
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/support-service.ticketId'
      - $ref: '#/components/parameters/support-service.tagId'
  /templates:
    post:
      description: Create a new template
      tags:
        - Templates
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/templates.create.all'
      responses:
        '200':
          description: Created template
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/templates.create.all'
        default:
          $ref: '#/components/responses/error'
    get:
      description: List all templates
      tags:
        - Templates
      parameters:
        - $ref: '#/components/parameters/templates.channel'
        - $ref: '#/components/parameters/templates.senderId'
        - $ref: '#/components/parameters/templates.category'
        - $ref: '#/components/parameters/templates.status'
        - $ref: '#/components/parameters/templates.page'
        - $ref: '#/components/parameters/templates.size'
      responses:
        '200':
          description: Template Object List
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/templates.create.all'
          headers:
            x-total:
              schema:
                description: The total number of results available.
                type: string
                example: '100'
            x-page-size:
              schema:
                description: The number of results per page.
                type: string
                example: '10'
            x-page:
              schema:
                description: The current page.
                type: string
                example: '5'
        default:
          $ref: '#/components/responses/error'
  '/templates/{templateId}':
    get:
      description: Retrieve one template by id
      tags:
        - Templates
      responses:
        '200':
          description: Template Object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/templates.create.all'
        default:
          $ref: '#/components/responses/error'
    delete:
      description: Delete one template by id
      tags:
        - Templates
      responses:
        '204':
          description: No content
        default:
          $ref: '#/components/responses/error'
    patch:
      description: Update one template by id
      tags:
        - Templates
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/templates.partial-template'
      responses:
        '200':
          description: Template Object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/templates.create.all'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/templateId'
  '/templates/{templateId}/comments':
    post:
      description: Create a new comment
      tags:
        - Templates
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/templates.template-comment'
      responses:
        '200':
          description: Created comment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/templates.template-comment'
        default:
          $ref: '#/components/responses/error'
    get:
      description: List all comments
      tags:
        - Templates
      responses:
        '200':
          description: Comment Object List
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/templates.template-comment'
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/templateId'
  '/templates/{templateId}/comments/{templateCommentId}':
    delete:
      description: Delete comment by id
      tags:
        - Templates
      responses:
        '204':
          description: No content
        default:
          $ref: '#/components/responses/error'
    parameters:
      - $ref: '#/components/parameters/templateId'
      - $ref: '#/components/parameters/templateCommentId'
components:
  schemas:
    2fa.configuration.requests.all:
      title: Token configuration
      description: Token configuration to generate and deliver tokens
      type: object
      properties:
        token:
          $ref: '#/components/schemas/2fa.configuration.requests.token'
        verify:
          $ref: '#/components/schemas/2fa.configuration.requests.verify'
        delivery:
          $ref: '#/components/schemas/2fa.configuration.requests.delivery'
        content:
          $ref: '#/components/schemas/2fa.configuration.requests.content'
        website:
          $ref: '#/components/schemas/2fa.configuration.requests.website'
      required:
        - token
        - content
    2fa.configuration.requests.content:
      title: SMS and E-mail Content
      type: object
      description: 'Content with SMS and e-mail information and default locale, it''s necessary to create configuration for at least one locale'
      properties:
        default:
          title: Locale
          type: string
          example: pt_br
          description: The default locale of the configuration
          enum:
            - be
            - be_by
            - bn
            - bg
            - bg_bg
            - ca
            - ca_es
            - cs
            - cs_cz
            - da
            - da_dk
            - de
            - de_ch
            - de_de
            - el
            - el_gr
            - en
            - en_au
            - en_be
            - en_gb
            - en_jp
            - en_us
            - en_za
            - es
            - es_ar
            - es_es
            - es_mx
            - fr
            - fr_ca
            - fr_fr
            - hi
            - it
            - it_it
            - nl
            - nl_be
            - nl_nl
            - pl
            - pl_pl
            - pt
            - pt_br
            - pt_pt
            - sh
            - sh_sp
            - sk
            - sk_sk
            - sv
            - sv_se
        pt_br:
          title: SMS and E-mail configuration
          type: object
          $ref: '#/components/schemas/2fa.configuration.requests.locale'
      required:
        - default
    2fa.configuration.requests.delivery:
      title: Delivery properties
      type: object
      description: Delivery properties
      properties:
        maxAttempts:
          title: Max Attempts
          type: number
          description: Max attempts a user can request to receive a token
          default: 1
          minimum: 1
          maximum: 5
        minIntervalSeconds:
          title: Min Interval In Seconds
          type: number
          description: Minimum interval in seconds that a user is required to wait to be able to request a resend of the token
          default: 60
          minimum: 60
          maximum: 120
    2fa.configuration.requests.email:
      title: Email configuration
      description: Information to send the token using E-mail
      type: object
      properties:
        from:
          description: Email sender id
          type: string
        type:
          default: email
          type: string
          description: Type of message to be sent
          example: email
        subject:
          type: string
          description: The E-mail subject
          example: Authentication code
          minLength: 1
        html:
          type: string
          description: Default text to be sent
          default: 'Hello {{name}}! Your code is {{code}}'
      required:
        - from
        - subject
    2fa.configuration.requests.locale:
      title: Configurations by locales
      description: It's possible to configure different settings to different locations. It's required to configure at least one channel `(sms or email)`
      type: object
      properties:
        sms:
          title: SMS config
          description: SMS configuration details
          type: object
          $ref: '#/components/schemas/2fa.configuration.requests.sms'
        email:
          title: E-mail config
          description: Email configuration details
          type: object
          $ref: '#/components/schemas/2fa.configuration.requests.email'
    2fa.configuration.requests.patch-config:
      title: Patch configuration
      type: object
      description: Patch configuration
      properties:
        op:
          type: string
          description: Token configuration update operation type
          enum:
            - replace
            - add
            - remove
          example: replace
        path:
          type: string
          description: The path inside the token configuration object
          example: /token
        value:
          type: object
          description: 'The value to replace, add, or remove'
          example:
            size: 6
            mode: NUMBER
            case: UPPER_ONLY
      required:
        - op
        - path
        - value
    2fa.configuration.requests.sms:
      title: SMS configuration
      description: Information to send the token using SMS
      type: object
      properties:
        from:
          type: string
          example: '559999999999'
          description: SMS sender id
        type:
          default: text
          type: string
          description: Type of message to be sent
          example: text
        text:
          type: string
          description: Default text to be sent
          default: 'Hello {{name}}! Your code is {{code}}'
      required:
        - from
    2fa.configuration.requests.token:
      title: Token properties
      description: Information about the token properties
      type: object
      properties:
        size:
          title: Token size
          type: number
          description: Number of characters of the token to be sent to the user
          example: 6
          maximum: 12
          minimum: 6
        mode:
          title: Token mode
          type: string
          description: The type of the token to be sent
          enum:
            - NUMBER
            - ALPHANUMERIC
            - ALPHANUMERIC_SUBSET
          default: NUMBER
          example: NUMBER
        case:
          title: String case type
          description: Type of the token case
          type: string
          enum:
            - UPPER_ONLY
            - LOWER_ONLY
            - MIXED
          default: UPPER_ONLY
          example: UPPER_ONLY
      required:
        - size
    2fa.configuration.requests.verify:
      title: Verification properties
      type: object
      description: Verification properties
      properties:
        maxAttempts:
          type: number
          description: Possible number of attempts for user to verify a token
          default: 3
          minimum: 3
        expireMinutes:
          type: number
          description: Time to expire token in minutes
          default: 1
          minimum: 1
          maximum: 10
    2fa.configuration.requests.website:
      title: Website domains
      description: Information needed to use this two factor authentication API service on a website
      type: object
      properties:
        domains:
          title: List of Domains
          type: array
          description: List of client domains allowed to use the two-factor authentication service
          items:
            type: string
          example:
            - app.zenvia.com
        websiteKey:
          type: string
          description: The platform generates a key that the client's frontend must use to identify itself
          readOnly: true
          example: XXXXXXXXXXXXXX
    2fa.configuration.responses.base:
      title: Token Configuration Creation
      type: array
      description: Token configuration created response
      items:
        type: object
        properties:
          id:
            title: Token Configuration Id
            type: string
            description: The configuration's unique Id
            example: 11401560-bffb-4ef3-a08e-989a15ed3c32
          token:
            $ref: '#/components/schemas/2fa.configuration.requests.token'
          verify:
            $ref: '#/components/schemas/2fa.configuration.requests.verify'
          delivery:
            $ref: '#/components/schemas/2fa.configuration.requests.delivery'
          content:
            $ref: '#/components/schemas/2fa.configuration.requests.content'
          website:
            $ref: '#/components/schemas/2fa.configuration.requests.website'
          createdAt:
            title: Creation Timestamp
            description: Timestamp of the configuration token creation
            type: string
            example: '2022-10-27T13:25:11.354Z'
          updatedAt:
            title: Update timestamp
            description: Timestamp of the token updates
            type: string
            example: '2022-10-27T13:25:11.354Z'
    2fa.configuration.responses.token-created:
      title: Token Configuration Creation
      type: object
      description: Token configuration created response
      properties:
        id:
          title: Token Configuration Id
          type: string
          description: The configuration's unique Id
          example: 11401560-bffb-4ef3-a08e-989a15ed3c32
        token:
          $ref: '#/components/schemas/2fa.configuration.requests.token'
        verify:
          $ref: '#/components/schemas/2fa.configuration.requests.verify'
        delivery:
          $ref: '#/components/schemas/2fa.configuration.requests.delivery'
        content:
          $ref: '#/components/schemas/2fa.configuration.requests.content'
        website:
          $ref: '#/components/schemas/2fa.configuration.requests.website'
        createdAt:
          title: Creation Timestamp
          description: Timestamp of the configuration token creation
          type: string
          example: '2022-10-27T13:25:11.354Z'
        updatedAt:
          title: Update timestamp
          description: Timestamp of the token updates
          type: string
          example: '2022-10-27T13:25:11.354Z'
    2fa.configuration.responses.websitekey-recreated:
      title: Token Configuration Creation
      type: object
      description: Token configuration created response
      properties:
        websiteKey:
          type: string
          description: The platform generates a key that the client's frontend must use to identify itself
          readOnly: true
          example: XXXXXXXXXXXXXX
    2fa.token.requests.code:
      title: code
      type: object
      description: Code sent by the user
      properties:
        code:
          type: string
          description: Code sent by the user
          example: '269878'
    2fa.token.requests.recipient:
      type: object
      properties:
        to:
          type: string
          description: User recipient
          example: email@email.com
        channel:
          type: string
          description: Channel used
          example: email
        code:
          type: string
          description: Code sent by the user
          example: '269878'
      required:
        - to
        - channel
        - code
    2fa.token.requests.to-channel:
      type: object
      properties:
        to:
          type: string
          description: User recipient
          example: email@email.com
        channel:
          type: string
          description: Channel used to send the token
          example: email
      required:
        - to
        - channel
    2fa.token.requests.token:
      type: object
      properties:
        configurationId:
          type: string
          description: Unique configuration Id
          example: 0f25c816-478d-4729-a600-b6b0124b4b9e
        to:
          description: Contact number or e-mail to send the token
          type: string
          example: '5511999999999'
        channel:
          description: Channel to be used to send the token
          type: string
          enum:
            - sms
            - email
          example: sms
        locale:
          description: 'Choose one configured locale, if left blank the default locale will be used'
          type: string
          example: pt_br
        fields:
          type: object
          properties:
            name:
              type: string
              description: Name of the user who will receive the code
              example: Josh Doe
      required:
        - configurationId
        - to
        - channel
        - fields
    2fa.token.responses.token-verified:
      type: object
      properties:
        id:
          type: string
          description: Token Id
          example: 7388c68e-675e-435b-b2ec-f72677798678
        from:
          type: string
          description: Contact of origin
          example: email@email.com
        to:
          type: string
          description: Recipient contact
          example: received_email@email.com
        channel:
          type: string
          description: Channel used
          enum:
            - sms
            - email
          example: email
        locale:
          type: string
          description: Location configured
          example: pt_br
        configurationId:
          type: string
          description: Token Configuration Id
          example: 88ff8743-22ba-44db-850b-5f54d6442cdd
        fields:
          type: object
          description: Fields with key words of the text that will be sent to the user
          properties:
            name:
              type: string
              description: Name of the user who will receive the code
              example: Josh Doe
        status:
          type: string
          description: Status of the generated token
          enum:
            - PENDING
            - CANCELED
            - VERIFIED
          example: VERIFIED
        remoteip:
          type: string
          description: Ip of the user making the request to be authenticated
          example: '127.0.0.1:80'
        verify:
          $ref: '#/components/schemas/2fa.configuration.requests.verify'
        delivery:
          $ref: '#/components/schemas/2fa.configuration.requests.delivery'
        expiresAt:
          title: Expiration timestamp
          type: string
          description: Timestamp of the expiration date
          example: '2022-10-27T13:26:11.354Z'
        createdAt:
          title: Creation timestamp
          type: string
          description: Timestamp of token creation.
          example: '2022-10-27T13:25:11.354Z'
        updatedAt:
          title: Update timestamp
          type: string
          description: Timestamp of updates
          example: '2022-10-27T13:25:11.354Z'
    2fa.token.responses.token:
      type: object
      properties:
        id:
          type: string
          description: Token Id
          example: 7388c68e-675e-435b-b2ec-f72677798678
        from:
          type: string
          description: Contact of origin
          example: email@email.com
        to:
          type: string
          description: Recipient contact
          example: received_email@email.com
        channel:
          type: string
          description: Channel used
          enum:
            - sms
            - email
          example: email
        locale:
          type: string
          description: Configured locale
          example: pt_br
        configurationId:
          type: string
          description: Token Configuration Id
          example: 88ff8743-22ba-44db-850b-5f54d6442cdd
        fields:
          type: object
          description: Fields with key words of the text that will be sent to the user
          properties:
            name:
              type: string
              description: Name of the user who will receive the code
              example: Josh Doe
        status:
          type: string
          description: Status of the generated token
          enum:
            - PENDING
            - CANCELED
            - VERIFIED
          example: PENDING
        remoteip:
          type: string
          description: Ip of the user making the request to be authenticated
          example: '127.0.0.1:80'
        verify:
          $ref: '#/components/schemas/2fa.configuration.requests.verify'
        delivery:
          $ref: '#/components/schemas/2fa.configuration.requests.delivery'
        expiresAt:
          title: Expiration timestamp
          type: string
          description: Timestamp of the expiration date
          example: '2022-10-27T13:26:11.354Z'
        createdAt:
          title: Creation timestamp
          type: string
          description: Timestamp of token creation.
          example: '2022-10-27T13:25:11.354Z'
        updatedAt:
          title: Update timestamp
          type: string
          description: Timestamp of updates
          example: '2022-10-27T13:25:11.354Z'
    batches.base:
      title: Batch Object
      description: This is a Batch object model
      type: object
      properties:
        id:
          title: Batch ID
          description: Batch identifier created automatically
          type: string
          example: ad48e792-7d6e-464f-a478-df3239475016
          readOnly: true
        name:
          title: Batch Name
          description: Batch identification name
          type: string
          example: My batch name
        channel:
          title: Channel
          description: Message channel
          type: string
      required:
        - name
        - channel
    batches.multipart-batch:
      title: Batch Object
      description: This is a Batch object model
      oneOf:
        - $ref: '#/components/schemas/batches.multipart.batch.sms'
        - $ref: '#/components/schemas/batches.multipart.batch.whatsapp'
        - $ref: '#/components/schemas/batches.multipart.batch.rcs'
        - $ref: '#/components/schemas/batches.multipart.batch.email'
      discriminator:
        propertyName: channel
        mapping:
          sms: '#/components/schemas/batches.multipart.batch.sms'
          whatsapp: '#/components/schemas/batches.multipart.batch.whatsapp'
          rcs: '#/components/schemas/batches.multipart.batch.rcs'
          email: '#/components/schemas/batches.multipart.batch.email'
    batches.multipart.base:
      title: Batch Object
      description: This is a Batch object model
      type: object
      allOf:
        - $ref: '#/components/schemas/batches.base'
        - type: object
          properties:
            columnMapper:
              $ref: '#/components/schemas/batches.multipart.columnMapper'
            message:
              $ref: '#/components/schemas/batches.multipart.message'
          required:
            - message
            - columnMapper
    batches.multipart.batch.email:
      allOf:
        - $ref: '#/components/schemas/batches.multipart.base'
        - type: object
          properties:
            message:
              type: object
              properties:
                contents:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/batches.multipart.content.template'
                    discriminator:
                      propertyName: type
                      mapping:
                        template: '#/components/schemas/batches.multipart.content.template'
    batches.multipart.batch.rcs:
      allOf:
        - $ref: '#/components/schemas/batches.multipart.base'
        - type: object
          properties:
            message:
              type: object
              properties:
                contents:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/batches.multipart.content.text'
                      - $ref: '#/components/schemas/batches.multipart.content.template'
                    discriminator:
                      propertyName: type
                      mapping:
                        template: '#/components/schemas/batches.multipart.content.template'
                        text: '#/components/schemas/batches.multipart.content.text'
    batches.multipart.batch.sms:
      allOf:
        - $ref: '#/components/schemas/batches.multipart.base'
        - type: object
          properties:
            message:
              type: object
              properties:
                contents:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/batches.multipart.content.text'
                    discriminator:
                      propertyName: type
                      mapping:
                        text: '#/components/schemas/batches.multipart.content.text'
    batches.multipart.batch.whatsapp:
      allOf:
        - $ref: '#/components/schemas/batches.multipart.base'
        - type: object
          properties:
            message:
              type: object
              properties:
                contents:
                  type: array
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/batches.multipart.content.template'
                    discriminator:
                      propertyName: type
                      mapping:
                        template: '#/components/schemas/batches.multipart.content.template'
    batches.multipart.columnMapper:
      title: Column Mapper
      description: 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.
      type: object
      example:
        recipient_header_name: recipient_number_column
        name: recipient_name_column
        protocol: protocol_column
      properties:
        recipient_header_name:
          title: Recipient header name
          description: Recipient header name
          type: string
          example: recipient_header_name
      additionalProperties:
        title: Column Name
        description: Values on the column provided as value will be made available as a variable named after the property name.
        type: string
      required:
        - recipient_header_name
    batches.multipart.message:
      title: Message Object
      description: This is a Message object model
      type: object
      properties:
        from:
          title: Sender ID
          description: The identifier of the sender of the message. The sender shoud be created with a credential.
          type: string
        contents:
          title: Message Contents
          description: A list of content to be sent
          type: array
          minItems: 1
          items:
            type: object
      required:
        - from
        - contents
    batches.multipart.content.template:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: template
            templateId:
              type: string
              description: 'The template identifier. Click <a href="https://app.zenvia.com/home/templates" target="_blank">here</a> to go to the template page.'
              example: c2c3e42d-6fb7-4ad6-897a-dd7613469f58
          required:
            - type
            - templateId
    batches.multipart.content.text:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: text
            text:
              description: 'Text to be sent to all recipients in the contact file. The text supports the use of variables, for its creation the following pattern must be used: **{{variable}}**'
              type: string
              example: 'Hello {{name}} your service protocol is number {{protocol}}'
          required:
            - type
            - text
    chatbot.chatbot-outbound:
      title: Chatbot Outbound
      description: 'The customer can use this API to send communications to customers and, when the customer interacts, it must follow a specific flow, according to the Chatbot programming.'
      type: object
      required:
        - from
        - to
        - channel
        - contents
      properties:
        id:
          type: number
          description: Outbound message identifier in NLU
          example: 1293
          readOnly: true
        channelId:
          type: number
          description: Channel identifier in NLU
          example: 2
          readOnly: true
        contactId:
          type: number
          description: Contact identifier in NLU
          example: 9752
          readOnly: true
        messageId:
          type: string
          title: Message ID
          description: An ID for the message. It can be used for future message consulting or callback notifications.
          readOnly: true
        status:
          type: string
          description: Status of outbound trigger
          example: pending
          readOnly: true
        createdAt:
          title: Creation Timestamp
          description: Timestamp of the outbound message trigger
          type: string
          example: '2022-10-27T13:25:11.354Z'
          readOnly: true
        from:
          title: From
          description: Identifier of the channel to be triggered.
          type: string
          example: '551130309090'
          minLength: 1
        to:
          title: To
          description: User identifier according to the channel.
          type: string
          example: '44988776655'
          minLength: 1
        channel:
          title: Channel
          description: The channel name to be trigerred.
          type: string
          example: whatsapp
          minLength: 1
        contents:
          title: Contents
          description: Contents of template to trigger outbound.
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/content.template'
            discriminator:
              propertyName: type
              mapping:
                template: '#/components/schemas/content.template'
          minItems: 1
        nodeId:
          title: Node Id
          description: Node identifier in NLU.
          type: string
          example: node_6fb54f855f19a947
        attributes:
          title: Attributes
          description: Attributes of NLU contact to be set.
          type: object
          properties:
            name:
              title: Name
              description: Name
              type: string
              example: John
            email:
              title: Email
              description: Contact's email
              type: string
              example: john@doe.email.com
            cpf:
              title: CPF
              description: Contact's CPF
              type: string
              example: '11122233344'
            birthdate:
              title: Contact's birth date
              description: Contact's birthdate
              type: string
              example: '1970-06-13'
            gender:
              title: Gender
              description: Contact's gender
              type: string
              example: Male
            address:
              title: Address
              description: Contact's address fields
              type: object
              properties:
                postalCode:
                  description: Postal code
                  type: string
                  example: 11222-000
                street:
                  description: Street name
                  type: string
                  example: Street address
                number:
                  description: House number
                  type: number
                  example: 123
                complement:
                  description: House complement
                  type: string
                  example: Store 03
                district:
                  description: District name
                  type: string
                  example: District name
                city:
                  description: City name
                  type: string
                  example: City name
                state:
                  description: State abbreviation
                  type: string
                  example: SP
            extra:
              title: Extra
              description: '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.'
              type: object
              example:
                new_property: some_value
                identification_number2: ''
        restartContact:
          title: restartContact
          description: Parameter to reset context variables and create a new service in NLU.
          type: boolean
          example: true
        inactivityTime:
          title: inactivityTime
          description: '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.'
          type: number
          example: 2
    contacts-management.channel:
      title: Channel
      description: A single normalized contact communication channel. Select a channel type to see its fields. The channelList array accepts multiple entries of any mix of types.
      oneOf:
        - $ref: '#/components/schemas/contacts-management.channel.whatsapp'
        - $ref: '#/components/schemas/contacts-management.channel.phone'
        - $ref: '#/components/schemas/contacts-management.channel.email'
        - $ref: '#/components/schemas/contacts-management.channel.facebook'
        - $ref: '#/components/schemas/contacts-management.channel.instagram'
        - $ref: '#/components/schemas/contacts-management.channel.twitter'
        - $ref: '#/components/schemas/contacts-management.channel.meli'
      discriminator:
        propertyName: type
        mapping:
          whatsapp: '#/components/schemas/contacts-management.channel.whatsapp'
          phone: '#/components/schemas/contacts-management.channel.phone'
          email: '#/components/schemas/contacts-management.channel.email'
          facebook: '#/components/schemas/contacts-management.channel.facebook'
          instagram: '#/components/schemas/contacts-management.channel.instagram'
          twitter: '#/components/schemas/contacts-management.channel.twitter'
          meli: '#/components/schemas/contacts-management.channel.meli'
    contacts-management.contact-channelList:
      title: Contact
      description: Contact information.
      type: object
      properties:
        id:
          title: ID
          description: ID of the contact.
          type: string
          readOnly: true
        channelList:
          title: Channel List
          description: 'The recommended list to define contact communication channels. You can add any combination of supported channel types here (WhatsApp, Email, Phone, Facebook, Instagram, Twitter, Meli). channelList cannot be used together with channels.'
          type: array
          items:
            $ref: '#/components/schemas/contacts-management.channel'
        firstName:
          title: First Name
          description: Contact's name.
          type: string
          example: Rafael
        lastName:
          title: Last Name
          description: Contact's surname.
          type: string
          example: Souza
        birthdate:
          title: Birthdate
          description: Contact's birthdate
          type: string
          example: '1970-06-13'
        customData:
          title: Custom Data
          description: 'Set values for contact custom data fields created on [contact data fields API](#tag/Contacts/paths/~1contacts-data-fields/post).'
          type: object
          additionalProperties:
            title: Value
            description: 'Sets a value to a contact custom data field (the property name). Contact custom data fields are global across contacts and must be previously created on [contact data fields API](#tag/Contacts/paths/~1contacts-data-fields/post).<br>Remember that dates are serialized as `string`.'
            oneOf:
              - type: string
                title: String/Date
                example: '2022-06-13'
              - type: number
                title: Number
                example: 10
              - type: boolean
                title: Boolean
                example: true
        addresses:
          title: Addresses
          description: Contact's addresses.
          type: array
          items:
            title: Address
            description: Address object.
            type: object
            properties:
              country:
                title: Country
                description: Address country.
                type: string
                example: Brazil
              zipcode:
                title: Zip Code
                description: Address zip code.
                type: string
                example: 01310-300
              state:
                title: State
                description: Address state or region.
                type: string
                example: SP
              city:
                title: City
                description: Address city.
                type: string
                example: São Paulo
              address:
                title: Address
                description: Street address.
                type: string
                example: Av. Paulista
              streetNumber:
                title: Street Number
                description: Street number.
                type: string
                example: '2300'
              neighborhood:
                title: Neighborhood
                description: Address neighborhood or address line 3.
                type: string
                example: Bela Vista
        listIds:
          title: List IDs
          description: IDs of the lists the contact is included in.
          type: array
          items:
            type: string
          example:
            - list-id-01
            - list-id-02
            - list-id-03
        createdAt:
          title: Created At
          description: Timestamp of the contact creation.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
        updatedAt:
          title: Updated At
          description: Timestamp of the contact update.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
      required:
        - channelList
    contacts-management.contact-custom-data-field:
      title: Contact Custom Data Field
      description: Definition of a field which can be provided on a contact data.
      type: object
      properties:
        id:
          title: ID
          description: 'ID of the contact data field to be created. This will be field name to be used on the [contacts API](#tag/Contacts/paths/~1contacts/post).'
          type: string
          example: my_field
          readOnly: true
        name:
          title: Name
          description: 'Friendly name for the field. This is used on user interfaces like [Zenvia Campaign](https://app.zenvia.com/campaign).'
          type: string
          example: My Field
        type:
          title: Type
          description: The type of values stored in this field. It affects validation and rendering in user interfaces.
          type: string
          example: date
          enum:
            - string
            - number
            - date
          default: string
        createdAt:
          title: Created At
          description: Timestamp of the contact data field creation.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
      required:
        - name
    contacts-management.contact-list:
      title: Contact List
      description: List of contacts.
      type: object
      properties:
        id:
          title: ID
          description: ID of the contact list.
          type: string
          readOnly: true
        name:
          title: Name
          description: Contact list's name.
          type: string
          example: Technology interest
        size:
          title: Size
          description: Number of contacts are in the list.
          type: number
          example: 10
          readOnly: true
        createdAt:
          title: Created At
          description: Timestamp of the contact list creation.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
        updatedAt:
          title: Updated At
          description: Timestamp of the contact list update.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
    contacts-management.contact:
      title: Contact
      description: Contact information.
      type: object
      properties:
        id:
          title: ID
          description: ID of the contact.
          type: string
          readOnly: true
        channels:
          title: Channels
          description: 'Contact communication channels. Status: Deprecated. This parameter is no longer recommended, but it remains fully functional. At least one communication channel must be provided. We highly encourage using the newer channelList parameter instead. Note: channels and channelList cannot be used together.'
          type: object
          minProperties: 1
          deprecated: true
          properties:
            email:
              title: E-mail
              description: Contact's e-mail address.
              type: string
              example: contact@domain.example
            mobile:
              title: Mobile
              description: Contact's mobile phone number.
              type: string
              pattern: '^[0-9]+$'
              example: '5510888883333'
            landline:
              title: Landline
              description: Contact's landline phone number.
              type: string
              pattern: '^[0-9]+$'
              example: '551044443333'
            facebook:
              title: Facebook
              description: Contact's Facebook ID.
              type: string
              pattern: '^[a-zA-Z0-9._@-]+$'
              example: user.name.123
            instagram:
              title: Instagram
              description: Contact's Instagram ID.
              type: string
              pattern: '^[a-zA-Z0-9._-]+$'
              example: user_name
            twitter:
              title: Twitter
              description: Contact's Twitter handle.
              type: string
              pattern: '^@[a-zA-Z0-9_]{1,15}$'
              example: '@username'
            meli:
              title: Mercado Livre
              description: Contact's Mercado Livre ID.
              type: string
              pattern: '^[a-zA-Z0-9._-]+$'
              example: meliUser_123
        firstName:
          title: First Name
          description: Contact's name.
          type: string
          example: Rafael
        lastName:
          title: Last Name
          description: Contact's surname.
          type: string
          example: Souza
        birthdate:
          title: Birthdate
          description: Contact's birthdate
          type: string
          example: '1970-06-13'
        customData:
          title: Custom Data
          description: 'Set values for contact custom data fields created on [contact data fields API](#tag/Contacts/paths/~1contacts-data-fields/post).'
          type: object
          additionalProperties:
            title: Value
            description: 'Sets a value to a contact custom data field (the property name). Contact custom data fields are global across contacts and must be previously created on [contact data fields API](#tag/Contacts/paths/~1contacts-data-fields/post).<br>Remember that dates are serialized as `string`.'
            oneOf:
              - type: string
                title: String/Date
                example: '2022-06-13'
              - type: number
                title: Number
                example: 10
              - type: boolean
                title: Boolean
                example: true
        addresses:
          title: Addresses
          description: Contact's addresses.
          type: array
          items:
            title: Address
            description: Address object.
            type: object
            properties:
              country:
                title: Country
                description: Address country.
                type: string
                example: Brazil
              zipcode:
                title: Zip Code
                description: Address zip code.
                type: string
                example: 01310-300
              state:
                title: State
                description: Address state or region.
                type: string
                example: SP
              city:
                title: City
                description: Address city.
                type: string
                example: São Paulo
              address:
                title: Address
                description: Street address.
                type: string
                example: Av. Paulista
              streetNumber:
                title: Street Number
                description: Street number.
                type: string
                example: '2300'
              neighborhood:
                title: Neighborhood
                description: Address neighborhood or address line 3.
                type: string
                example: Bela Vista
        listIds:
          title: List IDs
          description: IDs of the lists the contact is included in.
          type: array
          items:
            type: string
          example:
            - list-id-01
            - list-id-02
            - list-id-03
        createdAt:
          title: Created At
          description: Timestamp of the contact creation.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
        updatedAt:
          title: Updated At
          description: Timestamp of the contact update.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
      required:
        - channels
    contacts-management.channel.email:
      title: E-mail
      type: object
      properties:
        type:
          title: Type
          description: Contact communication channel type.
          type: string
          enum:
            - email
          example: email
        id:
          title: ID
          description: Contact's e-mail address.
          type: string
          pattern: '^[^@\s]+@[^@\s]+\.[^@\s]+$'
          example: contact@domain.example
      required:
        - type
        - id
    contacts-management.channel.facebook:
      title: Facebook
      type: object
      properties:
        type:
          title: Type
          description: Contact communication channel type.
          type: string
          enum:
            - facebook
          example: facebook
        id:
          title: ID
          description: Contact's Facebook ID.
          type: string
          pattern: '^[a-zA-Z0-9._@-]+$'
          example: user.name.123
      required:
        - type
        - id
    contacts-management.channel.instagram:
      title: Instagram
      type: object
      properties:
        type:
          title: Type
          description: Contact communication channel type.
          type: string
          enum:
            - instagram
          example: instagram
        id:
          title: ID
          description: Contact's Instagram ID.
          type: string
          pattern: '^[a-zA-Z0-9._-]+$'
          example: user_name
        username:
          title: Username
          description: Username associated with the channel.
          type: string
          example: '@username'
      required:
        - type
        - id
    contacts-management.channel.meli:
      title: Mercado Livre
      type: object
      properties:
        type:
          title: Type
          description: Contact communication channel type.
          type: string
          enum:
            - meli
          example: meli
        id:
          title: ID
          description: Contact's Mercado Livre ID.
          type: string
          pattern: '^[a-zA-Z0-9._-]+$'
          example: meliUser_123
      required:
        - type
        - id
    contacts-management.channel.phone:
      title: Phone
      type: object
      properties:
        type:
          title: Type
          description: Contact communication channel type.
          type: string
          enum:
            - phone
          example: phone
        id:
          title: ID
          description: Contact's phone number.
          type: string
          pattern: '^[0-9]+$'
          example: '5510888883333'
        idType:
          title: ID Type
          description: Type of the phone number. Values are case-insensitive.
          type: string
          enum:
            - landline
            - mobile
            - LANDLINE
            - MOBILE
          example: mobile
      required:
        - type
        - id
        - idType
    contacts-management.channel.twitter:
      title: Twitter
      type: object
      properties:
        type:
          title: Type
          description: Contact communication channel type.
          type: string
          enum:
            - twitter
          example: twitter
        id:
          title: ID
          description: Contact's Twitter handle.
          type: string
          pattern: '^@[a-zA-Z0-9_]{1,15}$'
          example: '@username'
      required:
        - type
        - id
    contacts-management.channel.whatsapp:
      title: WhatsApp
      type: object
      properties:
        type:
          title: Type
          description: Contact communication channel type.
          type: string
          enum:
            - whatsapp
          example: whatsapp
        id:
          title: ID
          description: 'Contact''s WhatsApp identifier. Either a phone number (digits only) or a bsuid prefixed with the ISO 3166 alpha-2 two-letter country code and a period, followed by up to 128 alphanumeric characters (for example, US.13491208655302741918).'
          type: string
          pattern: '^([0-9]+|[A-Z]{2}\.[A-Za-z0-9]{1,128})$'
          example: US.13491208655302741918
        idType:
          title: ID Type
          description: Type of the WhatsApp ID.
          type: string
          enum:
            - bsuid
            - parent_bsuid
          example: bsuid
        username:
          title: Username
          description: Username associated with the channel.
          type: string
        senderId:
          title: Sender ID
          description: Sender identifier associated with the channel.
          type: string
      required:
        - type
        - id
        - idType
    contacts-management.responses.contact-response:
      title: Contact
      description: Contact information.
      type: object
      properties:
        id:
          title: ID
          description: ID of the contact.
          type: string
          readOnly: true
        channelList:
          title: Channel List
          description: 'List of normalized contact communication channels. Note: preferably use channelList; channels and channelList cannot be used together'
          type: array
          items:
            $ref: '#/components/schemas/contacts-management.channel'
        channels:
          title: Channels
          description: 'Deprecated: use channelList instead. Contact communication channels. At least one communication channel must be provided.'
          type: object
          minProperties: 1
          deprecated: true
          properties:
            email:
              title: E-mail
              description: Contact's e-mail address.
              type: string
              example: contact@domain.example
            mobile:
              title: Mobile
              description: Contact's mobile phone number.
              type: string
              pattern: '^[0-9]+$'
              example: '5510888883333'
            landline:
              title: Landline
              description: Contact's landline phone number.
              type: string
              pattern: '^[0-9]+$'
              example: '551044443333'
            facebook:
              title: Facebook
              description: Contact's Facebook ID.
              type: string
              pattern: '^[a-zA-Z0-9._@-]+$'
              example: user.name.123
            instagram:
              title: Instagram
              description: Contact's Instagram ID.
              type: string
              pattern: '^[a-zA-Z0-9._-]+$'
              example: user_name
            twitter:
              title: Twitter
              description: Contact's Twitter handle.
              type: string
              pattern: '^@[a-zA-Z0-9_]{1,15}$'
              example: '@username'
            meli:
              title: Mercado Livre
              description: Contact's Mercado Livre ID.
              type: string
              pattern: '^[a-zA-Z0-9._-]+$'
              example: meliUser_123
        firstName:
          title: First Name
          description: Contact's name.
          type: string
          example: Rafael
        lastName:
          title: Last Name
          description: Contact's surname.
          type: string
          example: Souza
        birthdate:
          title: Birthdate
          description: Contact's birthdate
          type: string
          example: '1970-06-13'
        customData:
          title: Custom Data
          description: 'Set values for contact custom data fields created on [contact data fields API](#tag/Contacts/paths/~1contacts-data-fields/post).'
          type: object
          additionalProperties:
            title: Value
            description: 'Sets a value to a contact custom data field (the property name). Contact custom data fields are global across contacts and must be previously created on [contact data fields API](#tag/Contacts/paths/~1contacts-data-fields/post).<br>Remember that dates are serialized as `string`.'
            oneOf:
              - type: string
                title: String/Date
                example: '2022-06-13'
              - type: number
                title: Number
                example: 10
              - type: boolean
                title: Boolean
                example: true
        addresses:
          title: Addresses
          description: Contact's addresses.
          type: array
          items:
            title: Address
            description: Address object.
            type: object
            properties:
              country:
                title: Country
                description: Address country.
                type: string
                example: Brazil
              zipcode:
                title: Zip Code
                description: Address zip code.
                type: string
                example: 01310-300
              state:
                title: State
                description: Address state or region.
                type: string
                example: SP
              city:
                title: City
                description: Address city.
                type: string
                example: São Paulo
              address:
                title: Address
                description: Street address.
                type: string
                example: Av. Paulista
              streetNumber:
                title: Street Number
                description: Street number.
                type: string
                example: '2300'
              neighborhood:
                title: Neighborhood
                description: Address neighborhood or address line 3.
                type: string
                example: Bela Vista
        listIds:
          title: List IDs
          description: IDs of the lists the contact is included in.
          type: array
          items:
            type: string
          example:
            - list-id-01
            - list-id-02
            - list-id-03
        createdAt:
          title: Created At
          description: Timestamp of the contact creation.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
        updatedAt:
          title: Updated At
          description: Timestamp of the contact update.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
    content.all:
      anyOf:
        - $ref: '#/components/schemas/content.whatsapp.all'
        - $ref: '#/components/schemas/content.instagram.all'
        - $ref: '#/components/schemas/content.sms.all'
        - $ref: '#/components/schemas/content.facebook.all'
        - $ref: '#/components/schemas/content.rcs.all'
        - $ref: '#/components/schemas/content.voice.all'
        - $ref: '#/components/schemas/content.telegram.all'
        - $ref: '#/components/schemas/content.gbm.all'
        - $ref: '#/components/schemas/content.email.all'
    content.base:
      type: object
      properties:
        type:
          title: Content type
          description: Content type discriminator
          type: string
      required:
        - type
    content.call:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: call
            audio:
              description: A sequence of audio bits forming a message to be played at the beginning of the call
              type: array
              items:
                $ref: '#/components/schemas/content.audio-sources.all'
            transferTo:
              description: Transfer or call to another number when the audio message has been completely played
              type: string
              example: '5510999999999'
            recordAudio:
              description: Record the call
              type: boolean
              example: true
            hangUpOnVoiceMail:
              description: End the call on voicemail
              type: boolean
              example: true
          required:
            - type
    content.card:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - $ref: '#/components/schemas/content.bases.card-base'
        - type: object
          properties:
            type:
              type: string
              example: card
            media:
              type: object
              allOf:
                - $ref: '#/components/schemas/content.bases.card-media-base'
                - type: object
                  properties:
                    disposition:
                      type: string
                      description: |-
                        Defines the position that the media will be shown inside the card. Some of the values influence the media height.
                                        <br><br>*Only applicable to [RCS](#tag/RCS) and [Google Business Messages](#tag/Google-Business-Messages) channels.*
                                        <br>*`ON_THE_LEFT` and `ON_THE_RIGHT` are only supported by [RCS](#tag/RCS) channel.*
                      enum:
                        - ON_THE_LEFT
                        - ON_THE_RIGHT
                        - ON_THE_TOP_SHORT_HEIGHT
                        - ON_THE_TOP_MEDIUM_HEIGHT
                        - ON_THE_TOP_TALL_HEIGHT
                      default: ON_THE_TOP_SHORT_HEIGHT
            quickReplyButtons:
              $ref: '#/components/schemas/content.bases.quick-reply-list'
    content.carousel:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: carousel
            cardWidth:
              type: string
              description: |-
                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.
                          <br><br>*Only applicable to [RCS](#tag/RCS) and [Google Business Messages](#tag/Google-Business-Messages) channels.*
              enum:
                - SMALL
                - MEDIUM
              default: MEDIUM
            cards:
              title: Card
              description: The sequence of cards to be shown in the carousel.
              type: array
              minItems: 1
              maxItems: 10
              items:
                type: object
                allOf:
                  - $ref: '#/components/schemas/content.bases.card-base'
                  - type: object
                    properties:
                      media:
                        type: object
                        allOf:
                          - $ref: '#/components/schemas/content.bases.card-media-base'
                          - type: object
                            properties:
                              disposition:
                                type: string
                                description: |-
                                  Defines the position that the media will be shown inside the card. The values influence the media height.
                                                          <br><br>*Only applicable to [RCS](#tag/RCS) and [Google Business Messages](#tag/Google-Business-Messages) channels.*
                                enum:
                                  - ON_THE_TOP_SHORT_HEIGHT
                                  - ON_THE_TOP_MEDIUM_HEIGHT
                                  - ON_THE_TOP_TALL_HEIGHT
            quickReplyButtons:
              $ref: '#/components/schemas/content.bases.quick-reply-list'
          required:
            - type
            - cards
    content.contacts:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: contacts
            contacts:
              description: A list of contacts
              type: array
              items:
                type: object
                properties:
                  addresses:
                    description: A list of contact addresses
                    type: array
                    items:
                      type: object
                      properties:
                        street:
                          description: Street number and name
                          type: string
                          example: 'Street Address, 123'
                        city:
                          description: City name
                          type: string
                          example: City name
                        state:
                          description: State abbreviation
                          type: string
                          example: SP
                        zip:
                          description: ZIP code
                          type: string
                          example: 01000-000
                        country:
                          description: Full country name
                          type: string
                          example: Brazil
                        countryCode:
                          description: Two-letter country abbreviation
                          type: string
                          example: BR
                        type:
                          description: The type of the address
                          type: string
                          enum:
                            - HOME
                            - WORK
                          example: WORK
                    minItems: 0
                  birthday:
                    description: The birthday of the contact
                    type: string
                    example: 11/10/1980
                  contactImage:
                    description: Base64-encoded image. Its value has to be a string based on the Base64 Data Encodings specification (RFC 4648).
                    type: string
                  emails:
                    description: A list of e-mails
                    type: array
                    items:
                      type: object
                      properties:
                        email:
                          description: E-mail address
                          type: string
                          example: my-email@email-domain.com
                        type:
                          description: The type of e-mail
                          type: string
                          enum:
                            - HOME
                            - WORK
                          example: HOME
                    minItems: 0
                  ims:
                    description: A list of messaging contact information
                    type: array
                    items:
                      type: object
                      properties:
                        service:
                          description: Instant messaging service name
                          type: string
                          example: This is a messaging service
                        userId:
                          description: User identifier in this instant messaging service
                          type: string
                          example: johnsmith
                    minItems: 0
                  name:
                    description: Full contact name
                    type: object
                    properties:
                      formattedName:
                        description: Full name as it normally appears
                        type: string
                        example: John Megan Smith
                      firstName:
                        description: First name
                        type: string
                        example: John
                      lastName:
                        description: Last name
                        type: string
                        example: Smith
                      middleName:
                        description: Middle name
                        type: string
                        example: Megan
                      suffix:
                        description: Name suffix
                        type: string
                        example: PhD
                      prefix:
                        description: Name preffix
                        type: string
                        example: Mr.
                    required:
                      - formattedName
                      - firstName
                  org:
                    title: Organization
                    description: Contact organization information
                    type: object
                    properties:
                      company:
                        description: Name of the contact's company
                        type: string
                        example: Ms. Sara
                      department:
                        description: Name of the contact's department
                        type: string
                        example: Sales
                      title:
                        description: Contact's business title
                        type: string
                        example: Manager
                  phones:
                    description: A list of contact phone numbers
                    type: array
                    items:
                      type: object
                      properties:
                        phone:
                          description: Formatted phone number
                          type: string
                          example: '+5521999998888'
                        type:
                          description: The type of the phone number
                          type: string
                          enum:
                            - CELL
                            - MAIN
                            - IPHONE
                            - HOME
                            - WORK
                          example: CELL
                        waId:
                          description: 'WhatsApp ID _(supported channels: WhatsApp)_'
                          type: string
                    minItems: 0
                  urls:
                    description: A list of contact URLs
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          description: URL
                          type: string
                          example: 'https://www.zenvia.com'
                        type:
                          description: The type of the phone number
                          type: string
                          enum:
                            - HOME
                            - WORK
                          example: WORK
                    minItems: 0
                  role:
                    description: Role of the contact in the context of the interaction.
                    type: string
                    enum:
                      - self
                      - unknown
                    example: self
                    readOnly: true
                required:
                  - name
              minItems: 1
          required:
            - type
            - contacts
    content.conversation:
      title: Conversation Content
      type: object
      allOf:
        - type: object
          properties:
            solution:
              title: Solution Name
              type: string
              description: 'If the contact replies to the API message, the conversation will be redirected to the chosen solution.'
              enum:
                - conversion
                - zenvia_chat
                - nlu
            properties:
              title: Properties
              type: object
              description: 'If the contact replies to the API message, these properties will be available for querying in the chosen solution.'
          required:
            - solution
    content.email:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: email
            subject:
              type: string
              description: The e-mail subject
              example: 'Re: Ticket 12345'
              minLength: 1
            html:
              type: string
              maxLength: 32768
              description: |-
                The e-mail content in HTML format.
                                      <br>Inline attachment *is supported*. The *cid* of the content is the *fileName*.
                                      <br>Ex: `<img src="cid:example2.jpeg">`.
              example: '<b>Hi!</b><br><img src="cid:example2.jpeg">'
            attachments:
              type: array
              items:
                $ref: '#/components/schemas/content.bases.file'
              description: E-mail attachments.
              example:
                - fileUrl: 'https://zenvia.com/example1.pdf'
                - fileUrl: 'https://zenvia.com/example2.jpg'
                  fileName: example2.jpeg
            cc:
              type: array
              items:
                $ref: '#/components/schemas/content.email.recipient'
              title: Courtesy Copy
              description: List of e-mails addresses to be copied on the e-mail.
              example:
                - email: cc1@zenvia.com
                - email: cc2@zenvia.com
                  name: CC2
            bcc:
              type: array
              items:
                $ref: '#/components/schemas/content.email.recipient'
              title: Blind Courtesy Copy
              description: List of e-mails addresses to be secretly copied on the e-mail.
              example:
                - email: bcc1@zenvia.com
                - email: bcc2@zenvia.com
                  name: BCC2
            replyTo:
              allOf:
                - $ref: '#/components/schemas/content.email.reply-to'
          required:
            - type
            - subject
            - html
    content.file:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: file
          required:
            - type
            - fileUrl
        - $ref: '#/components/schemas/content.bases.file'
        - properties:
            fileCaption:
              type: string
              description: |-
                Some description for the file.
                                      <br>*Only applicable to [WhatsApp](#tag/WhatsApp), [RCS](#tag/RCS), [Telegram](#tag/Telegram) and [Google Business Messages](#tag/Google-Business-Messages) images and videos.*
              example: Some caption
    content.json:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: json
            payload:
              type: object
          required:
            - type
            - payload
    content.location:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: location
            longitude:
              type: number
              description: Longitude of the location
              example: -122.425332
            latitude:
              type: number
              description: Latitude of the location
              example: 37.758056
            name:
              type: string
              description: Name of the location
              example: Home
            address:
              type: string
              description: Address of the location. Only displayed if name is present.
              example: Home Address
            url:
              type: string
              description: 'URL for the website where the location information was downloaded _(WhatsApp restriction: available only on IN direction)_'
              example: 'https://www.zenvia.com'
          required:
            - type
            - longitude
            - latitude
    content.optin_request:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: optin_request
            mediaUrl:
              description: URL of an image to be displayed inside the opt-in request.
              type: string
              example: 'https://cdn.zenvia.com/main-picture.jpg'
            title:
              description: The topic of the recurring messages subscription. This will be displayed in the opt-in request.<br>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.
              type: string
              example: Weekly Sale
            frequency:
              description: How often the messages will be sent after the contact opted-in.
              type: string
              enum:
                - DAILY
                - WEEKLY
                - MONTHLY
            reOptIn:
              description: Allow the contact to opt-in back again after opting-out.
              type: string
              enum:
                - ENABLED
                - DISABLED
              default: ENABLED
            payload:
              description: 'Content to be sent back as an [opt-in response](#section/OptIn-Response) message event when the contact accepts to receive recurring messages.<br>By default, the `title` of the request will be used as payload.'
              type: string
            timezone:
              description: Indicates the timezone that will be used for scheduling the recurring messages.<br>
              example: America/Sao_Paulo
              default: UTC
              type: string
          required:
            - title
            - frequency
    content.optin_response:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: optin_response
            recurringMessagesRecipient:
              type: string
              description: '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:
              type: string
              description: 'The timestamp when the opt-in will expire and no longer be usable, unless renewed.<br>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](#section/MESSAGE) with a new [OptIn Response](#section/OptIn-Response) will be sent.'
            optInStatus:
              title: OptIn Status
              description: 'Indicates whether this is a new opt-in, an opt-out, or a reopt-in.'
              type: string
              example: OPTIN
              enum:
                - OPTIN
                - OPTOUT
                - REOPTIN
            frequency:
              type: string
              description: How often the recurring messages may be sent.
              example: DAILY
              enum:
                - DAILY
                - WEEKLY
                - MONTHLY
            payload:
              type: string
              description: 'The payload set in the [opt-in request](#section/OptIn-Request) message of this opt-in response.'
    content.replyable-text:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.text'
        - type: object
          properties:
            type:
              type: string
              example: replyable_text
            quickReplyButtons:
              $ref: '#/components/schemas/content.bases.quick-reply-list'
    content.template:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: template
            templateId:
              type: string
              description: 'The template identifier. Click <a href="https://app.zenvia.com/home/templates" target="_blank">here</a> to go to the template page.'
              example: c2c3e42d-6fb7-4ad6-897a-dd7613469f58
            fields:
              type: object
              description: 'The available fields to be used in this template.<br><br>        For media templates, the media URL is obtained from `imageUrl`, `videoUrl` or `documentUrl` depending on the template used.<br><br>        For WhatsApp authentication templates, pass the `token` parameter and its value. It is required.<br><br>        For WhatsApp coupon templates, pass the `code` parameter and its value. It is required.'
              example:
                user: John Smith
                protocol: '34534252'
              oneOf:
                - title: Default
                  type: object
                  additionalProperties:
                    description: Value provided to fill the variable named after the property name.
                    oneOf:
                      - type: string
                        example: Zenvia
                      - type: number
                        example: 1
                      - type: boolean
                        example: true
                - title: Cards
                  type: object
                  required:
                    - cards
                  properties:
                    cards:
                      type: array
                      description: |-
                        The properties of the cards in a template.
                        In cards with a predefined order, each card will be rendered following its order at the time of the creation of the template.

                         Only applicable to [WhatsApp](#tag/WhatsApp) channel.
                      minItems: 2
                      maxItems: 10
                      items:
                        type: object
                        anyOf:
                          - title: Cards with dynamic ordering and image as background
                            required:
                              - orderPosition
                              - imageUrl
                            properties:
                              orderPosition:
                                description: 'Defines the final position of the card in the outcome. The array index indicates which card is being referenced, and the value of `orderPosition` determines its final position.'
                                type: number
                              imageUrl:
                                type: string
                                description: URL of the image
                            additionalProperties:
                              description: Value provided to fill the variable named after the property name.
                              oneOf:
                                - type: string
                                  example: Zenvia
                                - type: number
                                  example: 1
                                - type: boolean
                                  example: true
                          - title: Cards with dynamic ordering and video as background
                            required:
                              - orderPosition
                              - videoUrl
                            properties:
                              orderPosition:
                                description: 'Defines the final position of the card in the outcome. The array index indicates which card is being referenced, and the value of `orderPosition` determines its final position.'
                                type: number
                              videoUrl:
                                type: string
                                description: URL of the video
                            additionalProperties:
                              description: Value provided to fill the variable named after the property name.
                              oneOf:
                                - type: string
                                  example: Zenvia
                                - type: number
                                  example: 1
                                - type: boolean
                                  example: true
                          - title: Cards with predefined order and image as background
                            required:
                              - imageUrl
                            properties:
                              imageUrl:
                                type: string
                                description: URL of the image
                            additionalProperties:
                              description: Value provided to fill the variable named after the property name.
                              oneOf:
                                - type: string
                                  example: Zenvia
                                - type: number
                                  example: 1
                                - type: boolean
                                  example: true
                          - title: Cards with predefined order and video as background
                            required:
                              - videoUrl
                            properties:
                              videoUrl:
                                type: string
                                description: URL of the video
                            additionalProperties:
                              description: Value provided to fill the variable named after the property name.
                              oneOf:
                                - type: string
                                  example: Zenvia
                                - type: number
                                  example: 1
                                - type: boolean
                                  example: true
                - title: Product Sections
                  required:
                    - sections
                  type: object
                  properties:
                    sections:
                      $ref: '#/components/schemas/content.whatsapp.product-sections'
                  additionalProperties:
                    description: Value provided to fill the variable named after the property name.
                    oneOf:
                      - type: string
                        example: Zenvia
                      - type: number
                        example: 1
                      - type: boolean
                        example: true
          required:
            - type
            - templateId
    content.text:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: text
            text:
              description: |-
                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.
                          <br>*URL preview only applicable to [WhatsApp](#tag/WhatsApp) channel.*
              type: string
              example: This is a text.
              minLength: 1
            payload:
              description: Payload of selected button
              type: string
              readOnly: true
          required:
            - type
            - text
    content.audio-sources.all:
      oneOf:
        - $ref: '#/components/schemas/content.audio-sources.tts'
        - $ref: '#/components/schemas/content.audio-sources.file'
      discriminator:
        propertyName: type
        mapping:
          tts: '#/components/schemas/content.audio-sources.tts'
          file: '#/components/schemas/content.audio-sources.file'
    content.audio-sources.file:
      title: Audio file
      description: URL of audio
      type: object
      properties:
        type:
          type: string
        fileUrl:
          description: URL of audio
          type: string
          example: 'http://fooooo.bar/audio.mp3'
          minLength: 1
      required:
        - type
        - fileUrl
    content.audio-sources.tts:
      title: Text to speech
      description: Send a text to speech
      type: object
      properties:
        type:
          type: string
        text:
          description: Text that will be read on the call with the chosen voice type
          type: string
          example: This is a text
        voiceStyle:
          type: string
          description: Language and type of the audio message
          enum:
            - br-Camila
            - br-Vitoria
            - br-Ricardo
            - en-Joey
            - en-Joanna
            - fre-Celine
            - fre-Mathieu
            - ger-Vicki
            - ger-Hans
            - ita-Carla
            - ita-Giorgio
            - jap-Mizuki
            - pol-Jan
            - rus-Tatyana
            - rus-Maxim
            - esp-Conchita
            - esp-Enrique
          default: br-Vitoria
          example: br-Ricardo
        awaitRecipientAnswer:
          description: Await for the recipient answer
          type: boolean
          example: true
      required:
        - type
        - text
    content.bases.buttons-list:
      type: array
      title: Buttons
      description: |-
        Vertical list of buttons displayed inside a card. These will *not* fade away once a button is clicked.<br>
            <br>*[RCS](#tag/RCS): A maximum of 4 buttons is supported, but they might not be shown if they do not fit in the available space.*
            <br>*[Google Business Messages](#tag/Google-Business-Messages): A maximum of 4 buttons is supported. Supported types: `text`, `link` and `dial`.*
            <br>*[Instagram](#tag/Instagram): A maximum of 3 buttons is supported. Supported types: `text` and `link`.*
            <br>*[Facebook](#tag/Facebook): A maximum of 3 buttons is supported. Supported types: `text`, `link` and `dial`.*
            <br>*[Telegram](#tag/Telegram): Supported types: `link`.*
      maxItems: 4
      items:
        $ref: '#/components/schemas/content.bases.buttons.all'
    content.bases.card-base:
      type: object
      properties:
        title:
          type: string
          description: |-
            A title in bold shown above the text of the card.
                    <br>*[Instagram](#tag/Instagram): A maximum of 80 characters is supported.*
          example: Hello
        text:
          type: string
          description: |-
            A text to be displayed inside the card.
                    <br>*[Instagram](#tag/Instagram): A maximum of 80 characters is supported.*
          example: This is the best thing you will see today!
        media:
          type: object
        buttons:
          $ref: '#/components/schemas/content.bases.buttons-list'
    content.bases.card-media-base:
      type: object
      title: Media
      description: An image or a video to be displayed inside the card.
      properties:
        url:
          type: string
          description: |-
            Public URL of media file, which can be an image, a GIF, or a video. The media will be displayed inside the card.
                    <br><br>*Videos usually will display a play button instead of a preview of the content sent.*
                    <br>*Some channels do not support videos or GIFs.*
          example: 'https://zenvia.com/zenvia-team.png'
        disposition:
          type: string
          default: ON_THE_TOP_SHORT_HEIGHT
        caption:
          type: string
          description: |-
            Media content description used by screen readers to aid users with disability understand the context.
                    <br><br>*Only applicable to [RCS](#tag/RCS) and [Google Business Messages](#tag/Google-Business-Messages) channels.*
          example: Zenvia's team picture
      required:
        - url
    content.bases.file:
      type: object
      title: File
      properties:
        fileUrl:
          type: string
          description: URL of the file to be sent. The image at this URL should be publicly accessible and downloadable.
          example: 'https://zenvia.com/document.pdf'
        thumbnailUrl:
          type: string
          description: |-
            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..
                                  <br> Only applicable to *[RCS](#tag/RCS)*
          example: 'https://storage.com/image.png'
        thumbnailMimeType:
          type: string
          description: |-
            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.<br>
                                  <br> Only applicable to *[RCS](#tag/RCS)*
          example: image/png
        fileMimeType:
          type: string
          description: |-
            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.<br>
                                <br>*[WhatsApp](#tag/WhatsApp): see [supported contents and sizes.](#section/WhatsApp-limitations)*
                                <br>*[Instagram](#tag/Instagram): see [supported contents and sizes.](#section/Instagram-limitations)*
                                <br>*[Telegram](#tag/Telegram): see [supported contents and sizes.](#section/Telegram-limitations)*
                                <br>*[E-Mail](#tag/E-Mail): see [supported contents and sizes.](#section/E-Mail-limitations)*
                                <br>*For the rest of the channels, the limitations are currently undocumented.*
          example: application/pdf
        fileName:
          type: string
          description: |-
            The name of the file.
                                <br>*Only applicable to [WhatsApp](#tag/WhatsApp), [Facebook](#tag/Facebook), [Telegram](#tag/Telegram), [Google Business Messages](#tag/Google-Business-Messages) and [E-mail](#tag/E-Mail) documents.*
          example: document.pdf
        status:
          type: string
          description: |-
            The completion state of the file upload.
                                <br>*This property is read-only. It is only included in incoming webhooks that contain file content*
          enum:
            - ACCEPTED
            - REJECTED
        reason:
          type: string
          description: |-
            A concise code for the failure reason.
                                <br>*This property is read-only. It is only included in incoming webhooks that contain file content*
          enum:
            - MIME_TYPE_NOT_SUPPORTED
            - INTERNAL_ERROR
            - SECURITY_CHECK
            - SIZE_LIMIT
      required:
        - fileUrl
    content.bases.quick-reply-list:
      type: array
      title: Quick reply buttons
      description: |-
        Horizontal list of buttons displayed after the content. These *will* fade away once one is clicked.<br>
            <br>*[RCS](#tag/RCS): A maximum of 11 buttons is supported.*
            <br>*[Google Business Messages](#tag/Google-Business-Messages): Supported types: `text`, `link` and `dial`. A maximum of 25 characters is supported in each button.*
            <br>*[Instagram](#tag/Instagram): Supported type: `text`. A maximum of 20 characters is supported in each button.*
            <br>*[Facebook](#tag/Facebook): Supported type: `text`.*
            <br>*[Telegram](#tag/Telegram): Supported types: `text` and `share_location`.*
            <br><br>*Only applicable to [RCS](#tag/RCS) and [Google Business Messages](#tag/Google-Business-Messages) channels for [Cards](#section/Card) and [Carousels](#section/Carousel).*
      maxItems: 13
      items:
        $ref: '#/components/schemas/content.bases.buttons.all'
    content.bases.buttons.all:
      oneOf:
        - $ref: '#/components/schemas/content.bases.buttons.postback'
        - $ref: '#/components/schemas/content.bases.buttons.web-url'
        - $ref: '#/components/schemas/content.bases.buttons.calendar-event'
        - $ref: '#/components/schemas/content.bases.buttons.dial'
        - $ref: '#/components/schemas/content.bases.buttons.share-location'
        - $ref: '#/components/schemas/content.bases.buttons.view-location'
        - $ref: '#/components/schemas/content.bases.buttons.search-location'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/content.bases.buttons.postback'
          link: '#/components/schemas/content.bases.buttons.web-url'
          calendar_event: '#/components/schemas/content.bases.buttons.calendar-event'
          dial: '#/components/schemas/content.bases.buttons.dial'
          share_location: '#/components/schemas/content.bases.buttons.share-location'
          view_location: '#/components/schemas/content.bases.buttons.view-location'
          search_location: '#/components/schemas/content.bases.buttons.search-location'
    content.bases.buttons.base:
      type: object
      properties:
        type:
          title: Button type
          description: Button type discriminator.
          type: string
        text:
          type: string
          description: 'Text to be displayed inside the button.<br><br>*[RCS](#tag/RCS): Maximum of 25 characters.*'
          example: Click me!
        payload:
          type: string
          description: |-
            Content to be sent back as a message or a status event when the user clicks the button.
                    <br>By default, the text of the button will be used as payload.
                    <br><br>*Only applicable to `text` buttons on most channels, because there is no click feedback for the other button types.
                    Applicable to all button types on [RCS](#tag/RCS) and [Google Business Messages](#tag/Google-Business-Messages) channels.*
                    <br>*`text` buttons clicks are sent back as [message events](#section/MESSAGE), while clicks from the other button types are sent back as [status events](#section/MESSAGE_STATUS).*
          example: clicked-on-button-1
    content.bases.buttons.calendar-event:
      type: object
      description: Opens the standard calendar application on the user's device and creates a new event with the sent data.
      allOf:
        - $ref: '#/components/schemas/content.bases.buttons.base'
        - type: object
          properties:
            startTime:
              type: string
              description: Start date and time of the event formatted following RFC3339 standard (similar to ISO 8601). Default timezone is UTC.
              example: '2021-01-15T17:30:00-03:00'
            endTime:
              type: string
              description: End date and time of the event formatted following RFC3339 standard (similar to ISO 8601). Default timezone is UTC.
              example: '2021-01-15T17:30:00-03:00'
            title:
              type: string
              description: Event description.
              example: API development
          required:
            - type
            - text
            - startTime
            - endTime
            - title
    content.bases.buttons.dial:
      type: object
      description: It opens the default dial app on the user's device.
      allOf:
        - $ref: '#/components/schemas/content.bases.buttons.base'
        - type: object
          properties:
            phoneNumber:
              type: string
              description: Phone Number (E.164 format).
              example: '+558006464777'
          required:
            - type
            - text
            - phoneNumber
    content.bases.buttons.postback:
      type: object
      description: Send back a text message event when the user clicks on the button.
      allOf:
        - $ref: '#/components/schemas/content.bases.buttons.base'
        - type: object
          required:
            - type
            - text
    content.bases.buttons.search-location:
      type: object
      description: Opens the standard calendar application on the user's device and creates a new event with the sent data.
      allOf:
        - $ref: '#/components/schemas/content.bases.buttons.base'
        - type: object
          properties:
            query:
              type: string
              description: 'A text, for example, an address or a company name, to be searched in the default user''s map application.'
              example: 'Av. Paulista, 2300 - São Paulo'
          required:
            - type
            - text
            - query
    content.bases.buttons.share-location:
      type: object
      description: Opens the default app for maps on the user's device and requests the user's location.
      allOf:
        - $ref: '#/components/schemas/content.bases.buttons.base'
        - type: object
          required:
            - type
            - text
    content.bases.buttons.view-location:
      type: object
      description: Opens the standard calendar application on the user's device and creates a new event with the sent data.
      allOf:
        - $ref: '#/components/schemas/content.bases.buttons.base'
        - type: object
          properties:
            latitude:
              type: string
              description: Latitude in degrees (range from -90.0 and +90.0).
              example: '-23.557260'
            longitude:
              type: string
              description: Longitude in degrees (range from -180.0 and +180.0).
              example: '-46.661030'
            label:
              type: string
              description: Text to be displayed with the map position pin icon.
              example: Zenvia
          required:
            - type
            - text
            - latitude
            - longitude
    content.bases.buttons.web-url:
      type: object
      description: Opens a URL on user's device and sends the payload field content to the Agent.
      allOf:
        - $ref: '#/components/schemas/content.bases.buttons.base'
        - type: object
          properties:
            url:
              type: string
              description: URL to be accessed upon click.
              example: 'https://zenvia.com/'
          required:
            - type
            - text
            - url
    content.email.all:
      title: E-Mail
      oneOf:
        - $ref: '#/components/schemas/content.email'
        - $ref: '#/components/schemas/content.template'
      discriminator:
        propertyName: type
        mapping:
          email: '#/components/schemas/content.email'
          template: '#/components/schemas/content.template'
    content.email.recipient:
      type: object
      properties:
        email:
          type: string
          title: E-mail
          description: E-mail address of the recipient.
        name:
          type: string
          title: Name
          description: Name shown along the e-mail address.
      required:
        - email
    content.email.reply-to:
      title: Reply To
      allOf:
        - type: object
          description: E-mail that will be set as recipient when a e-mail response is initiated.
        - $ref: '#/components/schemas/content.email.recipient'
      example:
        email: reply-to@zenvia.com
        name: Service Care
    content.facebook.all:
      title: Facebook
      oneOf:
        - $ref: '#/components/schemas/content.text'
        - $ref: '#/components/schemas/content.file'
        - $ref: '#/components/schemas/content.template'
        - $ref: '#/components/schemas/content.card'
        - $ref: '#/components/schemas/content.carousel'
        - $ref: '#/components/schemas/content.replyable-text'
        - $ref: '#/components/schemas/content.optin_request'
        - $ref: '#/components/schemas/content.optin_response'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/content.text'
          file: '#/components/schemas/content.file'
          template: '#/components/schemas/content.template'
          card: '#/components/schemas/content.card'
          carousel: '#/components/schemas/content.carousel'
          replyable_text: '#/components/schemas/content.replyable-text'
          optin_request: '#/components/schemas/content.optin_request'
          optin_response: '#/components/schemas/content.optin_response'
    content.facebook.mt:
      title: Facebook
      oneOf:
        - $ref: '#/components/schemas/content.text'
        - $ref: '#/components/schemas/content.file'
        - $ref: '#/components/schemas/content.template'
        - $ref: '#/components/schemas/content.card'
        - $ref: '#/components/schemas/content.carousel'
        - $ref: '#/components/schemas/content.replyable-text'
        - $ref: '#/components/schemas/content.optin_request'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/content.text'
          file: '#/components/schemas/content.file'
          template: '#/components/schemas/content.template'
          card: '#/components/schemas/content.card'
          carousel: '#/components/schemas/content.carousel'
          replyable_text: '#/components/schemas/content.replyable-text'
          optin_request: '#/components/schemas/content.optin_request'
    content.gbm.all:
      title: Google Business Messages
      oneOf:
        - $ref: '#/components/schemas/content.text'
        - $ref: '#/components/schemas/content.file'
        - $ref: '#/components/schemas/content.card'
        - $ref: '#/components/schemas/content.carousel'
        - $ref: '#/components/schemas/content.replyable-text'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/content.text'
          file: '#/components/schemas/content.file'
          card: '#/components/schemas/content.card'
          carousel: '#/components/schemas/content.carousel'
          replyable_text: '#/components/schemas/content.replyable-text'
    content.instagram.all:
      title: Instagram
      oneOf:
        - $ref: '#/components/schemas/content.text'
        - $ref: '#/components/schemas/content.file'
        - $ref: '#/components/schemas/content.replyable-text'
        - $ref: '#/components/schemas/content.card'
        - $ref: '#/components/schemas/content.carousel'
        - $ref: '#/components/schemas/content.optin_request'
        - $ref: '#/components/schemas/content.optin_response'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/content.text'
          file: '#/components/schemas/content.file'
          replyable_text: '#/components/schemas/content.replyable-text'
          card: '#/components/schemas/content.card'
          carousel: '#/components/schemas/content.carousel'
          optin_request: '#/components/schemas/content.optin_request'
          optin_response: '#/components/schemas/content.optin_response'
    content.instagram.mt:
      title: Instagram
      oneOf:
        - $ref: '#/components/schemas/content.text'
        - $ref: '#/components/schemas/content.file'
        - $ref: '#/components/schemas/content.replyable-text'
        - $ref: '#/components/schemas/content.card'
        - $ref: '#/components/schemas/content.carousel'
        - $ref: '#/components/schemas/content.optin_request'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/content.text'
          file: '#/components/schemas/content.file'
          replyable_text: '#/components/schemas/content.replyable-text'
          card: '#/components/schemas/content.card'
          carousel: '#/components/schemas/content.carousel'
          optin_request: '#/components/schemas/content.optin_request'
    content.rcs.all:
      title: RCS
      oneOf:
        - $ref: '#/components/schemas/content.text'
        - $ref: '#/components/schemas/content.file'
        - $ref: '#/components/schemas/content.card'
        - $ref: '#/components/schemas/content.carousel'
        - $ref: '#/components/schemas/content.replyable-text'
        - $ref: '#/components/schemas/content.template'
        - $ref: '#/components/schemas/content.location'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/content.text'
          template: '#/components/schemas/content.template'
          file: '#/components/schemas/content.file'
          card: '#/components/schemas/content.card'
          carousel: '#/components/schemas/content.carousel'
          replyable_text: '#/components/schemas/content.replyable-text'
          location: '#/components/schemas/content.location'
    content.rcs.mo:
      title: RCS
      oneOf:
        - $ref: '#/components/schemas/content.text'
        - $ref: '#/components/schemas/content.file'
        - $ref: '#/components/schemas/content.card'
        - $ref: '#/components/schemas/content.carousel'
        - $ref: '#/components/schemas/content.replyable-text'
        - $ref: '#/components/schemas/content.template'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/content.text'
          template: '#/components/schemas/content.template'
          file: '#/components/schemas/content.file'
          card: '#/components/schemas/content.card'
          carousel: '#/components/schemas/content.carousel'
          replyable_text: '#/components/schemas/content.replyable-text'
    content.sms.all:
      title: SMS
      oneOf:
        - $ref: '#/components/schemas/content.sms.text'
        - $ref: '#/components/schemas/content.template'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/content.sms.text'
          template: '#/components/schemas/content.template'
    content.sms.text:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.text'
        - type: object
          properties:
            encodingStrategy:
              type: string
              enum:
                - AUTO
                - MORE_CHARACTER_SUPPORT
                - MORE_CHARACTERS_PER_MESSAGE
              default: AUTO
              description: |-
                The method used for selecting the message encoding used to dispatch the message to the provider.
                          <br>
                          <br>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**.
                          <br>
                          <br>More information about SMS encoding can be found in the [SMS limitations](#section/SMS-limitations) section.
                          <br>
                          <br>*Only applicable to [SMS](#tag/SMS) channel.*
              example: AUTO
            reportId:
              type: number
              description: |-
                An ID used for report purposes only (also known as aggregate id). It must be setup before use.
                          <br>*Only applicable to [SMS](#tag/SMS) channel.*
              example: 12345
              minimum: -2147483648
              maximum: 2147483647
    content.telegram.all:
      title: Telegram
      oneOf:
        - $ref: '#/components/schemas/content.text'
        - $ref: '#/components/schemas/content.file'
        - $ref: '#/components/schemas/content.card'
        - $ref: '#/components/schemas/content.replyable-text'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/content.text'
          file: '#/components/schemas/content.file'
          card: '#/components/schemas/content.card'
          replyable_text: '#/components/schemas/content.replyable-text'
    content.voice.all:
      title: Voice
      oneOf:
        - $ref: '#/components/schemas/content.call'
      discriminator:
        propertyName: type
        mapping:
          call: '#/components/schemas/content.call'
    content.whatsapp.all:
      title: WhatsApp
      oneOf:
        - $ref: '#/components/schemas/content.text'
        - $ref: '#/components/schemas/content.file'
        - $ref: '#/components/schemas/content.template'
        - $ref: '#/components/schemas/content.contacts'
        - $ref: '#/components/schemas/content.location'
        - $ref: '#/components/schemas/content.whatsapp.button.index'
        - $ref: '#/components/schemas/content.whatsapp.list'
        - $ref: '#/components/schemas/content.whatsapp.product'
        - $ref: '#/components/schemas/content.whatsapp.product-list'
        - $ref: '#/components/schemas/content.whatsapp.flow'
        - $ref: '#/components/schemas/content.whatsapp.request-contact-info'
        - $ref: '#/components/schemas/content.whatsapp.flow-response'
        - $ref: '#/components/schemas/content.whatsapp.product-list-order'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/content.text'
          file: '#/components/schemas/content.file'
          template: '#/components/schemas/content.template'
          contacts: '#/components/schemas/content.contacts'
          location: '#/components/schemas/content.location'
          button: '#/components/schemas/content.whatsapp.button.index'
          list: '#/components/schemas/content.whatsapp.list'
          product: '#/components/schemas/content.whatsapp.product'
          product_list: '#/components/schemas/content.whatsapp.product-list'
          flow: '#/components/schemas/content.whatsapp.flow'
          contact_request: '#/components/schemas/content.whatsapp.request-contact-info'
          flow_response: '#/components/schemas/content.whatsapp.flow-response'
          product_list_order: '#/components/schemas/content.whatsapp.product-list-order'
    content.whatsapp.flow-response:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: flow_response
            token:
              type: string
              description: Flow token
              example: TOKEN_FLOW
            body:
              type: string
              description: Body content
              example: Text body content
            data:
              title: Custom Data
              description: Set values for custom data fields created.
              type: object
              additionalProperties:
                title: Value
                description: Sets a value to a custom data field (the property name).
                oneOf:
                  - type: string
                    title: String
                    example: '2022234324'
                  - type: number
                    title: Number
                    example: 10
          required:
            - type
            - token
    content.whatsapp.flow:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: flow
            header:
              type: string
              description: Header content
              example: Text header content
            body:
              type: string
              description: Body content
              example: Text body content
            footer:
              type: string
              description: Footer content
              example: Text footer content
            flow:
              type: object
              description: 'The available fields to be used in a flow. Only applicable to [WhatsApp](#tag/WhatsApp) channel.'
              required:
                - id
                - buttonText
              properties:
                mode:
                  type: string
                  description: Can be either draft or published
                  example: draft
                token:
                  type: string
                  description: Flow token
                  example: TOKEN_FLOW
                id:
                  type: string
                  description: Flow id
                  example: TOKEN_ID
                buttonText:
                  type: string
                  description: Text for the button
                  example: Click here!
                action:
                  type: object
                  description: Details about the action of the Flow
                  required:
                    - type
                  properties:
                    type:
                      type: string
                      description: Can be either "navigate" or "data_exchange"
                      example: navigate
                    screen:
                      type: string
                      description: Identification for the screen ID
                      example: SCREEN_ID
                    data:
                      title: Custom Data
                      description: Set values for custom data fields created.
                      type: object
          required:
            - type
            - flow
    content.whatsapp.list:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: list
            header:
              type: string
              title: Header text
              example: Header text.
              minLength: 1
              maxLength: 60
            body:
              type: string
              title: Body text
              example: Body text.
              minLength: 1
              maxLength: 1024
            footer:
              type: string
              title: Footer text
              example: Footer text.
              minLength: 1
              maxLength: 60
            button:
              type: string
              title: List button
              description: Button used to open the list. Does not allow emojis or markdown.
              minLength: 1
              maxLength: 20
            sections:
              type: array
              title: List of sections
              minItems: 1
              maxItems: 10
              items:
                type: object
                properties:
                  title:
                    type: string
                    title: Section title
                    example: Section name
                    minLength: 1
                    maxLength: 24
                  rows:
                    type: array
                    description: Max of 10 rows considering all sections together.
                    minItems: 1
                    maxItems: 10
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          title: Row id
                          example: Row id
                          minLength: 1
                          maxLength: 200
                        title:
                          type: string
                          title: Row title
                          example: Row title
                          minLength: 1
                          maxLength: 24
                        description:
                          type: string
                          title: Row description
                          example: Row description
                          minLength: 1
                          maxLength: 72
                      required:
                        - id
                        - title
                required:
                  - title
                  - rows
          required:
            - type
            - body
            - button
            - sections
    content.whatsapp.mt:
      title: WhatsApp
      oneOf:
        - $ref: '#/components/schemas/content.text'
        - $ref: '#/components/schemas/content.file'
        - $ref: '#/components/schemas/content.template'
        - $ref: '#/components/schemas/content.contacts'
        - $ref: '#/components/schemas/content.location'
        - $ref: '#/components/schemas/content.whatsapp.button.index'
        - $ref: '#/components/schemas/content.whatsapp.list'
        - $ref: '#/components/schemas/content.whatsapp.product'
        - $ref: '#/components/schemas/content.whatsapp.product-list'
        - $ref: '#/components/schemas/content.whatsapp.flow'
        - $ref: '#/components/schemas/content.whatsapp.request-contact-info'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/content.text'
          file: '#/components/schemas/content.file'
          template: '#/components/schemas/content.template'
          contacts: '#/components/schemas/content.contacts'
          location: '#/components/schemas/content.location'
          button: '#/components/schemas/content.whatsapp.button.index'
          list: '#/components/schemas/content.whatsapp.list'
          product: '#/components/schemas/content.whatsapp.product'
          product_list: '#/components/schemas/content.whatsapp.product-list'
          flow: '#/components/schemas/content.whatsapp.flow'
          contact_request: '#/components/schemas/content.whatsapp.request-contact-info'
    content.whatsapp.order-details-template:
      title: Order Details
      required:
        - orderDetailsParameters
      additionalProperties:
        description: Value provided to fill the variable named after the property name.
        oneOf:
          - type: string
            example: Zenvia
          - type: number
            example: 1
          - type: boolean
            example: true
      properties:
        orderDetailsParameters:
          type: object
          description: |-
            Details of a payment template.

             *Only applicable to [WhatsApp](#tag/WhatsApp) channel.*
          required:
            - order
            - totalAmount
            - type
            - paymentSettings
          properties:
            referenceId:
              type: string
              description: 'An optional unique identifier of the order. This can only contain English letters, numbers, underscores, dashes, or dots.'
              maxLength: 35
              pattern: '^[A-Za-z0-9_\-\.]+$'
            type:
              type: string
              enum:
                - digital_goods
                - physical_goods
              description: The type of the order item.
            paymentSettings:
              type: array
              description: List of payment configuration objects.
              minItems: 1
              maxItems: 2
              items:
                type: object
                anyOf:
                  - title: Payment link
                    required:
                      - paymentLink
                      - type
                    properties:
                      type:
                        description: The type of the payment method.
                        enum:
                          - payment_link
                        type: string
                      paymentLink:
                        description: A valid payment URL.
                        pattern: '^(https)://[^\s/$.?#].[^\s]*$'
                        type: string
                  - title: Boleto
                    required:
                      - digitableLine
                      - type
                    properties:
                      type:
                        description: The type of the payment method.
                        enum:
                          - boleto
                        type: string
                      digitableLine:
                        description: 'The Boleto digitable line / code which will be copied to the clipboard, when user taps on the Boleto CTA button.'
                        minLength: 47
                        maxLength: 48
                        type: string
                  - title: Pix
                    required:
                      - code
                      - merchantName
                      - key
                      - keyType
                      - type
                    properties:
                      type:
                        enum:
                          - pix_dynamic_code
                        type: string
                        description: 'The type of the payment method. For ''pix_dynamic_code'', Pix payment instructions that will be displayed to buyers during the checkout process if they decide to pay outside of WhatsApp.'
                      code:
                        type: string
                        description: The dynamic Pix code to be sent to the buyer.
                      merchantName:
                        type: string
                        description: The name of account holder. Displayed in-app for the buyer for informational purposes.
                      key:
                        type: string
                        description: The Pix key.
                      keyType:
                        type: string
                        description: The type of the Pix key.
                        enum:
                          - CPF
                          - CNPJ
                          - EMAIL
                          - PHONE
                          - EVP
            totalAmount:
              type: number
              description: The total amount of the order in BRL with up to two decimal places.
              example: 12.34
              minimum: 0.01
            order:
              type: object
              required:
                - items
                - tax
                - subtotal
              description: 'Details of the purchase order containing items purchased, subtotal amount, and tax details.'
              properties:
                items:
                  type: array
                  description: 'List of products included in the order, with details for each item.'
                  items:
                    type: object
                    required:
                      - productId
                      - name
                      - amount
                      - quantity
                    properties:
                      productId:
                        type: string
                        description: The product item catalog identifier.
                      name:
                        type: string
                        description: The name of the item to be displayed to the user.
                        maxLength: 60
                      amount:
                        type: number
                        description: The price per item in BRL with up to two decimal places.
                        example: 12.34
                        minimum: 0.01
                      quantity:
                        type: number
                        description: The quantity of the item in this order.
                        minimum: 0
                tax:
                  type: object
                  description: Tax details applied to the purchase.
                  required:
                    - value
                  properties:
                    value:
                      type: number
                      description: The total value of the tax in BRL with up to two decimal places.
                      example: 12.34
                      minimum: 0
                subtotal:
                  type: number
                  description: The total value of the order in BRL with up to two decimal places.
                  example: 12.34
                  minimum: 0.01
    content.whatsapp.order-details:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: order_details
            body:
              type: string
              description: Body content
              example: Text body content
              maxLength: 1024
            footer:
              type: string
              description: Footer content
              example: Text footer content
              maxLength: 60
            parameters:
              type: object
              properties:
                referenceId:
                  type: string
                  description: 'The unique identifier of the order. This cannot be an empty string and can only contain English letters, numbers, underscores, dashes, or dots. If not specified, we will generate a random identifier and return it in the request response.'
                  maxLength: 35
                  pattern: '^[A-Za-z0-9_\-\.]+$'
                type:
                  type: string
                  description: The type of the order item.
                  enum:
                    - digital_goods
                    - physical_goods
                paymentSettings:
                  type: array
                  description: List of payment configuration objects.
                  minItems: 1
                  maxItems: 2
                  items:
                    anyOf:
                      - $ref: '#/components/schemas/content.whatsapp.payment-settings.pix'
                      - $ref: '#/components/schemas/content.whatsapp.payment-settings.boleto'
                      - $ref: '#/components/schemas/content.whatsapp.payment-settings.payment-link'
                totalAmount:
                  type: number
                  description: The total amount of the order in BRL with up to two decimal places.
                  example: 12.34
                  minimum: 0.01
                order:
                  type: object
                  properties:
                    catalogId:
                      type: string
                      description: 'The catalog identifier. Click <a href="https://business.facebook.com/commerce" target="_blank">here</a> to go to the catalogs page.'
                    expiration:
                      type: object
                      description: The expiration for that order. The CTA for payment will be disabled after expiry on the user end.
                      properties:
                        timestamp:
                          type: string
                          description: The timestamp UTC time in seconds. Minimum threshold is 300 seconds.
                          pattern: ^\d+$
                        description:
                          type: string
                          description: The description explaining when the order will expire.
                          maxLength: 120
                      required:
                        - timestamp
                        - description
                    items:
                      type: array
                      description: The list of items that will be ordered.
                      minItems: 1
                      items:
                        type: object
                        properties:
                          productId:
                            type: string
                            description: The product item catalog identifier.
                          name:
                            type: string
                            description: The name of the item to be displayed to the user.
                            maxLength: 60
                          amount:
                            type: number
                            description: The price per item in BRL with up to two decimal places.
                            example: 12.34
                            minimum: 0.01
                          quantity:
                            type: number
                            description: The quantity of the item in this order.
                            minimum: 0
                          saleAmount:
                            type: number
                            description: The discounted price per item.
                            minimum: 0
                        required:
                          - productId
                          - name
                          - amount
                          - quantity
                    subtotal:
                      type: number
                      description: The total value of the order in BRL with up to two decimal places.
                      example: 12.34
                      minimum: 0.01
                    tax:
                      type: object
                      properties:
                        value:
                          type: number
                          description: The total value of the tax in BRL with up to two decimal places.
                          example: 12.34
                          minimum: 0
                        description:
                          type: string
                          description: The optional description of the tax.
                          maxLength: 60
                      required:
                        - value
                    shipping:
                      type: object
                      properties:
                        value:
                          type: number
                          description: The total value of the shipping cost in BRL with up to two decimal places.
                          example: 12.34
                          minimum: 0.01
                        description:
                          type: string
                          description: The optional description of the shipping cost.
                      required:
                        - value
                    discount:
                      type: object
                      properties:
                        value:
                          type: number
                          description: The total value of the discount in BRL with up to two decimal places.
                          example: 12.34
                          minimum: 0.01
                        description:
                          type: string
                          description: The optional description of the discount.
                          maxLength: 60
                        discountProgramName:
                          type: string
                          description: 'The text used for defining incentivised orders. If order is incentivised, the merchant needs to define this information'
                          maxLength: 60
                      required:
                        - value
                  required:
                    - items
                    - subtotal
                    - tax
              required:
                - type
                - paymentSettings
                - totalAmount
                - order
          required:
            - type
            - body
            - parameters
    content.whatsapp.order-status:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: order_status
            body:
              type: string
              description: Body content
              example: Text body content
              maxLength: 1024
            footer:
              type: string
              description: Footer content
              example: Text footer content
              maxLength: 60
            parameters:
              type: object
              properties:
                referenceId:
                  type: string
                  description: 'The unique identifier of the order provided in the order_details message. This cannot be an empty string and can only contain English letters, numbers, underscores, dashes, or dots.'
                  maxLength: 35
                  pattern: '^[A-Za-z0-9_\-\.]+$'
                order:
                  type: object
                  properties:
                    status:
                      type: string
                      description: The status of the order.
                      enum:
                        - pending
                        - processing
                        - partially-shipped
                        - shipped
                        - completed
                        - canceled
                    description:
                      type: string
                      description: The optional description of the order status.
                      maxLength: 120
                  required:
                    - status
              required:
                - referenceId
                - order
          required:
            - type
            - body
            - parameters
    content.whatsapp.product-list-order:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: product_list_order
            text:
              type: string
              description: Text content
              example: Text content
            catalogId:
              type: string
              description: The catalog identifier.
            productItems:
              type: array
              description: The available fields to be used in this product list order.
              items:
                type: object
                properties:
                  productId:
                    type: string
                    description: The product identifier.
                  quantity:
                    type: string
                    description: quantity
                  itemPrice:
                    type: string
                    description: itemPrice
                  currency:
                    type: string
                    description: currency
          required:
            - type
            - catalogId
            - productItems
    content.whatsapp.product-list:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: product_list
            header:
              type: string
              description: Header content
              example: Text header content
            body:
              type: string
              description: Body content
              example: Text body content
            footer:
              type: string
              description: Footer content
              example: Text footer content
            catalogId:
              type: string
              description: 'The catalog identifier. Click <a href="https://business.facebook.com/commerce" target="_blank">here</a> to go to the catalogs page.'
            sections:
              $ref: '#/components/schemas/content.whatsapp.product-sections'
          required:
            - type
            - catalogId
            - body
            - sections
    content.whatsapp.product-sections:
      type: array
      title: Product Sections
      description: 'The available fields to be used in a product list. Only applicable to [WhatsApp](#tag/WhatsApp) channel.'
      minItems: 1
      items:
        type: object
        required:
          - title
          - productItems
        properties:
          title:
            type: string
            description: The section title.
          productItems:
            type: array
            description: A list of products.
            items:
              type: object
              required:
                - productId
              properties:
                productId:
                  type: string
                  description: The product identifier.
      example:
        - title: title
          productItems:
            - productId: MY_PRODUCT_ID
    content.whatsapp.product:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: product
            body:
              type: string
              description: Body content
              example: Text body content
            footer:
              type: string
              description: Footer content
              example: Text footer content
            catalogId:
              type: string
              description: 'The catalog identifier. Click <a href="https://business.facebook.com/commerce" target="_blank">here</a> to go to the catalogs page.'
            productId:
              type: string
              description: The product identifier.
          required:
            - type
            - catalogId
            - productId
    content.whatsapp.request-contact-info:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: contact_request
            body:
              type: string
              description: Text content to prompt the contact request.
              example: Please share your contact info.
          required:
            - type
    content.whatsapp.unsupported:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: unsupported
              description: Refers to a type of communication that is not supported by Meta.
          required:
            - type
    content.whatsapp.button.index:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.base'
        - type: object
          properties:
            type:
              type: string
              example: button
            header:
              $ref: '#/components/schemas/content.whatsapp.button.header.index'
            body:
              type: string
              title: Body text
              example: Body text.
              minLength: 1
              maxLength: 1024
            footer:
              type: string
              title: Footer text
              example: Footer text.
              minLength: 1
              maxLength: 60
            buttons:
              type: array
              title: List of buttons
              minItems: 1
              maxItems: 10
              items:
                type: object
                properties:
                  id:
                    type: string
                    example: Button ID
                    minLength: 1
                    maxLength: 256
                  title:
                    type: string
                    example: Button text
                    minLength: 1
                    maxLength: 20
                required:
                  - id
                  - title
          required:
            - type
            - body
            - buttons
    content.whatsapp.button.header.base:
      type: object
      properties:
        type:
          title: Header Type
          type: string
      required:
        - type
    content.whatsapp.button.header.file:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.whatsapp.button.header.base'
        - type: object
          properties:
            type:
              type: string
              example: file
            fileUrl:
              type: string
              description: The URL of the file to be sent.
              example: 'https://example.com/document.pdf'
            fileMimeType:
              type: string
              description: '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. For [WhatsApp](#tag/WhatsApp) channel, see [supported contents and sizes.](#section/WhatsApp-limitations)'
              example: application/pdf
            fileName:
              type: string
              description: The name of the file.
              example: document.pdf
          required:
            - type
            - fileUrl
    content.whatsapp.button.header.index:
      title: Object header
      oneOf:
        - $ref: '#/components/schemas/content.whatsapp.button.header.text'
        - $ref: '#/components/schemas/content.whatsapp.button.header.file'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/content.whatsapp.button.header.text'
          file: '#/components/schemas/content.whatsapp.button.header.file'
    content.whatsapp.button.header.text:
      type: object
      allOf:
        - $ref: '#/components/schemas/content.whatsapp.button.header.base'
        - type: object
          properties:
            type:
              type: string
              example: text
            text:
              type: string
              title: Header text
              example: Header text
              minLength: 1
              maxLength: 60
          required:
            - type
            - text
    content.whatsapp.payment-settings.boleto:
      type: object
      title: boleto
      properties:
        type:
          type: string
          description: The type of the payment method.
          enum:
            - boleto
        digitableLine:
          type: string
          description: 'The Boleto digitable line / code which will be copied to the clipboard, when user taps on the Boleto CTA button.'
          minLength: 47
          maxLength: 48
      required:
        - type
        - digitableLine
    content.whatsapp.payment-settings.payment-link:
      type: object
      title: payment_link
      properties:
        type:
          type: string
          description: The type of the payment method.
          enum:
            - payment_link
        paymentLink:
          type: string
          description: A valid payment URL.
          pattern: '^(https)://[^\s/$.?#].[^\s]*$'
      required:
        - type
        - paymentLink
    content.whatsapp.payment-settings.pix:
      title: pix
      description: The type of the payment method
      type: object
      properties:
        type:
          type: string
          description: 'The type of the payment method. For ''pix_dynamic_code'', Pix payment instructions that will be displayed to buyers during the checkout process if they decide to pay outside of WhatsApp.'
          enum:
            - pix_dynamic_code
        code:
          type: string
          description: The dynamic Pix code to be sent to the buyer.
        merchantName:
          type: string
          description: The name of account holder. Displayed in-app for the buyer for informational purposes.
        key:
          type: string
          description: The Pix key.
        keyType:
          type: string
          description: The type of the Pix key.
          enum:
            - CPF
            - CNPJ
            - EMAIL
            - PHONE
            - EVP
      required:
        - type
        - code
        - merchantName
        - key
        - keyType
    conversations.archive-request:
      title: Archive conversation request
      description: Archives (closes) the conversation with the given close reason.
      type: object
      properties:
        reason:
          title: Reason
          description: 'The close reason key, as configured for the conversation''s group. Fails with CLOSE_REASON_UNRESOLVABLE if the key is not valid for the organization.'
          type: string
      required:
        - reason
    conversations.conversation:
      title: Conversation
      description: A conversation between an agent (or bot) and a contact on an NCA (Novo Conceito de Atendimento) account.
      type: object
      properties:
        id:
          title: Id
          description: The conversation identifier.
          type: string
          readOnly: true
        status:
          title: Status
          description: The current status of the conversation.
          type: string
          enum:
            - CONVERSATION_CREATED
            - QUEUED
            - STARTED
            - CLAIMED
            - DISTRIBUTED_TO_USER
            - TRANSFERRED
            - SNOOZED
            - UNSNOOZED
            - CLOSED
          readOnly: true
          example: STARTED
        statusTimestamp:
          title: Status timestamp
          description: 'The date and time of the last status change, in ISO 8601 format.'
          type: string
          format: date-time
          readOnly: true
        channel:
          title: Channel
          description: The channel the conversation is happening on.
          type: string
          enum:
            - whatsapp
            - sms
            - facebook
            - rcs
            - telegram
            - voice
            - gbm
            - instagram
            - email
            - webchat
            - whatsapp_call
            - meli
            - claim
            - questions
            - support
          readOnly: true
        to:
          title: To
          description: The contact's channel address.
          type: string
          readOnly: true
        from:
          title: From
          description: The channel address the conversation is being served from.
          type: string
          readOnly: true
        contactId:
          title: Contact id
          description: 'The identifier of the linked contact, when there is one. The webchat channel may open a conversation without a linked contact.'
          type: string
          readOnly: true
        groupId:
          title: Group id
          description: The identifier of the group currently assigned to the conversation.
          type: string
          readOnly: true
        userId:
          title: User id
          description: The identifier of the agent currently assigned to the conversation.
          type: string
          readOnly: true
        createdAt:
          title: Created at
          description: 'The date and time the conversation was created, in ISO 8601 format.'
          type: string
          format: date-time
          readOnly: true
      required:
        - id
        - status
        - statusTimestamp
        - channel
    conversations.create-request:
      title: Create conversation request
      description: 'Creates a new conversation for a contact identified by their channel address, or resumes an existing one for the same contact.'
      type: object
      properties:
        groupId:
          title: Group id
          description: The group the conversation should be queued or assigned to.
          type: string
        agentId:
          title: Agent id
          description: Optional agent to directly assign the conversation to.
          type: string
        channelAddress:
          title: Channel address
          description: 'The contact''s channel address (a phone number or an e-mail address, depending on channelType).'
          type: string
          example: '5511999999999'
        channelType:
          title: Channel type
          description: The type of channel address supplied.
          type: string
          enum:
            - PHONE
            - EMAIL
        firstName:
          title: First name
          description: The contact's first name.
          type: string
        lastName:
          title: Last name
          description: The contact's last name.
          type: string
      required:
        - groupId
        - channelAddress
        - channelType
        - firstName
    conversations.message-content:
      title: Message content
      description: A message content item.
      type: object
      properties:
        type:
          title: Type
          type: string
          enum:
            - text
            - template
            - file
            - location
            - note
        payload:
          title: Payload
          description: 'The content payload, shaped according to type.'
          type: object
      required:
        - type
    conversations.message-response:
      title: Message sent
      description: 'A message exchanged on a conversation, with its content (type/payload) returned at the root level. A note is a message with direction INTERNAL, never delivered to the contact.'
      allOf:
        - $ref: '#/components/schemas/conversations.message-content'
        - type: object
          properties:
            id:
              title: Id
              description: The message identifier.
              type: string
              readOnly: true
            from:
              title: From
              description: The channel address the message was sent from.
              type: string
              readOnly: true
            to:
              title: To
              description: The channel address the message was sent to.
              type: string
              readOnly: true
            direction:
              title: Direction
              description: 'IN for a message received from the contact, OUT for a message sent to the contact, INTERNAL for a note visible only to agents.'
              type: string
              enum:
                - IN
                - OUT
                - INTERNAL
              readOnly: true
              example: OUT
            channel:
              title: Channel
              description: The channel the message was exchanged on.
              type: string
              enum:
                - whatsapp
                - sms
                - facebook
                - rcs
                - telegram
                - voice
                - gbm
                - instagram
                - email
                - webchat
                - whatsapp_call
                - meli
                - claim
                - questions
                - support
              readOnly: true
            timestamp:
              title: Timestamp
              description: 'The date and time the message was created, in ISO 8601 format.'
              type: string
              format: date-time
              readOnly: true
          required:
            - id
            - direction
            - channel
            - timestamp
    conversations.message:
      title: Message
      description: 'A message exchanged on a conversation. A note is a message with direction INTERNAL, never delivered to the contact.'
      type: object
      properties:
        id:
          title: Id
          description: The message identifier.
          type: string
          readOnly: true
        from:
          title: From
          description: The channel address the message was sent from.
          type: string
          readOnly: true
        to:
          title: To
          description: The channel address the message was sent to.
          type: string
          readOnly: true
        direction:
          title: Direction
          description: 'IN for a message received from the contact, OUT for a message sent to the contact, INTERNAL for a note visible only to agents.'
          type: string
          enum:
            - IN
            - OUT
            - INTERNAL
          readOnly: true
          example: OUT
        channel:
          title: Channel
          description: The channel the message was exchanged on.
          type: string
          enum:
            - whatsapp
            - sms
            - facebook
            - rcs
            - telegram
            - voice
            - gbm
            - instagram
            - email
            - webchat
            - whatsapp_call
            - meli
            - claim
            - questions
            - support
          readOnly: true
        contents:
          title: Contents
          description: The message content items.
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/conversations.message-content'
        timestamp:
          title: Timestamp
          description: 'The date and time the message was created, in ISO 8601 format.'
          type: string
          format: date-time
          readOnly: true
      required:
        - id
        - direction
        - channel
        - contents
        - timestamp
    conversations.send-message-request:
      title: Send message request
      description: 'Sends an outbound message to the contact, as the acting agent. Fails with SESSION_REQUIRED if there is no active messaging session with the contact.'
      type: object
      properties:
        type:
          title: Type
          description: The content type to send.
          type: string
          enum:
            - text
            - template
            - file
            - location
          example: text
        payload:
          title: Payload
          description: 'The content payload, shaped according to type (e.g. { "text": "..." } for type text, { "templateId": "..." } for type template).'
          type: object
        replyTo:
          title: Reply to
          description: Optional identifier of the message being replied to.
          type: string
      required:
        - type
        - payload
    conversations.send-note-request:
      title: Send note request
      description: Adds an internal note to the conversation. A note is never delivered to the contact and does not require an active messaging session.
      type: object
      properties:
        text:
          title: Text
          description: The note text. Must not be empty.
          type: string
      required:
        - text
    conversations.transfer-request:
      title: Transfer conversation request
      description: Transfers the conversation to another user or group. Transferring to a user answers 200 synchronously; transferring to a group answers 202 and the conversation is queued for distribution.
      type: object
      properties:
        type:
          title: Type
          description: The transfer target type.
          type: string
          enum:
            - USER
            - GROUP
        userId:
          title: User id
          description: The destination agent. Required when type is USER.
          type: string
        groupId:
          title: Group id
          description: 'The destination group. Always required: when type is USER, it is the group the destination agent is being transferred within.'
          type: string
      required:
        - type
        - groupId
    error.base:
      title: Error Object
      description: This is a Error object model
      type: object
      properties:
        code:
          title: Code
          description: An error code to identify the error programmatically.
          type: string
          readOnly: true
          example: VALIDATION_ERROR
        message:
          title: Message
          description: A human readable text to help on error troubleshooting.
          type: string
          readOnly: true
          example: Validation error
        details:
          title: Details
          description: Error details to help identify the problem source.
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/error.errors'
      required:
        - code
        - message
    error.errors:
      title: Error object
      description: This is a Error object schema.
      type: object
      properties:
        code:
          title: Code
          description: Details error code
          type: string
          readOnly: true
        path:
          title: Path
          description: Error path
          type: string
          readOnly: true
        message:
          title: Message
          description: Human readable message
          type: string
          readOnly: true
      required:
        - code
        - message
    events.all:
      oneOf:
        - $ref: '#/components/schemas/events.message-event'
        - $ref: '#/components/schemas/events.message-status-event'
        - $ref: '#/components/schemas/events.conversation-message-event'
        - $ref: '#/components/schemas/events.conversation-status-event'
        - $ref: '#/components/schemas/events.support-expert-agent-event'
        - $ref: '#/components/schemas/events.contact-event'
      discriminator:
        propertyName: type
        mapping:
          MESSAGE: '#/components/schemas/events.message-event'
          MESSAGE_STATUS: '#/components/schemas/events.message-status-event'
          CONVERSATION_STATUS: '#/components/schemas/events.conversation-status-event'
          CONVERSATION_MESSAGE: '#/components/schemas/events.conversation-message-event'
          SUPPORT_EXPERT_AGENT: '#/components/schemas/events.support-expert-agent-event'
          CONTACT: '#/components/schemas/events.contact-event'
    events.base-conversation-message:
      type: object
      properties:
        id:
          title: Event Id
          description: ID of the webhook event. Can be used to identify retried deliveries in case of webhook errors.
          type: string
        timestamp:
          title: Event Timestamp
          description: Timestamp of the webhook event
          type: string
          format: date-time
        type:
          title: Event type
          type: string
          enum:
            - CONVERSATION_MESSAGE
        subscriptionId:
          title: Webhook ID
          description: ID of the webhook that caused this event to be delivered
          type: string
    events.base-conversation-status:
      type: object
      properties:
        id:
          title: Event Id
          description: ID of the webhook event. Can be used to identify retried deliveries in case of webhook errors.
          type: string
        timestamp:
          title: Event Timestamp
          description: Timestamp of the webhook event
          type: string
          format: date-time
        type:
          title: Event type
          type: string
          enum:
            - CONVERSATION_STATUS
        subscriptionId:
          title: Webhook ID
          description: ID of the webhook that caused this event to be delivered
          type: string
    events.base:
      type: object
      properties:
        id:
          title: Event Id
          description: ID of the webhook event. Can be used to identify retried deliveries in case of webhook errors.
          type: string
        timestamp:
          title: Event Timestamp
          description: Timestamp of the webhook event
          type: string
          format: date-time
        subscriptionId:
          title: Webhook ID
          description: ID of the webhook that caused this event to be delivered
          type: string
    events.contact-event:
      type: object
      allOf:
        - $ref: '#/components/schemas/events.base'
        - type: object
          properties:
            type:
              title: Event type
              type: string
              enum:
                - CONTACT
              example: CONTACT
            action:
              title: Contact event operation type
              type: string
              enum:
                - CREATED
                - DELETED
                - UPDATED
            contact:
              $ref: '#/components/schemas/contacts-management.contact'
          required:
            - 'action, contact'
    events.contact:
      type: object
      allOf:
        - $ref: '#/components/schemas/events.base'
        - type: object
          properties:
            type:
              title: Event type
              type: string
              enum:
                - CONTACT
              example: CONTACT
            action:
              title: Contact event operation type
              type: string
              enum:
                - CREATED
                - DELETED
                - UPDATED
            contact:
              $ref: '#/components/schemas/contacts-management.contact'
          required:
            - 'action, contact'
    events.conversation-message-event:
      type: object
      allOf:
        - $ref: '#/components/schemas/events.base-conversation-message'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/events.conversation-message.event-message-props'
            conversation:
              $ref: '#/components/schemas/events.conversation-message.event-conversation-props'
    events.conversation-message:
      type: object
      allOf:
        - $ref: '#/components/schemas/events.base-conversation-message'
        - type: object
          properties:
            message:
              $ref: '#/components/schemas/events.conversation-message.event-message-props'
            conversation:
              $ref: '#/components/schemas/events.conversation-message.event-conversation-props'
    events.conversation-status-event:
      allOf:
        - $ref: '#/components/schemas/events.base-conversation-status'
        - type: object
          properties:
            conversation:
              $ref: '#/components/schemas/events.conversation-status.event-conversation-props'
          required:
            - conversation
    events.conversation-status:
      allOf:
        - $ref: '#/components/schemas/events.base-conversation-status'
        - type: object
          properties:
            conversation:
              $ref: '#/components/schemas/events.conversation-status.event-conversation-props'
          required:
            - conversation
    events.error-cause:
      type: object
      properties:
        channelErrorCode:
          title: Channel Error Code
          description: An error code returned by the channel.
          type: string
        reason:
          title: Reason
          description: A likely raw message with the information about the status.
          type: string
        details:
          title: Details
          description: A human readable text to help identify the error reason.
          type: string
    events.message-event:
      type: object
      allOf:
        - $ref: '#/components/schemas/events.base'
        - type: object
          properties:
            type:
              title: Event type
              type: string
              enum:
                - MESSAGE
              example: MESSAGE
            channel:
              title: Message Channel
              type: string
            direction:
              title: Message Direction
              description: |-
                Indicates whether the message is received from a channel (**IN**) or sent to a channel (**OUT**).

                * **IN**: Received messages.
                * **OUT**: Sent messages.
              type: string
              enum:
                - IN
                - OUT
            message:
              $ref: '#/components/schemas/message.allMo'
    events.message-status-base:
      type: object
      properties:
        code:
          title: Status code
          description: Code that indicates the message status
          type: string
        timestamp:
          title: Status timestamp
          description: Timestamp of the message status. Usually received from the provider of the channel.
          type: string
          format: date-time
        channel:
          title: Message Channel
          type: string
        description:
          title: Status description
          description: A description of status
          type: string
        direction:
          title: Message Status Direction
          description: |-
            Indicates whether the message status is received from a channel (**IN**) or sent to a channel (**OUT**).

            * **IN**: Received status.
            * **OUT**: Sent status.
          type: string
          enum:
            - IN
            - OUT
        causes:
          title: Status causes
          description: A list of errors or cause of status
          type: array
          items:
            $ref: '#/components/schemas/events.error-cause'
        context:
          $ref: '#/components/schemas/events.context.index'
        channelData:
          $ref: '#/components/schemas/events.channel-data.index'
      required:
        - code
        - timestamp
    events.message-status-event:
      type: object
      allOf:
        - $ref: '#/components/schemas/events.base'
        - type: object
          properties:
            type:
              title: Event type
              type: string
              enum:
                - MESSAGE_STATUS
              example: MESSAGE_STATUS
            channel:
              title: Message Channel
              type: string
            messageId:
              title: Message ID
              description: ID of the message whose status is being delivered
              type: string
              deprecated: true
            contentIndex:
              title: Content Index
              description: Index of content that is receiving the status update
              type: number
              deprecated: true
            message:
              properties:
                id:
                  title: Message ID
                  description: ID of the message whose status is being delivered
                  type: string
                externalId:
                  title: Message External ID
                  description: 'A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API'
                  type: string
                contentIndex:
                  title: Content Index
                  description: Index of content that is receiving the status update
                  type: number
                direction:
                  title: Message Direction
                  description: |-
                    Indicates whether the message is received from a channel (**IN**) or sent to a channel (**OUT**).

                      * **IN**: Received messages.
                      * **OUT**: Sent messages.
                  type: string
                  enum:
                    - IN
                    - OUT
                from:
                  type: string
                  description: Contact of origin
                  example: email@email.com
                to:
                  type: string
                  description: Recipient contact
                  example: received_email@email.com
            messageStatus:
              $ref: '#/components/schemas/events.message-status'
    events.message-status:
      type: object
      title: Message Status
      required:
        - code
      oneOf:
        - $ref: '#/components/schemas/events.message-status-code.recorded'
        - $ref: '#/components/schemas/events.message-status-base'
        - $ref: '#/components/schemas/events.message-status-code.terminated'
      discriminator:
        propertyName: code
        mapping:
          SENT: '#/components/schemas/events.message-status-base'
          DELIVERED: '#/components/schemas/events.message-status-base'
          READ: '#/components/schemas/events.message-status-base'
          CLICKED: '#/components/schemas/events.message-status-base'
          VERIFIED: '#/components/schemas/events.message-status-base'
          REJECTED: '#/components/schemas/events.message-status-base'
          NOT_DELIVERED: '#/components/schemas/events.message-status-base'
          DELETED: '#/components/schemas/events.message-status-base'
          ACCEPTED: '#/components/schemas/events.message-status-base'
          HANG_UP: '#/components/schemas/events.message-status-base'
          TERMINATED: '#/components/schemas/events.message-status-code.terminated'
          RECORDED: '#/components/schemas/events.message-status-code.recorded'
    events.support-expert-agent-event:
      type: object
      allOf:
        - $ref: '#/components/schemas/events.base'
        - type: object
          properties:
            ticket:
              type: object
              properties:
                id:
                  title: Ticket identifier
                  type: string
                  example: '1846867'
            expertAgent:
              title: Details of the expert agent
              type: object
              properties:
                id:
                  title: Expert agent identifier
                  type: string
                  example: '18467'
                externalId:
                  title: Expert agent external identifier
                  type: string
                  example: '184234236867'
    events.support-expert-agent:
      type: object
      allOf:
        - $ref: '#/components/schemas/events.base'
        - type: object
          properties:
            type:
              title: Event type
              type: string
              enum:
                - SUPPORT_EXPERT_AGENT
              example: SUPPORT_EXPERT_AGENT
            ticket:
              type: object
              properties:
                id:
                  title: Ticket identifier
                  type: string
                  example: '1846867'
            expertAgent:
              title: Details of the expert agent
              type: object
              properties:
                id:
                  title: Expert agent identifier
                  type: string
                  example: '18467'
                externalId:
                  title: Expert agent external identifier
                  type: string
                  example: '184234236867'
    events.channel-data.email:
      type: object
      title: Email
      description: Email specific details about the message
      properties:
        clientInfo:
          title: Client Information
          description: Information about the client that interacted with the message
          type: object
          properties:
            machineOpen:
              title: Machine Open
              description: |
                Indicates whether the provider received signals indicating that a recipient with MPP (Apple's Mail Privacy Protection) enabled has triggered an open event or if the message was conventionally opened. This does not ensure a human recipient has opened a message, it infers it. Also, the recipient does not to be related to Apple; Apple's MPP is the name of the mechanism, not the attribution to a particular provider's inbox.
                            <br>*Applicable only to messages that were sent using Sendgrid provider.*
              type: boolean
            userAgent:
              title: User agent
              description: 'User agent responsible for the event, usually a web browser'
              type: string
              example: Mozilla/5.0
            sourceIp:
              title: Client IP address
              type: string
              example: 255.255.255.255
            url:
              title: URL
              description: 'For URL-related events like CLICKED status, the URL that has been interacted with.'
              type: string
              example: 'https://example.com/clicked-link'
          required:
            - sourceIp
      required:
        - clientInfo
    events.channel-data.index:
      type: object
      title: Channel Data
      description: Channel specific details about the message.
      properties:
        sms:
          $ref: '#/components/schemas/events.channel-data.sms'
        rcs:
          $ref: '#/components/schemas/events.channel-data.rcs'
        email:
          $ref: '#/components/schemas/events.channel-data.email'
    events.channel-data.rcs:
      type: object
      title: RCS
      description: RCS specific details about the message
      properties:
        realChannel:
          title: Channel that sent the message on fallback.
          type: string
          enum:
            - sms
            - rcs
    events.channel-data.sms:
      type: object
      title: SMS
      description: SMS specific details about the message.
      properties:
        carrier:
          title: Carrier
          description: 'Carrier of the contact.<br>If the carrier is not included in this list, it will not be provided in the webhook payload.'
          type: string
          enum:
            - VIVO_BR
            - CLARO_BR
            - TIM_BR
            - OI_BR
            - CTBC_BR
            - SERCOMTEL_BR
            - SURF_BR
            - AMERICANET_BR
            - SAFRA_BR
            - TELECALL_BR
            - DATORA_BR
            - SAFRA_BR
            - LIGUE_BR
            - TELCEL_MX
            - AT_T_MX
            - MOVISTAR_MX
            - ALTAN_MX
    events.context.button:
      type: object
      title: Button
      description: Details about the button clicked.
      properties:
        type:
          title: Type
          description: Type of the clicked button.
          type: string
          enum:
            - text
            - link
            - calendar_event
            - dial
            - share_location
            - view_location
            - search_location
        payload:
          title: Payload
          description: Payload of the clicked button.
          type: string
    events.context.index:
      type: object
      title: Context
      description: Details about where the event happened.
      properties:
        button:
          $ref: '#/components/schemas/events.context.button'
    events.conversation-message.event-conversation-props:
      title: Message Conversation Object
      description: This is a Message object model
      type: object
      properties:
        id:
          title: ID
          type: string
          description: Unique identifier for the conversation
        contactId:
          title: contactId
          type: string
          description: Identifier of the contact associated with the conversation
        groupId:
          title: groupId
          type: string
          description: Identifier of the group associated with the conversation. Absent when the conversation has not yet been routed to a group
        userId:
          title: userId
          type: string
          description: Identifier of the user (agent) associated with the conversation. Absent when the conversation does not yet have an agent assigned
      required:
        - id
        - contactId
    events.conversation-message.event-message-props:
      title: Message Object
      description: This is a Message object model
      type: object
      properties:
        id:
          title: ID
          type: string
          description: Unique identifier for the message
        from:
          title: from
          type: string
          description: Identifier of the sender of the message
        to:
          title: to
          type: string
          description: Identifier of the recipient of the message
        direction:
          title: Message Direction
          description: |-
            Indicates whether the message is received from a channel (IN), sent to a channel (OUT), or is internal (INTERNAL).
                                > **Note:** The **OUT** direction is under construction.
          type: string
          enum:
            - IN
            - OUT
            - INTERNAL
        channel:
          title: Channel
          description: Channel information including type and provider
          type: object
          properties:
            type:
              type: string
            provider:
              type: string
          required:
            - type
            - provider
        contents:
          title: Message contents
          description: An array of message content objects
          type: array
          items:
            type: object
            additionalProperties: true
        timestamp:
          title: Timestamp
          description: 'Timestamp of the message was created or sent, in ISO 8601 format'
          type: string
          format: date-time
      required:
        - id
        - from
        - to
        - direction
        - channel
        - timestamp
    events.conversation-status.conversation-status-base:
      title: Conversation Object Base
      description: Common properties for all conversation status objects
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the conversation
          example: 685c69b69a748946440259e8
        status:
          type: string
          description: Status of the conversation
        statusTimestamp:
          type: string
          format: date-time
          description: Timestamp when the status was set
          example: '2025-06-25T21:15:47.955Z'
        channel:
          type: string
          description: Channel of the conversation
          example: whatsapp
        from:
          type: string
          description: Sender identifier
          example: '5521986727034'
        to:
          type: string
          description: Recipient identifier
          example: '551151963226'
        contactId:
          type: string
          description: Identifier of the contact associated with the conversation
          example: 876e9b09-4726-44c9-8202-a9b161b7a548
        groupId:
          type: string
          description: Identifier of the group associated with the conversation
          example: 65eb71c89b8c5f8fecd48d88
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the conversation was created
          example: '2025-06-25T21:27:17.699Z'
      required:
        - id
        - status
        - statusTimestamp
        - channel
        - from
        - to
        - contactId
        - groupId
        - createdAt
    events.conversation-status.event-conversation-props:
      title: Conversation Status Event Conversation Object
      description: Properties of the conversation object for status events
      oneOf:
        - $ref: '#/components/schemas/events.conversation-status.statuses.transferred'
        - $ref: '#/components/schemas/events.conversation-status.statuses.started'
        - $ref: '#/components/schemas/events.conversation-status.statuses.snoozed'
        - $ref: '#/components/schemas/events.conversation-status.statuses.queued'
        - $ref: '#/components/schemas/events.conversation-status.statuses.distributed'
        - $ref: '#/components/schemas/events.conversation-status.statuses.created'
        - $ref: '#/components/schemas/events.conversation-status.statuses.closed'
        - $ref: '#/components/schemas/events.conversation-status.statuses.claimed'
      discriminator:
        propertyName: status
        mapping:
          CONVERSATION_TRANSFERRED: '#/components/schemas/events.conversation-status.statuses.transferred'
          CONVERSATION_STARTED: '#/components/schemas/events.conversation-status.statuses.started'
          CONVERSATION_SNOOZED: '#/components/schemas/events.conversation-status.statuses.snoozed'
          CONVERSATION_QUEUED: '#/components/schemas/events.conversation-status.statuses.queued'
          CONVERSATION_DISTRIBUTED_TO_USER: '#/components/schemas/events.conversation-status.statuses.distributed'
          CONVERSATION_CREATED: '#/components/schemas/events.conversation-status.statuses.created'
          CONVERSATION_CLOSED: '#/components/schemas/events.conversation-status.statuses.closed'
          CONVERSATION_CLAIMED: '#/components/schemas/events.conversation-status.statuses.claimed'
    events.conversation-status.statuses.claimed:
      allOf:
        - $ref: '#/components/schemas/events.conversation-status.conversation-status-base'
        - type: object
          properties:
            status:
              type: string
              enum:
                - CONVERSATION_CLAIMED
            userId:
              type: string
              description: ID of the user who claimed the conversation
          required:
            - userId
    events.conversation-status.statuses.closed:
      allOf:
        - $ref: '#/components/schemas/events.conversation-status.conversation-status-base'
        - type: object
          properties:
            status:
              type: string
              enum:
                - CONVERSATION_CLOSED
            closedBy:
              type: object
              description: Details of who closed the conversation
              properties:
                id:
                  type: string
                  description: ID of the entity that closed the conversation
                  example: 6786977532d02e8004b485c2
                type:
                  type: string
                  enum:
                    - USER
                    - SYSTEM
                  description: Type of entity that closed the conversation
                  example: USER
              required:
                - id
                - type
            closeReason:
              type: object
              description: Reason for closing the conversation
              properties:
                key:
                  type: string
                  description: Key representing the reason for closing
                  example: notInterested
                name:
                  type: string
                  description: Human-readable name of the reason for closing
                  example: No Longer Interested
              required:
                - key
                - name
          required:
            - closedBy
            - closeReason
    events.conversation-status.statuses.created:
      allOf:
        - $ref: '#/components/schemas/events.conversation-status.conversation-status-base'
        - type: object
          properties:
            status:
              type: string
              enum:
                - CONVERSATION_CREATED
    events.conversation-status.statuses.distributed:
      allOf:
        - $ref: '#/components/schemas/events.conversation-status.conversation-status-base'
        - type: object
          properties:
            status:
              type: string
              enum:
                - CONVERSATION_DISTRIBUTED_TO_USER
            groupId:
              type: string
              description: Identifier of the group associated with the conversation
              example: 65eb71c89b8c5f8fecd48d88
            userId:
              type: string
              description: ID of the user to whom the conversation was distributed
              example: 6786977532d02e8004b485c2
          required:
            - groupId
            - userId
    events.conversation-status.statuses.queued:
      allOf:
        - $ref: '#/components/schemas/events.conversation-status.conversation-status-base'
        - type: object
          properties:
            status:
              type: string
              enum:
                - CONVERSATION_QUEUED
    events.conversation-status.statuses.snoozed:
      allOf:
        - $ref: '#/components/schemas/events.conversation-status.conversation-status-base'
        - type: object
          properties:
            status:
              type: string
              enum:
                - CONVERSATION_SNOOZED
            snoozedUntil:
              type: string
              format: date-time
              description: Timestamp until the conversation is snoozed
              example: '2025-06-23T17:43:00.396Z'
          required:
            - snoozedUntil
    events.conversation-status.statuses.started:
      allOf:
        - $ref: '#/components/schemas/events.conversation-status.conversation-status-base'
        - type: object
          properties:
            status:
              type: string
              enum:
                - CONVERSATION_STARTED
    events.conversation-status.statuses.transferred:
      allOf:
        - $ref: '#/components/schemas/events.conversation-status.conversation-status-base'
        - type: object
          properties:
            status:
              type: string
              enum:
                - CONVERSATION_TRANSFERRED
            transferType:
              type: string
              enum:
                - TRANSFER_TO_USER
                - TRANSFER_TO_GROUP
              description: 'Type of transfer: to a user or to a group'
              example: TRANSFER_TO_USER
            transferredBy:
              type: object
              description: Details of who initiated the transfer
              properties:
                id:
                  type: string
                  description: ID of the entity that initiated the transfer
                  example: system
                type:
                  type: string
                  enum:
                    - USER
                    - SYSTEM
                  description: Type of entity that initiated the transfer
                  example: SYSTEM
              required:
                - id
                - type
            newUserId:
              type: string
              description: ID of the new user to whom the conversation was transferred
              example: 6786977532d02e8004b485c2
            newGroupId:
              type: string
              description: ID of the new group to which the conversation was transferred
              example: 682f96fdf93dac82cc325a20
            previousUserId:
              type: string
              description: ID of the previous user who handled the conversation
              example: 6786977532d02e8004b485c2
            previousGroupId:
              type: string
              description: ID of the previous group that handled the conversation
              example: 65eb71c89b8c5f8fecd48d88
          required:
            - transferType
            - transferredBy
    events.message-status-code.recorded:
      type: object
      allOf:
        - $ref: '#/components/schemas/events.message-status-base'
        - type: object
          properties:
            code:
              type: string
              example: RECORDED
            details:
              type: object
              description: Details of the call record
              properties:
                file:
                  type: object
                  properties:
                    url:
                      type: string
                      description: URL of the call recording file
                    name:
                      type: string
                      description: Name of the call recording file
                    sizeBytes:
                      type: number
                      description: Size of the call recording file in bytes
                    mimeType:
                      type: string
                      description: Type of the call recording file
          required:
            - code
    events.message-status-code.terminated:
      type: object
      allOf:
        - $ref: '#/components/schemas/events.message-status-base'
        - type: object
          properties:
            code:
              type: string
              example: TERMINATED
            details:
              type: object
              description: Details of the call termination
              properties:
                startTime:
                  type: string
                  description: Start time of the call
                endTime:
                  type: string
                  description: End time of the call
                durationSeconds:
                  type: number
                  description: Duration of the call in seconds
          required:
            - code
    files.file:
      type: object
      allOf:
        - type: object
          properties:
            id:
              title: ID
              description: ID of the file resource created.
              type: string
              example: f8b5a77c7cd3403b08231a1a9c40705717cbc8cab4a9a9e08bf8a5c78905b7d5
              readOnly: true
            url:
              title: URL
              description: URL from where the file content is available.
              type: string
              example: 'https://zenvia.chat/storage/files/f8b5a77c7cd3403b08231a1a9c40705717cbc8cab4a9a9e08bf8a5c78905b7d5.bin'
              readOnly: true
            sourceUrl:
              title: Source URL
              description: URL from where the file content will be obtained.
              type: string
              example: 'https://zenvia.com/example.mp4'
              writeOnly: true
            sourceHeaders:
              title: Source Headers
              description: These headers will be sent in the request to `sourceUrl` to get the file content.
              type: object
              example:
                Authorization: Basic dXNlcjpwd2Q=
                X-Custom-Token: TOKEN
              writeOnly: true
          required:
            - sourceUrl
        - $ref: '#/components/schemas/files.multipart-data'
        - type: object
          properties:
            bytes:
              title: Bytes
              description: Size in bytes of the file content created.
              type: number
              example: 1044889600
              readOnly: true
            createdAt:
              title: Created At
              description: Timestamp of the file creation.
              type: string
              example: '2021-12-20T14:37:59.000Z'
              readOnly: true
            deleteAt:
              title: Delete At
              description: Timestamp of the moment after which the file will be automatically deleted.
              type: string
              example: '2021-12-21T14:37:59.000Z'
              readOnly: true
    files.multipart-data:
      title: File object
      description: This is a file object model.
      type: object
      properties:
        mimeType:
          title: Mime Type
          description: 'Mime type of the file. When not provided, it will be determined based either on the header *Content-Type* or the file name *extension*.'
          type: string
          example: video/mp4
        name:
          title: Name
          description: 'Name of the file. When not provided, it will be obtained from either the header *Content-Disposition* or the URL path.'
          type: string
          example: my-video.mp4
        autoDeleteMinutes:
          title: Auto Delete Minutes
          default: null
          nullable: true
          minimum: 1
          description: |-
            Amount of minutes after which the file will be automatically deleted.
                                <br>The default value, `null`, means the file will be kept until manually deleted.
          type: number
          example: 1440
          writeOnly: true
    flow.batches.aggregated-status:
      title: Aggregated batch status
      description: Detailed status of the batch items
      type: object
      properties:
        successProcessedRecords:
          description: The quantity of records processed with success
          type: number
          example: 1
        timedoutRecords:
          description: The quantity of records in timed out
          type: number
          example: 1
        errorProcessedRecords:
          description: The quantity of records processed with error
          type: number
          example: 1
        canceledRecords:
          description: The quantity of records canceled
          type: number
          example: 1
        processingRecords:
          description: The quantity of records in processing
          type: number
          example: 1
        queuedRecords:
          description: The quantity of records in queue
          type: number
          example: 1
    flow.batches.base:
      title: Flow Batch Status Object
      description: This is a Flow Batch Status object model.
      type: object
      properties:
        id:
          type: string
          description: The flow batch identifier.
          example: 853c2b58-8367-4fcb-8d16-d42208e15942
          readOnly: true
        flowId:
          type: string
          description: 'The the flow identifier. You can view your <a href="https://app.zenvia.com/flows" target="_blank"> Flow IDs here.</a>'
          example: c2c3e42d-6fb7-4ad6-897a-dd7613469f58
        name:
          type: string
          description: The batch name.
          example: Sales campaing
        status:
          description: |-
            The batch status:
                    <br>`LOADING`: Loading the batch
                    <br>`READY`: Batch loaded and ready to be dispatched
                    <br>`QUEUED`: Batch sent to dispatch queue
                    <br>`PROCESSING`: Batch dispatch in progress
                    <br>`WAITING`: Waiting confirmation of the batch status
                    <br>`COMPLETED`: Batch completed
                    <br>`CANCELING`: Batch being canceled
                    <br>`CANCELED`: Batch canceled
                    <br>`TIMEOUT`: Timeout to process the batch
                    <br>`ERROR`: Error to proceed with the batch
          enum:
            - LOADING
            - READY
            - QUEUED
            - PROCESSING
            - WAITING
            - COMPLETED
            - CANCELING
            - CANCELED
            - TIMEOUT
            - ERROR
          type: string
          example: READY
          readOnly: true
        errorCode:
          description: The batch error
          type: 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
          example: FLOW_ID_NOT_FOUND
          readOnly: true
        size:
          description: The quantity of recived registers
          type: number
          example: 1
          readOnly: true
        aggregatedStatus:
          type: object
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/flow.batches.aggregated-status'
        progress:
          description: Progress of batch. 0-100
          type: number
          example: 100
          readOnly: true
        schedule:
          type: object
          $ref: '#/components/schemas/flow.batches.schedule'
        createdAt:
          type: string
          description: The created date.
          example: '2021-08-03T16:26:23.616Z'
          readOnly: true
        createdByUserEmail:
          type: string
          description: The creator e-mail
          example: user@mail.com
          readOnly: true
      required:
        - flowId
        - name
    flow.batches.content:
      title: The batch content
      description: The content to be used on dispatch
      type: object
      properties:
        fieldNames:
          description: 'Field names, ignored when containsHeader=true (you can send empty in this case)'
          type: array
          minItems: 1
          items:
            type: string
          example:
            - sms
            - name
            - product
            - deliveryDate
    flow.batches.file:
      title: CSV file properties
      description: Informations about the CSV file
      type: object
      properties:
        name:
          type: string
          description: The file name.
          example: file.csv
          readOnly: true
        containsHeader:
          description: Set true if the file contains the fields names in the header or false if not
          type: boolean
          example: true
        charset:
          description: File headers (CSV)
          type: string
          example: UTF-8
          readOnly: true
      required:
        - containsHeader
    flow.batches.item:
      allOf:
        - $ref: '#/components/schemas/flow.batches.base'
        - type: object
          properties:
            content:
              type: object
              allOf:
                - $ref: '#/components/schemas/flow.batches.content'
              properties:
                file:
                  $ref: '#/components/schemas/flow.batches.file'
    flow.batches.json:
      title: Flow Batch Object for request with json request.
      description: This is a Flow Batch object model for request with json request.
      allOf:
        - $ref: '#/components/schemas/flow.batches.base'
        - type: object
          properties:
            content:
              type: object
              allOf:
                - $ref: '#/components/schemas/flow.batches.content'
                - type: object
                  required:
                    - fieldNames
                    - fields
              properties:
                fields:
                  description: 'A list of field values, each item refers to a contact'
                  type: array
                  minItems: 1
                  items:
                    type: array
                    items:
                      type: string
                  example:
                    - - '5511999999999'
                      - John
                      - Smartphone
                      - 20/07/2021
                    - - '5511911111111'
                      - Paul
                      - Tablet
                      - 21/07/2021
                  writeOnly: true
          required:
            - content
    flow.batches.multipart:
      title: Flow Batch Object for request with file.
      description: This is a Flow Batch object model for request with file.
      allOf:
        - $ref: '#/components/schemas/flow.batches.base'
        - type: object
          properties:
            content:
              type: object
              allOf:
                - $ref: '#/components/schemas/flow.batches.content'
              properties:
                file:
                  $ref: '#/components/schemas/flow.batches.file'
              required:
                - file
          required:
            - content
    flow.batches.schedule:
      title: Batch schedule
      description: Schedule to the batch dispatch
      type: object
      properties:
        start:
          type: string
          description: The schedule start date.
          example: '2021-08-03T16:26:23.616Z'
        end:
          type: string
          description: The schedule end date.
          example: '2021-08-03T16:26:23.616Z'
        limit:
          type: string
          description: The schedule limit date.
          example: '2021-08-03T16:26:23.616Z'
    groups.agent:
      title: Agent
      description: 'An agent belonging to a group, with their current availability.'
      type: object
      properties:
        id:
          title: Id
          description: The agent identifier.
          type: string
          readOnly: true
        firstName:
          title: First name
          type: string
          readOnly: true
        lastName:
          title: Last name
          type: string
          readOnly: true
        available:
          title: Available
          description: Whether the agent is currently available to receive conversations.
          type: boolean
          readOnly: true
        status:
          title: Status
          description: The agent's current status.
          type: string
          enum:
            - AVAILABLE
            - PRE_PAUSE
            - PAUSE
            - UNAVAILABLE
          readOnly: true
      required:
        - id
        - firstName
        - available
        - status
    groups.group:
      title: Group
      description: A team agents are organized into for conversation distribution.
      type: object
      properties:
        id:
          title: Id
          description: The group identifier.
          type: string
          readOnly: true
        name:
          title: Name
          description: The group name.
          type: string
          readOnly: true
        displayName:
          title: Display name
          description: 'A human-friendly name for the group, when configured.'
          type: string
          readOnly: true
        enabled:
          title: Enabled
          description: Whether the group is enabled. Disabled groups are never returned by the list endpoint.
          type: boolean
          readOnly: true
      required:
        - id
        - name
        - enabled
    marketing-automations.marketing-automation-response:
      title: Marketing Automation Response Object
      description: Response from an marketing automation run
      type: object
      properties:
        id:
          type: string
          description: The dispatch identifier
          example: 7388c68e-675e-435b-b2ec-f72677798678
        status:
          type: string
          description: The dispatch status
          example: SENT
        marketingAutomationId:
          type: string
          description: The marketing automation identifier
          example: 5c408dd6-a39a-4eb1-b3b0-bf6f2f34ea39
    marketing-automations.marketing-automation:
      title: Marketing Automation Object
      description: This is a marketing automation object
      type: object
      properties:
        recipientChannels:
          title: Recipient's channels
          description: List of recipient's channels. All channels registered in marketing automation must be provided
          type: object
          minProperties: 1
          properties:
            sms:
              type: string
            whatsapp:
              type: string
            email:
              type: string
            rcs:
              type: string
          additionalProperties: false
          example:
            sms: '5511999999999'
            email: email@email.com
        variables:
          title: Variables
          description: Variables list registered in automation steps. All variables registered in marketing automation must be provided
          type: object
          additionalProperties:
            type: string
          example:
            name: John Doe
            birthdate: 01/01/1979
      required:
        - recipientChannels
    message.all:
      type: object
      title: Message
      description: Message sent by the contact
      allOf:
        - $ref: '#/components/schemas/message.base'
        - type: object
          properties:
            visitor:
              $ref: '#/components/schemas/message.visitor'
            referral:
              $ref: '#/components/schemas/message.referral'
            contents:
              items:
                $ref: '#/components/schemas/content.all'
            idRef:
              title: Referenced Message ID
              description: |-
                When a user sends a message quoting a previous message, the identifier of the quoted message will be provided here. Also:
                * On reply button clicks (see [replyable text](#section/Replyable-Text) and [card](#section/Card) sections), this will refer to the ID of the clicked message.
                * On [SMS](#tag/SMS) channel, this will refer to the ID of the last message sent to the contact.

                *Only applicable to [WhatsApp](#tag/WhatsApp), [Instagram](#tag/Instagram), [SMS](#tag/SMS), [Facebook](#tag/Facebook), [RCS](#tag/RCS) and [E-Mail](#tag/E-Mail) channels.*
              type: string
              readOnly: true
    message.allMo:
      type: object
      title: Message
      description: Message sent by the contact
      allOf:
        - $ref: '#/components/schemas/message.baseMo'
        - type: object
          properties:
            visitor:
              $ref: '#/components/schemas/message.visitor'
            referral:
              $ref: '#/components/schemas/message.referral'
            contents:
              items:
                $ref: '#/components/schemas/content.all'
            idRef:
              title: Referenced Message ID
              description: |-
                When a user sends a message quoting a previous message, the identifier of the quoted message will be provided here. Also:
                * On reply button clicks (see [replyable text](#section/Replyable-Text) and [card](#section/Card) sections), this will refer to the ID of the clicked message.
                * On [SMS](#tag/SMS) channel, this will refer to the ID of the last message sent to the contact.

                *Only applicable to [WhatsApp](#tag/WhatsApp), [Instagram](#tag/Instagram), [SMS](#tag/SMS), [Facebook](#tag/Facebook), [RCS](#tag/RCS) and [E-Mail](#tag/E-Mail) channels.*
              type: string
              readOnly: true
    message.base:
      title: Message Object
      description: This is a Message object model
      type: object
      properties:
        id:
          title: Message ID
          description: An ID for the message. It can be used for future message consulting or callback notifications.
          type: string
          readOnly: true
        externalId:
          title: Message External ID
          description: 'A customizable identifier for dispatches, allowing users to customize and track their dispatches within the API'
          type: string
        from:
          title: Sender ID
          description: |-
            The identifier of the sender of the message. The sender is created when an integration for the channel is connected
                    on the [integrations console](https://app.zenvia.com/home/credentials).
                    <br>More details on the channel's *sender and recipient* section.
          type: string
          minLength: 1
          maxLength: 64
        to:
          title: Recipient ID
          description: |-
            The identifier of the recipient (varies according to the channel) of the message.
                    <br>More details on the channel's *sender and recipient* section.
          type: string
          minLength: 1
          maxLength: 64
        direction:
          title: Message direction
          description: Indicates whether the message is received from a channel (IN) or sent to a channel (OUT)
          type: string
          enum:
            - IN
            - OUT
          readOnly: true
        channel:
          title: Message channel
          description: Message channel
          type: string
          readOnly: true
        contents:
          title: Message Contents
          description: The list of contents to be sent
          type: array
          items:
            type: object
          minItems: 1
        timestamp:
          title: Message timestamp
          description: Timestamp of the message. Usually received from the provider of the channel.
          type: string
          format: date-time
          readOnly: true
      required:
        - from
        - to
        - contents
    message.baseMo:
      title: Message Object
      description: This is a Message object model
      type: object
      properties:
        id:
          title: Message ID
          description: An ID for the message. It can be used for future message consulting or callback notifications.
          type: string
          readOnly: true
        from:
          title: Sender ID
          description: |-
            The identifier of the sender of the message. The sender is created when an integration for the channel is connected
                    on the [integrations console](https://app.zenvia.com/home/credentials).
                    <br>More details on the channel's *sender and recipient* section.
          type: string
          minLength: 1
          maxLength: 64
        to:
          title: Recipient ID
          description: |-
            The identifier of the recipient (varies according to the channel) of the message.
                    <br>More details on the channel's *sender and recipient* section.
          type: string
          minLength: 1
          maxLength: 64
        direction:
          title: Message direction
          description: Indicates whether the message is received from a channel (IN) or sent to a channel (OUT)
          type: string
          enum:
            - IN
            - OUT
          readOnly: true
        channel:
          title: Message channel
          description: Message channel
          type: string
          readOnly: true
        contents:
          title: Message Contents
          description: The list of contents to be sent
          type: array
          items:
            type: object
          minItems: 1
        timestamp:
          title: Message timestamp
          description: Timestamp of the message. Usually received from the provider of the channel.
          type: string
          format: date-time
          readOnly: true
      required:
        - from
        - to
        - contents
    message.channel:
      type: string
      title: Channel
      description: Message channel
    message.email:
      type: object
      allOf:
        - $ref: '#/components/schemas/message.base'
        - type: object
          properties:
            contents:
              title: Message Contents
              description: A list of content to be sent
              type: array
              items:
                $ref: '#/components/schemas/content.email.all'
              minItems: 1
            representative:
              allOf:
                - $ref: '#/components/schemas/message.representative'
              example:
                name: Sender Name
            conversation:
              $ref: '#/components/schemas/content.conversation'
    message.facebook:
      type: object
      allOf:
        - $ref: '#/components/schemas/message.base'
        - type: object
          properties:
            contents:
              title: Message Contents
              description: A list of content to be sent
              type: array
              items:
                $ref: '#/components/schemas/content.facebook.mt'
              minItems: 1
            conversation:
              $ref: '#/components/schemas/content.conversation'
    message.gbm:
      type: object
      allOf:
        - $ref: '#/components/schemas/message.base'
        - type: object
          properties:
            contents:
              title: Message Contents
              description: A list of content to be sent
              type: array
              items:
                $ref: '#/components/schemas/content.gbm.all'
              minItems: 1
            representative:
              $ref: '#/components/schemas/message.representative'
            conversation:
              $ref: '#/components/schemas/content.conversation'
    message.instagram:
      type: object
      allOf:
        - $ref: '#/components/schemas/message.base'
        - type: object
          properties:
            contents:
              title: Message Contents
              description: A list of content to be sent
              type: array
              items:
                $ref: '#/components/schemas/content.instagram.mt'
              minItems: 1
            representative:
              allOf:
                - $ref: '#/components/schemas/message.representative'
              example:
                type: HUMAN
            conversation:
              $ref: '#/components/schemas/content.conversation'
    message.rcs:
      type: object
      allOf:
        - $ref: '#/components/schemas/message.base'
        - type: object
          properties:
            contents:
              title: Message Contents
              description: A list of content to be sent
              type: array
              items:
                $ref: '#/components/schemas/content.rcs.mo'
              minItems: 1
            conversation:
              $ref: '#/components/schemas/content.conversation'
    message.referral:
      title: Referral Object
      description: |-
        Included in notifications where it is possible to track the source of the message. Examples:
        * When a user clicks on an ad that redirects to WhatsApp and sends a message to the business
        * When a user tags the business on their Instagram story
        * When a user replies to a Instagram story from the business
        * When a user quotes an message in the Instagram direct conversation

        *Only applicable to [WhatsApp](#tag/WhatsApp) and [Instagram](#tag/Instagram) channels.*
      type: object
      properties:
        headline:
          title: Headline
          description: |-
            Headline used in the ad that generated the message.
                                <br>*Only applicable to [WhatsApp](#tag/WhatsApp) channel.*
          type: string
          example: This is a headline
        body:
          title: Body
          description: |-
            Body from the ad that generated the message.
                                <br>*Only applicable to [WhatsApp](#tag/WhatsApp) channel.*
          type: string
          example: This is a body
        source:
          type: object
          title: Referral source
          description: Provide details about the source of the message.
          properties:
            id:
              title: Id
              description: An id for the message source. The format of the id will depend on the source type.
              type: string
            type:
              title: Type
              description: The type of content where the message originated.
              type: string
              enum:
                - ad
                - post
                - story_mention
                - sharing
                - story
                - message
                - live
            url:
              title: URL
              description: The URL that leads to the message source. Opening this URL takes you to the content viewed by the user.
              type: string
              example: 'https://www.zenvia.com'
            text:
              title: Text
              description: |-
                The content of the quoted text message.
                                        <br>*Only applicable to [Instagram](#tag/Instagram) channel.*
              type: string
            user:
              title: User
              description: |-
                The user who sent the quoted text message.
                                        <br>*Only applicable to [Instagram](#tag/Instagram) channel.*
              type: string
            timestamp:
              title: Timestamp
              description: |-
                The timestamp of the quoted text message.
                                        <br>*Only applicable to [Instagram](#tag/Instagram) channel.*
              type: string
        ctwaId:
          title: Click ID
          description: |-
            Click ID generated by Meta for ads that click to WhatsApp.
                                <br>*Only applicable to [WhatsApp](#tag/WhatsApp) channel.*
          type: string
          example: '12345'
    message.representative:
      title: Representative Object
      description: |-
        Provides information on the representative who sent the message.
                        <br>It is mainly meant to be used when a **human agent** is the message's sender.
                        <br><br>*Only applicable to [Instagram](#tag/Instagram), [Google Business Messages](#tag/Google-Business-Messages) and [E-Mail](#tag/E-Mail) channels.*
      type: object
      properties:
        type:
          title: Type
          description: |-
            Indicates whether the message sender is a *bot* or a *human agent*.
                                <br>The `HUMAN` value must only be used on a message coming from a **human agent**.
                                <br><br>*Only applicable to [Instagram](#tag/Instagram) and [Google Business Messages](#tag/Google-Business-Messages) channels.*
          type: string
          enum:
            - BOT
            - HUMAN
          default: BOT
          example: HUMAN
        name:
          title: Name
          description: |-
            Representative's name shown on the message.
                                <br>*Only applicable to [Google Business Messages](#tag/Google-Business-Messages) and [E-Mail](#tag/E-Mail) channels.*
          type: string
          example: Agent name
        picture:
          title: Picture
          description: |-
            URL for the avatar picture of the representative message.
                                <br>*Only applicable to [Google Business Messages](#tag/Google-Business-Messages) channel.*
          type: string
          example: 'https://zenvia.com/favicon.ico'
    message.sms:
      type: object
      allOf:
        - $ref: '#/components/schemas/message.base'
        - type: object
          properties:
            contents:
              title: Message Contents
              description: A list of content to be sent
              type: array
              items:
                $ref: '#/components/schemas/content.sms.all'
              minItems: 1
            conversation:
              $ref: '#/components/schemas/content.conversation'
    message.telegram:
      type: object
      allOf:
        - $ref: '#/components/schemas/message.base'
        - type: object
          properties:
            contents:
              title: Message Contents
              description: A list of content to be sent
              type: array
              items:
                $ref: '#/components/schemas/content.telegram.all'
              minItems: 1
            conversation:
              $ref: '#/components/schemas/content.conversation'
    message.visitor:
      title: Visitor Object
      description: |-
        It provides information about the contact who sent the message.
                        <br>The availability of this information depends on privacy settings of the contact.
                        <br><br>*Only applicable to [WhatsApp](#tag/WhatsApp), [Instagram](#tag/Instagram),
                        [Facebook](#tag/Facebook), [Telegram](#tag/Telegram), [Google Business Messages](#tag/Google-Business-Messages)
                        and [E-Mail](#tag/E-Mail) channels.*
      type: object
      properties:
        name:
          title: Name
          description: Full name of the contact.
          type: string
        firstName:
          title: First name
          description: |-
            First name of the contact.
                                <br>*Only applicable to [WhatsApp](#tag/WhatsApp), [Facebook](#tag/Facebook) and [Telegram](#tag/Telegram) channels.*
          type: string
        lastName:
          title: Last name
          description: |-
            Last name of the contact.
                                <br>*Only applicable to [WhatsApp](#tag/WhatsApp), [Facebook](#tag/Facebook) and [Telegram](#tag/Telegram) channels.*
          type: string
        userName:
          title: User name
          description: |-
            User name of the contact.
                                <br>*Only applicable to [Instagram](#tag/Instagram) channel.*
          type: string
        picture:
          title: Picture
          description: |-
            URL for the profile picture of the contact.
                                <br>*Only applicable to [Instagram](#tag/Instagram) and [Facebook](#tag/Facebook) channels.*
          type: string
    message.voice:
      type: object
      allOf:
        - $ref: '#/components/schemas/message.base'
        - type: object
          properties:
            contents:
              title: Message Contents
              description: A list of content to be sent
              type: array
              items:
                $ref: '#/components/schemas/content.voice.all'
              minItems: 1
    message.whatsapp:
      type: object
      allOf:
        - $ref: '#/components/schemas/message.base'
        - type: object
          properties:
            contents:
              title: Message Contents
              description: A list of content to be sent
              type: array
              items:
                $ref: '#/components/schemas/content.whatsapp.mt'
              minItems: 1
            idRef:
              type: string
              description: |-
                Id of the message sent or received in the conversation channel to reference as a message reply.
                        <br>*Only applicable to [WhatsApp](#tag/WhatsApp) channel.*
              example: 7390113b-e120-41b5-8a07-c4567726abc2
            contentRef:
              type: number
              description: |-
                Index of the content in the message sent or received in the conversation channel to reference as a message reply.
                        <br>If ommited, the index to reference will be `0` (the first content of the message).
                        <br>*Only applicable to [WhatsApp](#tag/WhatsApp) channel.*
              default: 0
              example: 1
            conversation:
              $ref: '#/components/schemas/content.conversation'
    partners-batches.batch-create-response:
      type: object
      description: Represents the imported batch.
      properties:
        id:
          type: string
          description: The unique identifier for the import record.
          example: dc514337-14c4-4f53-947b-93088b450e2e
        organizationId:
          type: string
          description: The unique identifier of the organization the import belongs to.
          example: a49c0383-57b1-4627-bfaa-6019b7e7fe53
        fileName:
          type: string
          description: The name of the imported file.
          example: Contacts - Batch 1
        fileUrl:
          type: string
          description: The uploaded file's url.
          example: 'https://chat.zenvia.com/storage/folders/a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6/files/c4a4e9a1-2c9c-4d3a-8f7b-9b4e2e0d1f3e.bin'
        status:
          type: string
          description: The final status of the file processing.
          enum:
            - SUCCESS
            - PENDING
            - FAILED
          example: SUCCESS
        createdAt:
          type: string
          description: 'The date and time the record was created, in ISO 8601 format.'
          example: '2025-04-23T18:42:50.325Z'
    partners-batches.batch-list-response:
      type: object
      description: Represents a batch of contacts for processing.
      properties:
        id:
          type: string
          description: The unique identifier for the batch.
          example: c4a4e9a1-2c9c-4d3a-8f7b-9b4e2e0d1f3e
        organizationId:
          type: string
          description: The ID of the organization the batch belongs to.
          example: a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6
        fileName:
          type: string
          description: The original name of the uploaded file.
          example: contacts_q3_2025.csv
        fileUrl:
          type: string
          description: The uploaded file's url.
          example: 'https://chat.zenvia.com/storage/folders/a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6/files/c4a4e9a1-2c9c-4d3a-8f7b-9b4e2e0d1f3e.bin'
        fileExpireAt:
          type: string
          description: 'The expiration date and time for file access, in ISO 8601 format. (Default of 10 days)'
          example: '2025-08-06T23:59:59.000Z'
        lines:
          type: number
          description: The number of lines or records in the file.
          example: 1000
        status:
          type: string
          description: The current processing status of the batch.
          enum:
            - SUCCESS
            - PENDING
            - FAILED
          example: SUCCESS
        feedbackUrl:
          type: string
          description: The uploaded file's feedback url.
          example: 'https://chat.zenvia.com/storage/folders/a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6/files/4094d16af43dea0fcba63bcb217b60b07cb9e46dfa1f22b1f965ea2b433871ea.bin'
        feedbackExpireAt:
          type: string
          description: 'The expiration date and time for file access, in ISO 8601 format. (Default of 10 days)'
          example: '2025-08-06T23:59:59.000Z'
        consolidatedStatus:
          type: object
          description: Describes the consolidated status of the batch processing. (Only showed when `status` is `SUCCESS` or `FAILED`.)
          properties:
            extractedRecords:
              type: number
              description: The number of records extracted from the original file.
              example: 1000
            mappedRecords:
              type: number
              description: The number of records successfully mapped to the expected format.
              example: 1000
            successProcessedRecords:
              type: number
              description: The number of records that were successfully processed and saved.
              example: 990
            errorProcessedRecords:
              type: number
              description: The number of records that failed during processing.
              example: 10
        createdAt:
          type: string
          description: 'The creation date and time of the batch, in ISO 8601 format.'
          example: '2025-07-30T19:55:42.321Z'
        updatedAt:
          type: string
          description: 'The date and time of the last update to the batch, in ISO 8601 format.'
          example: '2025-07-30T19:56:10.123Z'
    reports.flow.entries.base:
      title: Entry object for Flow Report
      description: The entry object model for Flow Report.
      type: object
      properties:
        flowId:
          title: Flow ID
          description: 'The the flow identifier. You can view your <a href="https://app.zenvia.com/flows" target="_blank"> Flow IDs here.</a>'
          type: string
        dispatchId:
          title: Dispatch ID
          description: The dispatch identifier
          type: string
        sessionId:
          title: Session ID
          description: 'An ID that represents a flow execution. In case of conversational flows, it identifies the conversation in our platform.'
          type: string
        firstEventTimestamp:
          title: First event timestamp
          description: Time of the first event with the client
          type: string
        lastEventTimestamp:
          title: Last event timestamp
          description: Time of the last event with the client
          type: string
        variables:
          title: Objects of varibles
          description: Object where session variables are saved
          type: object
    reports.message.entry.base:
      title: Entry object for Message Report
      description: The entry object model for Message Report.
      type: object
      properties:
        channel:
          title: Channel
          type: string
          readOnly: true
        type:
          title: Message type
          description: 'The type of messages, which may be either "message" or "notification".'
          type: string
          readOnly: true
        directionInTotal:
          title: IN messages total
          description: The total of IN direction messages.
          type: number
          readOnly: true
        directionOutTotal:
          title: OUT messages total
          description: The total of OUT direction messages.
          type: number
          readOnly: true
        total:
          title: Messages total
          description: The total of messages including IN and OUT directions.
          type: number
          readOnly: true
    status-groups.status-groups:
      title: Status Groups
      description: Status Groups information.
      type: object
      properties:
        id:
          title: ID
          description: ID of the Zenvia plataform/service.
          type: string
          readOnly: true
          example: whatsapp
        name:
          title: Name
          description: Name of the Zenvia plataform/service.
          type: string
          example: whatsapp
        type:
          title: Type
          description: 'Type of the Status Group. The configured type will only appear if available and if the user uses a valid [authentication](#section/Authentication)'
          type: string
          enum:
            - system
            - configured
          example: configured
        status:
          title: Status
          description: Indicates the status of a Zenvia group or component
          type: string
          enum:
            - UP
            - UNKNOWN
            - WARNING
            - DOWN
          example: UP
        timestamp:
          title: Timestamp
          description: Indicates the moment in which the state was generated.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
        window:
          title: Window
          description: Indicates the time window that the state represents.
          type: object
          properties:
            seconds:
              title: Seconds
              description: Size of the time window.
              type: number
              example: 60
            timestamp:
              title: Timestamp
              description: Beginning of the time window.
              type: string
              example: '2023-02-23T19:37:00Z'
            id:
              title: Id
              description: Identifier of the time window.
              type: number
              example: 27929555
        components:
          title: Components
          description: Components that are a part of the status.
          type: array
          items:
            title: Components
            description: Components that are a part of the status.
            type: object
            properties:
              id:
                title: Id
                description: Identifier of a component of the status groups.
                type: string
                example: core-api
              name:
                title: Name
                description: Name of a component of the status groups.
                type: string
                example: Platform
              status:
                title: Status
                description: Status of a component of the status groups.
                type: string
                enum:
                  - UP
                  - UNKNOWN
                  - WARNING
                  - DOWN
                example: UP
            additionalProperties:
              description: Value provided to fill the variable named after the property name.
              oneOf:
                - type: string
                  example: Zenvia
                - type: number
                  example: 1
                - type: boolean
                  example: true
    subscription.all:
      oneOf:
        - $ref: '#/components/schemas/subscription.message-subscription'
        - $ref: '#/components/schemas/subscription.message-status-subscription'
        - $ref: '#/components/schemas/subscription.conversation-status-subscription'
        - $ref: '#/components/schemas/subscription.conversation-message-subscription'
        - $ref: '#/components/schemas/subscription.support-expert-agent-subscription'
        - $ref: '#/components/schemas/subscription.contact-subscription'
      discriminator:
        propertyName: eventType
        mapping:
          MESSAGE: '#/components/schemas/subscription.message-subscription'
          MESSAGE_STATUS: '#/components/schemas/subscription.message-status-subscription'
          CONVERSATION_MESSAGE: '#/components/schemas/subscription.conversation-message-subscription'
          CONVERSATION_STATUS: '#/components/schemas/subscription.conversation-status-subscription'
          SUPPORT_EXPERT_AGENT: '#/components/schemas/subscription.support-expert-agent-subscription'
          CONTACT: '#/components/schemas/subscription.contact-subscription'
    subscription.base:
      type: object
      properties:
        id:
          title: Subscription Id
          type: string
          readOnly: true
        eventType:
          title: Event type to subscribe
          type: string
          enum:
            - MESSAGE
            - MESSAGE_STATUS
            - CONVERSATION_MESSAGE
            - CONVERSATION_STATUS
            - SUPPORT_EXPERT_AGENT
            - CONVERSATION_MESSAGE
            - CONVERSATION_STATUS
            - CONTACT
        webhook:
          allOf:
            - $ref: '#/components/schemas/subscription.webhook'
            - type: object
              required:
                - url
        status:
          $ref: '#/components/schemas/subscription.status'
        version:
          title: Version of subscription
          type: string
          enum:
            - v1
            - v2
          default: v2
          example: v2
        createdAt:
          title: Creation timestamp
          description: Creation timestamp in ISO format
          type: string
          readOnly: true
        updatedAt:
          title: Update timestamp
          description: Update timestamp in ISO format
          type: string
          readOnly: true
      required:
        - eventType
        - webhook
    subscription.contact-subscription:
      type: object
      allOf:
        - $ref: '#/components/schemas/subscription.base'
        - type: object
          properties:
            criteria:
              type: object
              properties:
                action:
                  title: Contact events to subscribe to
                  description: Configure one or more contact-type events to subscribe to
                  type: array
                  minItems: 1
                  items:
                    type: string
                    enum:
                      - CREATED
                      - DELETED
                      - UPDATED
              required:
                - action
          required:
            - criteria
    subscription.conversation-message-subscription:
      type: object
      allOf:
        - $ref: '#/components/schemas/subscription.base'
        - type: object
          properties:
            eventType:
              type: string
              enum:
                - CONVERSATION_MESSAGE
            criteria:
              type: object
              properties:
                channel:
                  $ref: '#/components/schemas/message.channel'
                direction:
                  title: Message direction
                  description: 'Indicates whether the message is received from a channel (IN), sent to a channel (OUT) or sent internally (INTERNAL)'
                  type: string
                  enum:
                    - IN
                    - OUT
                    - INTERNAL
              required:
                - channel
                - direction
          required:
            - eventType
            - criteria
    subscription.conversation-status-subscription:
      type: object
      allOf:
        - $ref: '#/components/schemas/subscription.base'
        - type: object
          properties:
            eventType:
              type: string
              enum:
                - CONVERSATION_STATUS
    subscription.message-status-subscription:
      type: object
      allOf:
        - $ref: '#/components/schemas/subscription.base'
        - type: object
          properties:
            criteria:
              type: object
              properties:
                channel:
                  $ref: '#/components/schemas/message.channel'
              required:
                - channel
          required:
            - criteria
    subscription.message-subscription:
      type: object
      allOf:
        - $ref: '#/components/schemas/subscription.base'
        - type: object
          properties:
            criteria:
              type: object
              properties:
                channel:
                  $ref: '#/components/schemas/message.channel'
                direction:
                  title: Message direction
                  description: |-
                    Indicates whether the message is received from a channel (**IN**), sent to a channel (**OUT**), or both (**ALL**).

                    * **IN**: Received messages.
                    * **OUT**: Sent messages.
                    * **ALL**: Filters messages from both directions.
                  type: string
                  enum:
                    - IN
                    - OUT
                    - ALL
              required:
                - channel
          required:
            - criteria
    subscription.partial-subscription:
      type: object
      properties:
        webhook:
          $ref: '#/components/schemas/subscription.webhook'
        status:
          $ref: '#/components/schemas/subscription.partial-status.status'
    subscription.status:
      title: Status of subscription
      type: string
      enum:
        - ACTIVE
        - DEGRADED
        - INACTIVE
    subscription.support-expert-agent-subscription:
      type: object
      allOf:
        - $ref: '#/components/schemas/subscription.base'
    subscription.webhook:
      type: object
      properties:
        url:
          title: Webhook URL
          description: URL to post events
          type: string
        headers:
          title: Request headers
          type: object
        auth:
          allOf:
            - $ref: '#/components/schemas/subscription.webhook-auth.webhook-auth'
            - type: object
              required:
                - type
                - url
                - oauth
    subscription.partial-status.all:
      oneOf:
        - $ref: '#/components/schemas/subscription.partial-status.message-subscription'
        - $ref: '#/components/schemas/subscription.partial-status.message-status-subscription'
        - $ref: '#/components/schemas/subscription.partial-status.conversation-status-subscription'
        - $ref: '#/components/schemas/subscription.partial-status.conversation-message-subscription'
        - $ref: '#/components/schemas/subscription.partial-status.support-expert-agent-subscription'
        - $ref: '#/components/schemas/subscription.partial-status.contact-subscription'
      discriminator:
        propertyName: eventType
        mapping:
          MESSAGE: '#/components/schemas/subscription.partial-status.message-subscription'
          MESSAGE_STATUS: '#/components/schemas/subscription.partial-status.message-status-subscription'
          CONVERSATION_STATUS: '#/components/schemas/subscription.partial-status.conversation-status-subscription'
          CONVERSATION_MESSAGE: '#/components/schemas/subscription.partial-status.conversation-message-subscription'
          SUPPORT_EXPERT_AGENT: '#/components/schemas/subscription.partial-status.support-expert-agent-subscription'
          CONTACT: '#/components/schemas/subscription.partial-status.contact-subscription'
    subscription.partial-status.base:
      type: object
      properties:
        id:
          title: Subscription Id
          type: string
          readOnly: true
        eventType:
          title: Event type to subscribe
          type: string
          enum:
            - MESSAGE
            - MESSAGE_STATUS
            - CONVERSATION_STATUS
            - CONVERSATION_MESSAGE
            - SUPPORT_EXPERT_AGENT
            - CONTACT
        webhook:
          allOf:
            - $ref: '#/components/schemas/subscription.partial-status.webhook'
            - type: object
              required:
                - url
        status:
          $ref: '#/components/schemas/subscription.partial-status.status'
        version:
          title: Version of subscription
          type: string
          enum:
            - v1
            - v2
          default: v2
          example: v2
        createdAt:
          title: Creation timestamp
          description: Creation timestamp in ISO format
          type: string
          readOnly: true
        updatedAt:
          title: Update timestamp
          description: Update timestamp in ISO format
          type: string
          readOnly: true
      required:
        - eventType
        - webhook
    subscription.partial-status.contact-subscription:
      type: object
      allOf:
        - $ref: '#/components/schemas/subscription.partial-status.base'
        - type: object
          properties:
            criteria:
              type: object
              properties:
                action:
                  title: Contact events to subscribe to
                  description: Configure one or more contact-type events to subscribe to
                  type: array
                  minItems: 1
                  items:
                    type: string
                    enum:
                      - CREATED
                      - DELETED
                      - UPDATED
              required:
                - action
          required:
            - criteria
    subscription.partial-status.conversation-message-subscription:
      type: object
      allOf:
        - $ref: '#/components/schemas/subscription.partial-status.base'
        - type: object
          properties:
            eventType:
              type: string
              enum:
                - CONVERSATION_MESSAGE
            criteria:
              type: object
              properties:
                channel:
                  $ref: '#/components/schemas/message.channel'
                direction:
                  title: Message direction
                  description: 'Indicates whether the message is received from a channel (IN), sent to a channel (OUT) or sent internally (INTERNAL)'
                  type: string
                  enum:
                    - IN
                    - OUT
                    - INTERNAL
              required:
                - channel
                - direction
          required:
            - criteria
    subscription.partial-status.conversation-status-subscription:
      type: object
      allOf:
        - $ref: '#/components/schemas/subscription.partial-status.base'
        - type: object
          properties:
            eventType:
              type: string
              enum:
                - CONVERSATION_STATUS
    subscription.partial-status.message-status-subscription:
      type: object
      allOf:
        - $ref: '#/components/schemas/subscription.partial-status.base'
        - type: object
          properties:
            criteria:
              type: object
              properties:
                channel:
                  $ref: '#/components/schemas/message.channel'
                direction:
                  title: Message direction
                  description: |-
                    Indicates whether the message is received from a channel (**IN**), sent to a channel (**OUT**), or both (**ALL**).

                    * **IN**: Received messages.
                    * **OUT**: Sent messages.
                    * **ALL**: Filters messages from both directions.
                  type: string
                  enum:
                    - IN
                    - OUT
                    - ALL
              required:
                - channel
          required:
            - criteria
    subscription.partial-status.message-subscription:
      type: object
      allOf:
        - $ref: '#/components/schemas/subscription.partial-status.base'
        - type: object
          properties:
            criteria:
              type: object
              properties:
                channel:
                  $ref: '#/components/schemas/message.channel'
                direction:
                  title: Message direction
                  description: |-
                    Indicates whether the message is received from a channel (**IN**), sent to a channel (**OUT**), or both (**ALL**).

                    * **IN**: Received messages.
                    * **OUT**: Sent messages.
                    * **ALL**: Filters messages from both directions.
                  type: string
                  enum:
                    - IN
                    - OUT
                    - ALL
              required:
                - channel
          required:
            - criteria
    subscription.partial-status.status:
      title: Status of subscription
      type: string
      enum:
        - ACTIVE
        - INACTIVE
    subscription.partial-status.support-expert-agent-subscription:
      type: object
      allOf:
        - $ref: '#/components/schemas/subscription.partial-status.base'
    subscription.partial-status.webhook:
      type: object
      properties:
        url:
          title: Webhook URL
          description: URL to post events
          type: string
        headers:
          title: Request headers
          type: object
        auth:
          allOf:
            - $ref: '#/components/schemas/subscription.webhook-auth.webhook-auth'
            - type: object
              required:
                - type
                - url
                - oauth
    subscription.webhook-auth.oauth:
      title: Fields to OAUTH2 authentication request
      properties:
        grantType:
          title: GranType
          type: string
          enum:
            - client_credentials
          default: client_credentials
        clientSecret:
          title: Client Secret
          type: string
          minLength: 1
        clientId:
          title: Client Id
          type: string
          minLength: 1
        refreshToken:
          title: Refresh Token
          type: string
          minLength: 1
        expiresIn:
          title: Default time expiration (in seconds)
          type: number
    subscription.webhook-auth.webhook-auth:
      type: object
      properties:
        type:
          title: Type of authentication
          type: string
          enum:
            - OAUTH
          default: OAUTH
        url:
          title: Webhook Auth URL
          description: URL to authenticate webhook
          type: string
          minLength: 1
          pattern: '^(https)://[^\s/$.?#].[^\s]*$'
        headers:
          title: Authentication request headers
          type: object
          additionalProperties:
            oneOf:
              - type: string
                example: Zenvia
              - type: number
                example: 1
              - type: boolean
                example: true
        queryParams:
          title: Authentication request query params
          type: object
          additionalProperties:
            oneOf:
              - type: string
                example: Zenvia
              - type: number
                example: 1
              - type: boolean
                example: true
        oauth:
          allOf:
            - $ref: '#/components/schemas/subscription.webhook-auth.oauth'
            - type: object
              required:
                - grantType
                - clientSecret
                - clientId
    support-service.ticket-action:
      title: Ticket Actions
      description: Ticket actions information.
      type: object
      properties:
        id:
          title: ID
          description: ID of the ticket action.
          type: integer
          readOnly: true
        type:
          $ref: '#/components/schemas/support-service.context.ticket-type'
        origin:
          $ref: '#/components/schemas/support-service.context.origin-type'
        description:
          title: Description
          type: string
        status:
          $ref: '#/components/schemas/support-service.context.status-action'
        justification:
          $ref: '#/components/schemas/support-service.context.justification'
        createdAt:
          title: Created At
          description: Timestamp of the action creation.
          type: string
          example: '2022-05-23T19:37:59.000Z'
        createdById:
          title: Created By ID
          description: Created by identifier
          type: string
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
          nullable: true
    support-service.ticket-attribute-category:
      title: Ticket category
      description: Ticket category.
      type: object
      properties:
        category:
          $ref: '#/components/schemas/support-service.context.category'
        updatedById:
          title: Updated by identification
          description: User that made the changes.
          type: string
          nullable: true
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
    support-service.ticket-attribute-clients:
      title: Ticket clients
      description: Ticket clients.
      type: object
      properties:
        clients:
          title: Clients
          description: List of client identifiers of the ticket.
          type: array
          nullable: false
          items:
            type: string
          example:
            - a4a4bc53-8396-4190-92e3-7edb6826e3dc
        updatedById:
          title: Updated by identification
          description: User that made the changes.
          type: string
          nullable: true
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
    support-service.ticket-attribute-owner:
      title: Ticket owner
      description: Ticket owner.
      type: object
      properties:
        ownerId:
          title: Owner Id
          description: Owner identification.
          type: string
          example: 5404ed19-2994-4831-bb33-627e27b18ab1
          nullable: false
        updatedById:
          title: Updated by identification
          description: User that made the changes.
          type: string
          nullable: true
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
    support-service.ticket-attribute-service:
      title: Ticket service
      description: Ticket service.
      type: object
      properties:
        service:
          $ref: '#/components/schemas/support-service.context.service'
        updatedById:
          title: Updated by identification
          description: User that made the changes.
          type: string
          nullable: true
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
    support-service.ticket-attribute-solution:
      title: Ticket solution
      description: Ticket solution.
      type: object
      properties:
        solutionAt:
          title: Solution At
          description: 'Ticket resolution due date. If the resolution due date is updated via the API, it will be considered as having been set manually by the agent who added the last ticket action.'
          type: string
          example: '2022-05-23T19:37:59.000Z'
          nullable: true
        updatedById:
          title: Updated by identification
          description: User that made the changes.
          type: string
          nullable: true
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
    support-service.ticket-attribute-status:
      title: Ticket status
      description: Ticket status.
      type: object
      properties:
        status:
          $ref: '#/components/schemas/support-service.context.status'
        justification:
          $ref: '#/components/schemas/support-service.context.justification'
        updatedById:
          title: Updated by identification
          description: User that made the changes.
          type: string
          nullable: true
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
    support-service.ticket-attribute-subject:
      title: Ticket subject
      description: Ticket subject.
      type: object
      properties:
        subject:
          title: Subject
          description: Subject of the ticket.
          type: string
          nullable: false
        updatedById:
          title: Updated by identification
          description: User that made the changes.
          type: string
          nullable: true
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
    support-service.ticket-attribute-type:
      title: Ticket type
      description: Ticket type.
      type: object
      properties:
        type:
          $ref: '#/components/schemas/support-service.context.ticket-type'
        updatedById:
          title: Updated by identification
          description: User that made the changes.
          type: string
          nullable: true
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
    support-service.ticket-attribute-urgency:
      title: Ticket urgency
      description: Ticket urgency.
      type: object
      properties:
        urgency:
          $ref: '#/components/schemas/support-service.context.urgency'
        updatedById:
          title: Updated by identification
          description: User that made the changes.
          type: string
          nullable: true
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
    support-service.ticket-owner-changes:
      title: Ticket Owner Change
      type: object
      properties:
        ownerId:
          title: Owner ID
          description: Agent that was previously assigned to ticket.
          type: string
          readOnly: true
          nullable: true
          example: 5404ed19-2994-4831-bb33-627e27b18ab1
        ownerTeam:
          $ref: '#/components/schemas/support-service.context.owner-team'
        permanencyTimeFullTime:
          title: Permanency Full Time
          description: Duration of the agent’s assignment in calendar hours. Returns the total time in seconds.
          type: number
          readOnly: true
        permanencyTimeWorkingTime:
          title: Permanency Working Time
          description: Duration of the agent’s assignment in business hours. Returns the total time in seconds.
          type: number
          readOnly: true
        updatedById:
          title: Updated by identification
          description: User that re-assigned the ticket.
          type: string
          readOnly: true
          nullable: true
          example: 5404ed19-2994-4831-bb33-627e27b18ab1
        updatedAt:
          description: Timestamp of the update.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
    support-service.ticket-status-changes:
      title: Ticket Status Change
      type: object
      properties:
        status:
          $ref: '#/components/schemas/support-service.context.status'
        justification:
          $ref: '#/components/schemas/support-service.context.justification'
        permanencyTimeFullTime:
          title: Permanency Full Time
          description: Duration of the status in calendar hours. Returns the total time in seconds.
          type: number
          readOnly: true
        permanencyTimeWorkingTime:
          title: Permanency Working Time
          description: Duration of the status in business hours. Returns the total time in seconds.
          type: number
          readOnly: true
        updatedById:
          title: Updated by identification
          description: User that changed the ticket status.
          type: string
          nullable: true
          readOnly: true
        updatedAt:
          description: Timestamp of the update.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
    support-service.ticket-tag:
      title: Ticket Tags
      description: Ticket tags.
      type: object
      properties:
        tag:
          $ref: '#/components/schemas/support-service.context.tag'
        updatedById:
          title: Updated By ID
          description: Updated by identifier
          type: string
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
          nullable: true
    support-service.ticket-tags-delete:
      title: Ticket Tag removed
      description: Ticket tag removed.
      type: object
      properties:
        updatedById:
          title: Updated By ID
          description: Updated by identifier
          type: string
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
          nullable: true
    support-service.ticket:
      title: Tickets
      description: Ticket information.
      type: object
      properties:
        id:
          title: ID
          description: ID of the ticket.
          type: string
          readOnly: true
          nullable: false
        type:
          $ref: '#/components/schemas/support-service.context.ticket-type'
        origin:
          $ref: '#/components/schemas/support-service.context.origin-type'
        originEmailAccount:
          title: Origin Account Email
          description: Support email account that received the email which created the ticket.
          type: string
          readOnly: true
          nullable: true
        subject:
          title: Subject
          description: Subject of the ticket.
          type: string
          nullable: false
        cc:
          title: Cc
          description: List of email addresses in the ticket’s CC.
          type: array
          nullable: false
          items:
            type: string
          example:
            - cc1@zenvia.com
        clients:
          title: Clients
          description: List of client identifiers of the ticket.
          type: array
          nullable: false
          items:
            type: string
          example:
            - a4a4bc53-8396-4190-92e3-7edb6826e3dc
        ownerId:
          title: Owner Id
          description: Owner identification if ticket owner is an agent.
          type: string
          example: 5404ed19-2994-4831-bb33-627e27b18ab1
          nullable: true
        ownerTeam:
          $ref: '#/components/schemas/support-service.context.owner-team'
        category:
          $ref: '#/components/schemas/support-service.context.category'
        urgency:
          $ref: '#/components/schemas/support-service.context.urgency'
        status:
          $ref: '#/components/schemas/support-service.context.status'
        service:
          $ref: '#/components/schemas/support-service.context.service'
        justification:
          $ref: '#/components/schemas/support-service.context.justification'
        resolvedAt:
          title: Resolved At
          description: Resolved ticket timestamp.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          nullable: true
        reopenedAt:
          title: Reopened At
          description: Reopened ticket timestamp.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          nullable: true
        closedAt:
          title: Closed At
          description: Closed ticket timestamp.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          nullable: true
        createdAt:
          title: Created At
          description: Timestamp of the ticket creation.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          nullable: false
        createdById:
          title: Created By Id
          description: Created by identifier.
          type: string
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
          nullable: true
        updatedAt:
          title: Updated At
          description: Timestamp of the ticket update.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
          nullable: true
        solutionTime:
          title: Solution Time
          description: 'SLA resolution time. Returns a numeric value in minutes. If there are no SLA policies applied to this ticket, this property will be blank.'
          type: integer
          readOnly: true
          nullable: true
        responseTime:
          title: Response Time
          description: 'SLA first-response time. Returns a numeric value in minutes. If there are no SLA policies applied to this ticket, this property will be blank.'
          type: integer
          readOnly: true
          nullable: true
        solutionAt:
          title: Solution At
          description: 'Ticket resolution due date. If the resolution due date is updated via the API, it will be considered as having been set manually by the agent who added the last ticket action.'
          type: string
          example: '2022-05-23T19:37:59.000Z'
          nullable: true
        responseAt:
          title: Response At
          description: Ticket first-response due date.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
          nullable: true
        realResponseAt:
          title: Real Response At
          description: Actual first-response date.
          type: string
          example: '2022-05-23T19:37:59.000Z'
          readOnly: true
          nullable: true
        solutionDateIsPaused:
          title: Solution Date Is Paused
          description: 'Returns true if the SLA time for ticket resolution is paused, and false if it is not paused.'
          type: boolean
          readOnly: true
        solutionChangedByUser:
          title: Solution Changed By User
          description: 'Returns true if the current ticket resolution due date was set manually, and false if it was calculated by the system.'
          type: boolean
          readOnly: true
        solutionChangedById:
          title: Solution Changed By User Id
          description: User that manually set the resolution due date on the ticket.
          type: string
          readOnly: true
          nullable: true
          example: 5404ed19-2994-4831-bb33-627e27b18ab1
        agreement:
          title: Agreement
          description: SLA policy applied to the ticket.
          readOnly: true
          nullable: true
          type: object
          properties:
            id:
              title: Agreement Id
              description: Identifier of the SLA policy.
              type: integer
              readOnly: true
            name:
              title: Agreement
              description: Name of the SLA policy.
              type: string
              readOnly: true
            rule:
              title: Agreement Rule
              description: SLA rule applied to the ticket.
              type: string
              readOnly: true
        firstAction:
          $ref: '#/components/schemas/support-service.context.first-action'
    support-service.context.category:
      title: Category
      type: object
      nullable: true
      properties:
        id:
          title: Category ID
          description: Category identifier.
          type: integer
        name:
          title: Category Name
          description: Name of the category.
          type: string
          readOnly: true
    support-service.context.first-action:
      title: First Ticket Action
      type: object
      writeOnly: true
      properties:
        type:
          $ref: '#/components/schemas/support-service.context.ticket-type'
        name:
          title: Category Name
          description: Name of the category.
          type: string
          readOnly: true
        description:
          title: Description
          type: string
        createdAt:
          title: Created At
          description: Timestamp of the action creation.
          type: string
          example: '2022-05-23T19:37:59.000Z'
        createdById:
          title: Created By ID
          description: Created by identifier
          type: string
          example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
          nullable: true
    support-service.context.justification:
      title: Justification
      description: The justification for the ticket status
      type: object
      nullable: true
      properties:
        id:
          title: Justification ID
          description: Justification identifier.
          type: integer
        name:
          title: Justification Name
          description: Name of the justification.
          type: string
          readOnly: true
    support-service.context.origin-type:
      title: Origin
      description: The creation origin
      type: string
      enum:
        - OTHER
        - AGENT_IN_SYSTEM
        - IMPORTED_EMAIL
        - SYSTEM_TRIGGER
        - TICKETS_API
        - CHAT
      readOnly: true
    support-service.context.owner-team:
      title: Owner Team
      description: Owner team if ticket owner is a team.
      type: object
      readOnly: true
      nullable: true
      properties:
        id:
          title: Owner Team Id
          description: Owner Team identifier.
          type: integer
        name:
          title: Owner Team Name
          description: Name of the team.
          type: string
    support-service.context.service:
      title: Service
      type: object
      nullable: true
      properties:
        id:
          title: Service ID
          description: Service identifier.
          type: integer
        name:
          title: Service Name
          description: Name of the service.
          type: string
          readOnly: true
    support-service.context.status-action:
      title: Status
      description: 'The ticket status. If no status is provided, the action defaults to the ticket''s most recent status.'
      type: object
      nullable: true
      properties:
        id:
          title: Status ID
          description: Status identifier.
          type: integer
        name:
          title: Status Name
          description: Name of the status.
          type: string
          readOnly: true
        type:
          $ref: '#/components/schemas/support-service.context.system-status-type'
    support-service.context.status:
      title: Status
      description: The ticket status
      type: object
      properties:
        id:
          title: Status ID
          description: Status identifier.
          type: integer
        name:
          title: Status Name
          description: Name of the status.
          type: string
          readOnly: true
        type:
          $ref: '#/components/schemas/support-service.context.system-status-type'
    support-service.context.system-status-type:
      title: Status Type
      description: System status type.
      type: string
      enum:
        - NEW
        - IN_ATTENDANCE
        - STOPPED
        - CANCELED
        - RESOLVED
        - CLOSED
      readOnly: true
    support-service.context.tag:
      title: Tag
      type: object
      properties:
        id:
          title: Tag ID
          description: Tag identifier.
          type: integer
        name:
          title: Tag Name
          description: Name of the tag.
          type: string
          readOnly: true
    support-service.context.ticket-type:
      title: Ticket Type
      type: string
      nullable: false
      readOnly: false
      enum:
        - INTERNAL
        - PUBLIC
    support-service.context.urgency:
      title: Urgency
      type: object
      nullable: true
      properties:
        id:
          title: Urgency ID
          description: Urgency identifier.
          type: integer
        name:
          title: Urgency Name
          description: Name of the urgency.
          type: string
          readOnly: true
    templates.partial-template:
      title: Template Object
      description: This is a Template object model
      type: object
      properties:
        locale:
          $ref: '#/components/schemas/templates.template-locale'
        category:
          $ref: '#/components/schemas/templates.category.all'
        components:
          $ref: '#/components/schemas/templates.components.index'
        examples:
          $ref: '#/components/schemas/templates.template-example'
        notificationEmail:
          $ref: '#/components/schemas/templates.template-notification-email'
    templates.template-category:
      title: Category
      description: Category of use for this template
      type: string
      enum:
        - ACCOUNT_UPDATE
        - PAYMENT_UPDATE
        - PERSONAL_FINANCE_UPDATE
        - SHIPPING_UPDATE
        - RESERVATION_UPDATE
        - ISSUE_RESOLUTION
        - APPOINTMENT_UPDATE
        - TRANSPORTATION_UPDATE
        - TICKET_UPDATE
        - ALERT_UPDATE
        - AUTO_REPLY
        - AUTHENTICATION
        - MARKETING
        - UTILITY
        - OTHER
    templates.template-comment:
      type: object
      required:
        - author
        - role
        - text
      properties:
        id:
          title: Comment ID
          type: string
          readOnly: true
        author:
          title: Author
          description: Author
          type: string
        role:
          title: Role
          description: Author role
          type: string
          enum:
            - REQUESTER
            - REVIEWER
            - WHATSAPP
        text:
          title: Text
          description: Comment text
          type: string
        createdAt:
          title: Creation timestamp
          description: Creation timestamp in ISO format
          type: string
          readOnly: true
        updatedAt:
          title: Update timestamp
          description: Update timestamp in ISO format
          type: string
          readOnly: true
    templates.template-example:
      title: Examples
      description: |-
        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.
                        <br>In case you are creating a template with media, the key must be <code>imageUrl</code>, <code>documentUrl</code> or <code>videoUrl</code>,
                        being assigned the example URL.
                        <br>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.
      type: object
      example:
        imageUrl: 'https://example.com/image.jpeg'
        name: John Smith
    templates.template-locale:
      title: Locale
      description: Template language and locale
      type: string
      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
    templates.template-metadata:
      type: object
      title: Metadata
      description: Additional values related to the template but not used for messaging.
      additionalProperties:
        description: These values are *not* evaluated as variables in the template.
        oneOf:
          - type: string
            example: Zenvia
          - type: number
            example: 1
          - type: boolean
            example: true
          - type: object
            example: {}
    templates.template-notification-email:
      title: Notification e-mail
      description: E-mail list (comma-separated) to send notifications about the message template approving process
      type: string
    templates.template-quality-score:
      title: Quality Score
      description: '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).'
      type: string
      enum:
        - UNKNOWN
        - GREEN
        - YELLOW
        - RED
    templates.template:
      title: Template Object
      description: This is a Template object model
      type: object
      required:
        - name
        - locale
        - channel
        - senderId
        - category
        - components
      properties:
        id:
          title: Template ID
          type: string
          readOnly: true
        name:
          title: Template name
          description: The name of the template
          type: string
        locale:
          $ref: '#/components/schemas/templates.template-locale'
        channel:
          title: Channel
          description: Channel where the template will be made available.
          type: string
          enum:
            - WHATSAPP
            - SMS
            - RCS
            - EMAIL
            - FACEBOOK
        senderId:
          title: Sender ID
          description: The identifier of the sender of the template. The sender should be created with a credential.
          type: string
        category:
          $ref: '#/components/schemas/templates.template-category'
        qualityScore:
          $ref: '#/components/schemas/templates.template-quality-score'
        components:
          $ref: '#/components/schemas/templates.components.index'
        metadata:
          $ref: '#/components/schemas/templates.template-metadata'
        examples:
          $ref: '#/components/schemas/templates.template-example'
        notificationEmail:
          $ref: '#/components/schemas/templates.template-notification-email'
        text:
          title: Template text
          description: A text reference for the template. This field encompasses all content components.
          type: string
          readOnly: true
        fields:
          title: Fields
          description: The available fields to be used in this template
          type: array
          items:
            type: string
          minItems: 0
          readOnly: true
        comments:
          title: Comments
          description: Comments added to the template during the approval process
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/templates.template-comment'
        status:
          title: Status of template
          type: string
          readOnly: true
          enum:
            - WAITING_REVIEW
            - REJECTED
            - WAITING_APPROVAL
            - APPROVED
            - PAUSED
            - DISABLED
        createdAt:
          title: Creation timestamp
          description: Creation timestamp in ISO format
          type: string
          readOnly: true
        updatedAt:
          title: Update timestamp
          description: Update timestamp in ISO format
          type: string
          readOnly: true
    templates.category.all:
      title: Category
      description: |-
        Category of use for this template.
          <br>Payment templates can only belong to the MARKETING or UTILITY category
      type: string
      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
    templates.category.email:
      title: Category
      description: Category of use for this template
      type: string
      enum:
        - MARKETING
        - OTHER
    templates.category.facebook:
      title: Category
      description: Category of use for this template
      type: string
      enum:
        - ACCOUNT_UPDATE
        - CUSTOMER_FEEDBACK
        - CONFIRMED_EVENT_UPDATE
        - POST_PURCHASE_UPDATE
    templates.category.whatsapp:
      title: Category
      description: |-
        Category of use for this template.
          <br>Payment templates can only belong to the MARKETING or UTILITY category
      type: string
      enum:
        - AUTHENTICATION
        - MARKETING
        - UTILITY
    templates.components.base:
      title: Components
      description: Message content of this template
      type: object
    templates.components.email-components:
      title: Components
      description: Message content of this template
      type: object
      required:
        - body
      properties:
        header:
          $ref: '#/components/schemas/templates.components.header.index'
        body:
          $ref: '#/components/schemas/templates.components.body.index'
        attachments:
          $ref: '#/components/schemas/templates.components.attachments.index'
        email:
          $ref: '#/components/schemas/templates.components.email.index'
    templates.components.facebook:
      title: Components
      description: Message content of this template
      type: object
      required:
        - body
      properties:
        body:
          $ref: '#/components/schemas/templates.components.body.index'
    templates.components.index:
      title: Components
      description: Message content of this template
      type: object
      properties:
        header:
          $ref: '#/components/schemas/templates.components.header.index'
        body:
          $ref: '#/components/schemas/templates.components.body.index'
        footer:
          $ref: '#/components/schemas/templates.components.footer.index'
        buttons:
          $ref: '#/components/schemas/templates.components.buttons.index'
        otp:
          $ref: '#/components/schemas/templates.components.otp.index'
        attachments:
          $ref: '#/components/schemas/templates.components.attachments.index'
        email:
          $ref: '#/components/schemas/templates.components.email.index'
    templates.components.rcs:
      title: Components
      description: Message content of this template
      type: object
      required:
        - body
      properties:
        header:
          $ref: '#/components/schemas/templates.components.header.index'
        body:
          $ref: '#/components/schemas/templates.components.body.index'
        footer:
          $ref: '#/components/schemas/templates.components.footer.index'
        buttons:
          $ref: '#/components/schemas/templates.components.buttons.rcs.all'
    templates.components.sms:
      title: Components
      description: Message content of this template
      type: object
      required:
        - body
      properties:
        body:
          $ref: '#/components/schemas/templates.components.body.index'
    templates.components.whatsapp:
      title: Components
      description: Message content of this template
      type: object
      properties:
        header:
          $ref: '#/components/schemas/templates.components.header.index'
        body:
          $ref: '#/components/schemas/templates.components.body.index'
        footer:
          $ref: '#/components/schemas/templates.components.footer.index'
        buttons:
          $ref: '#/components/schemas/templates.components.buttons.index'
        otp:
          $ref: '#/components/schemas/templates.components.otp.index'
        carousel:
          $ref: '#/components/schemas/templates.components.carousel.index'
    templates.components.attachments.attachment-base:
      properties:
        type:
          title: Type
          description: Attachment type discriminator
          type: string
        cid:
          type: string
          description: |-
            <br>Allows support for inline attachments. The *cid* may be used in the body to show the attachment inline in the e-mail.
                                <br>
                                <br>For example, using `promotion.jpeg` as *cid* is possible to refer it in the body like this:
                                <br>`<img src="cid:promotion.jpeg">`.
          example: promotion.jpeg
    templates.components.attachments.attachment-dynamic:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.attachments.attachment-base'
        - type: object
          properties:
            fieldName:
              type: string
              description: The name of the field from where the URL of the file to be sent will be obtained.
              example: catalogURL
          required:
            - fieldName
      example:
        type: ATTACHMENT_DYNAMIC
        cid: personalized-promo.jpeg
        fieldName: promoURL
    templates.components.attachments.attachment-fixed:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.attachments.attachment-base'
        - $ref: '#/components/schemas/content.bases.file'
      example:
        type: ATTACHMENT_FIXED
        cid: promotion.jpeg
        fileUrl: 'https://zenvia.com/promo.jpg'
        fileMimeType: image/jpeg
        fileName: attachment-name.jpeg
    templates.components.attachments.index:
      title: Attachments
      description: |-
        List of files to be sent along with the content.
                        <br>*Only applicable to [E-Mail](#tag/E-Mail) channel.*
      type: array
      items:
        type: object
        oneOf:
          - $ref: '#/components/schemas/templates.components.attachments.attachment-fixed'
          - $ref: '#/components/schemas/templates.components.attachments.attachment-dynamic'
        discriminator:
          propertyName: type
          mapping:
            ATTACHMENT_FIXED: '#/components/schemas/templates.components.attachments.attachment-fixed'
            ATTACHMENT_DYNAMIC: '#/components/schemas/templates.components.attachments.attachment-dynamic'
        required:
          - type
    templates.components.body.index:
      title: Body
      description: |-
        Template body.
          <br>*Just not required when [WhatsApp](#tag/WhatsApp) channel and AUTHENTICATION category. For all other cases it is required.*
      type: object
      required:
        - type
        - text
      properties:
        type:
          title: Body type
          description: 'The body should have a fixed or variable text.<br>Variable text can have variables using format `{{var_name}}`.'
          type: string
          enum:
            - TEXT_FIXED
            - TEXT_TEMPLATE
        text:
          type: string
          title: Body text
          description: 'Body content. In the [E-Mail](#tag/E-Mail) channel this is handled as a *HTML*, while for most channels this is handled as *markdown*.'
          minLength: 1
    templates.components.buttons.actions:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.base'
        - type: object
          properties:
            items:
              title: Buttons
              description: 'List of buttons. You can have two URL buttons and only one of the following can be included: MPM, PHONE_NUMBER or COPY_CODE. MPM and COPY_CODE buttons are exclusively for use in [WHATSAPP](tag#WHATSAPP).'
              maxItems: 10
              type: array
              items:
                type: object
                oneOf:
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-url'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-phone-number'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-mpm'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-coupon'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-request-contact-info'
                required:
                  - type
                discriminator:
                  propertyName: type
                  mapping:
                    URL: '#/components/schemas/templates.components.buttons.button-item-url'
                    PHONE_NUMBER: '#/components/schemas/templates.components.buttons.button-item-phone-number'
                    MPM: '#/components/schemas/templates.components.buttons.button-item-mpm'
                    COPY_CODE: '#/components/schemas/templates.components.buttons.button-item-coupon'
                    REQUEST_CONTACT_INFO: '#/components/schemas/templates.components.buttons.button-item-request-contact-info'
          required:
            - items
    templates.components.buttons.base:
      type: object
      properties:
        type:
          title: Content type
          type: string
      required:
        - type
    templates.components.buttons.button-item-base:
      type: object
      properties:
        type:
          title: Button type
          enum:
            - URL
            - PHONE_NUMBER
            - QUICK_REPLY
            - OPT_OUT
            - MPM
            - COPY_CODE
            - VIEW_LOCATION
            - SEARCH_LOCATION
            - SHARE_LOCATION
            - CALENDAR_EVENT
            - ORDER_DETAILS
            - REQUEST_CONTACT_INFO
          type: string
      required:
        - type
    templates.components.buttons.button-item-coupon:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
    templates.components.buttons.button-item-mpm:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
    templates.components.buttons.button-item-opt-out:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
        - $ref: '#/components/schemas/templates.components.buttons.button-item-text'
        - type: object
          required:
            - type
            - text
    templates.components.buttons.button-item-order-details:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
    templates.components.buttons.button-item-phone-number:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
        - $ref: '#/components/schemas/templates.components.buttons.button-item-text'
        - type: object
          properties:
            phoneNumber:
              title: Phone number of button
              description: Phone number to be sent in the button
              type: string
          required:
            - type
            - text
            - phoneNumber
    templates.components.buttons.button-item-quick-reply:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
        - $ref: '#/components/schemas/templates.components.buttons.button-item-text'
        - type: object
          properties:
            payload:
              type: string
              title: Payload of button
              description: This payload is used for identify the click in the callback
          required:
            - type
            - text
            - payload
    templates.components.buttons.button-item-request-contact-info:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
        - type: object
          properties:
            type:
              type: string
              enum:
                - REQUEST_CONTACT_INFO
          required:
            - type
    templates.components.buttons.button-item-text:
      type: object
      properties:
        text:
          title: Button text
          type: string
      required:
        - text
    templates.components.buttons.button-item-url:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
        - $ref: '#/components/schemas/templates.components.buttons.button-item-text'
        - type: object
          properties:
            url:
              title: URL of button
              description: URL to be sent in the button. It can be dynamic
              type: string
          required:
            - type
            - text
            - url
    templates.components.buttons.index:
      title: Buttons
      description: |-
        Template buttons.
                        <br>*Only applicable to [WhatsApp](#tag/WhatsApp) and [RCS](#tag/RCS) channels.*
                        <br>*Note: The QUICK_REPLIES collection is mutually exclusive with the use of the REQUEST_CONTACT_INFO button type, which is only supported within the ACTIONS block.*
      type: object
      oneOf:
        - $ref: '#/components/schemas/templates.components.buttons.actions'
        - $ref: '#/components/schemas/templates.components.buttons.quick-replies'
        - $ref: '#/components/schemas/templates.components.buttons.mixed'
      required:
        - type
      discriminator:
        propertyName: type
        mapping:
          ACTIONS: '#/components/schemas/templates.components.buttons.actions'
          QUICK_REPLIES: '#/components/schemas/templates.components.buttons.quick-replies'
          MIXED: '#/components/schemas/templates.components.buttons.mixed'
    templates.components.buttons.mixed:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.base'
        - type: object
          properties:
            items:
              title: Buttons
              description: 'List of buttons. It is allowed to mix the 3 types of buttons, with a limit of up to 10 buttons for the [WhatsApp](#tag/WhatsApp) channel'
              maxItems: 10
              type: array
              items:
                type: object
                oneOf:
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-coupon'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-mpm'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-opt-out'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-phone-number'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-quick-reply'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-url'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-request-contact-info'
                required:
                  - type
                discriminator:
                  propertyName: type
                  mapping:
                    COPY_CODE: '#/components/schemas/templates.components.buttons.button-item-coupon'
                    MPM: '#/components/schemas/templates.components.buttons.button-item-mpm'
                    OPT_OUT: '#/components/schemas/templates.components.buttons.button-item-opt-out'
                    PHONE_NUMBER: '#/components/schemas/templates.components.buttons.button-item-phone-number'
                    QUICK_REPLY: '#/components/schemas/templates.components.buttons.button-item-quick-reply'
                    URL: '#/components/schemas/templates.components.buttons.button-item-url'
                    REQUEST_CONTACT_INFO: '#/components/schemas/templates.components.buttons.button-item-request-contact-info'
          required:
            - items
    templates.components.buttons.order-details:
      type: object
      description: '*Only applicable to [WhatsApp](#tag/WhatsApp) channel*'
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.base'
    templates.components.buttons.quick-replies:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.base'
        - type: object
          properties:
            items:
              title: Buttons
              description: List of buttons
              maxItems: 10
              type: array
              items:
                type: object
                oneOf:
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-quick-reply'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-opt-out'
                required:
                  - type
                discriminator:
                  propertyName: type
                  mapping:
                    QUICK_REPLY: '#/components/schemas/templates.components.buttons.button-item-quick-reply'
                    OPT_OUT: '#/components/schemas/templates.components.buttons.button-item-opt-out'
          required:
            - items
    templates.components.buttons.rcs.actions:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.base'
        - type: object
          properties:
            items:
              title: Buttons
              description: List of buttons.
              maxItems: 4
              type: array
              items:
                type: object
                oneOf:
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-url'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-phone-number'
                  - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-view-location'
                  - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-search-location'
                  - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-share-location'
                  - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-calendar-event'
                required:
                  - type
                discriminator:
                  propertyName: type
                  mapping:
                    URL: '#/components/schemas/templates.components.buttons.button-item-url'
                    PHONE_NUMBER: '#/components/schemas/templates.components.buttons.button-item-phone-number'
                    VIEW_LOCATION: '#/components/schemas/templates.components.buttons.rcs.button-item-view-location'
                    SEARCH_LOCATION: '#/components/schemas/templates.components.buttons.rcs.button-item-search-location'
                    SHARE_LOCATION: '#/components/schemas/templates.components.buttons.rcs.button-item-share-location'
                    CALENDAR_EVENT: '#/components/schemas/templates.components.buttons.rcs.button-item-calendar-event'
          required:
            - items
    templates.components.buttons.rcs.all:
      title: Buttons
      description: |-
        Template buttons.
                        <br>*Only applicable to [WhatsApp](#tag/WhatsApp) and [RCS](#tag/RCS) channels.*
      type: object
      oneOf:
        - $ref: '#/components/schemas/templates.components.buttons.rcs.actions'
        - $ref: '#/components/schemas/templates.components.buttons.rcs.quick-replies'
        - $ref: '#/components/schemas/templates.components.buttons.rcs.mixed'
      required:
        - type
      discriminator:
        propertyName: type
        mapping:
          ACTIONS: '#/components/schemas/templates.components.buttons.rcs.actions'
          QUICK_REPLIES: '#/components/schemas/templates.components.buttons.rcs.quick-replies'
          MIXED: '#/components/schemas/templates.components.buttons.rcs.mixed'
    templates.components.buttons.rcs.button-item-calendar-event:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
        - $ref: '#/components/schemas/templates.components.buttons.button-item-text'
        - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-payload'
        - properties:
            description:
              title: Event description
              description: A description of the calendar event to be sent inside the card.
              type: string
            title:
              title: Event title
              description: A title for the calendar event to be sent inside the card.
              type: string
            startTime:
              title: Event start time
              description: Start date and time of the event. Usage of ISO standard for the date is highly recommended.
              type: string
            endTime:
              title: Event end time
              description: End date and time of the event. Usage of ISO standard for the date is highly recommended.
              type: string
          type: object
          required:
            - type
            - text
            - description
            - title
            - startTime
            - endTime
    templates.components.buttons.rcs.button-item-payload:
      type: object
      properties:
        payload:
          title: Return payload
          description: Content to be sent back on button click.
          type: string
    templates.components.buttons.rcs.button-item-phone-number:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
        - $ref: '#/components/schemas/templates.components.buttons.button-item-text'
        - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-payload'
        - type: object
          properties:
            phoneNumber:
              title: Phone number of button
              description: Phone number to be sent in the button
              type: string
          required:
            - type
            - text
            - phoneNumber
    templates.components.buttons.rcs.button-item-search-location:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
        - $ref: '#/components/schemas/templates.components.buttons.button-item-text'
        - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-payload'
        - type: object
          properties:
            query:
              title: Location query
              description: 'For default map apps, button click results in a location search centered around the user''s current location'
              type: string
          required:
            - type
            - text
            - query
    templates.components.buttons.rcs.button-item-share-location:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
        - $ref: '#/components/schemas/templates.components.buttons.button-item-text'
        - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-payload'
        - type: object
          required:
            - type
            - text
    templates.components.buttons.rcs.button-item-url:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
        - $ref: '#/components/schemas/templates.components.buttons.button-item-text'
        - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-payload'
        - type: object
          properties:
            url:
              title: URL of button
              description: URL to be sent in the button. It can be dynamic
              type: string
          required:
            - type
            - text
            - url
    templates.components.buttons.rcs.button-item-view-location:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.button-item-base'
        - $ref: '#/components/schemas/templates.components.buttons.button-item-text'
        - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-payload'
        - type: object
          properties:
            latitude:
              title: Latitude of coordinates
              description: 'The latitude in degrees. It must be in the range [-90.0, +90.0].'
              minimum: -90
              maximum: 90
              type: number
            longitude:
              title: Longitude of coordinates
              description: 'The longitude in degrees. It must be in the range [-180.0, +180.0].'
              minimum: -180
              maximum: 180
              type: number
            label:
              title: Location label
              description: The label of the pin dropped on the map of the user.
              type: string
          required:
            - type
            - text
            - latitude
            - longitude
    templates.components.buttons.rcs.mixed:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.base'
        - type: object
          properties:
            items:
              title: Buttons
              description: 'List of buttons. Currently it is possible to combine 3 types of buttons, with a limit of up to 11 buttons for the [RCS](#tag/RCS) channel.'
              maxItems: 11
              type: array
              items:
                type: object
                oneOf:
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-url'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-phone-number'
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-quick-reply'
                  - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-view-location'
                  - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-search-location'
                  - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-share-location'
                  - $ref: '#/components/schemas/templates.components.buttons.rcs.button-item-calendar-event'
                required:
                  - type
                discriminator:
                  propertyName: type
                  mapping:
                    URL: '#/components/schemas/templates.components.buttons.button-item-url'
                    PHONE_NUMBER: '#/components/schemas/templates.components.buttons.button-item-phone-number'
                    QUICK_REPLY: '#/components/schemas/templates.components.buttons.button-item-quick-reply'
                    VIEW_LOCATION: '#/components/schemas/templates.components.buttons.rcs.button-item-view-location'
                    SEARCH_LOCATION: '#/components/schemas/templates.components.buttons.rcs.button-item-search-location'
                    SHARE_LOCATION: '#/components/schemas/templates.components.buttons.rcs.button-item-share-location'
                    CALENDAR_EVENT: '#/components/schemas/templates.components.buttons.rcs.button-item-calendar-event'
          required:
            - items
    templates.components.buttons.rcs.quick-replies:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.buttons.base'
        - type: object
          properties:
            items:
              title: Buttons
              description: List of buttons
              maxItems: 3
              type: array
              items:
                type: object
                oneOf:
                  - $ref: '#/components/schemas/templates.components.buttons.button-item-quick-reply'
                required:
                  - type
                discriminator:
                  propertyName: type
                  mapping:
                    QUICK_REPLY: '#/components/schemas/templates.components.buttons.button-item-quick-reply'
          required:
            - items
    templates.components.carousel.index:
      title: Carousel
      description: |-
        A collection of cards horizontally scrollable.
                <br><br>*Only applicable to [WhatsApp](#tag/WhatsApp) channel.*
      type: object
      required:
        - cards
      properties:
        cards:
          title: Cards
          description: 'A boxed media that contains text, buttons and an image.'
          type: array
          minItems: 2
          maxItems: 10
          items:
            type: object
            required:
              - header
              - body
              - buttons
            properties:
              header:
                title: Card header
                description: Where the card image will be placed
                required:
                  - type
                properties:
                  type:
                    title: Type of header for the card
                    type: string
                    enum:
                      - MEDIA_IMAGE
                      - MEDIA_VIDEO
              body:
                title: Card body
                required:
                  - type
                  - text
                description: Where the card text will be inserted
                properties:
                  type:
                    title: Card body type
                    type: string
                    enum:
                      - TEXT_FIXED
                      - TEXT_TEMPLATE
                  text:
                    title: Card body text
                    type: string
              buttons:
                title: Card buttons
                description: 'Buttons that will appear inside the card at the bottom.<br>_For [WhatsApp](#tag/WhatsApp) carousel template, the quantity and types of button items must be the same for each card. Plus, the button category (ACTIONS, MIXED, QUICK_REPLIES) must be the same._'
                type: object
                oneOf:
                  - $ref: '#/components/schemas/templates.components.carousel.buttons.actions'
                  - $ref: '#/components/schemas/templates.components.carousel.buttons.quick-replies'
                  - $ref: '#/components/schemas/templates.components.carousel.buttons.mixed'
                required:
                  - type
                discriminator:
                  propertyName: type
                  mapping:
                    ACTIONS: '#/components/schemas/templates.components.carousel.buttons.actions'
                    QUICK_REPLIES: '#/components/schemas/templates.components.carousel.buttons.quick-replies'
                    MIXED: '#/components/schemas/templates.components.carousel.buttons.mixed'
    templates.components.carousel.buttons.actions:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.carousel.buttons.base'
        - type: object
          properties:
            items:
              title: Buttons
              description: List of buttons. You can have two URL buttons and only one  PHONE_NUMBER button.
              minItems: 1
              maxItems: 2
              type: array
              items:
                type: object
                oneOf:
                  - $ref: '#/components/schemas/templates.components.carousel.buttons.button-item-url'
                  - $ref: '#/components/schemas/templates.components.carousel.buttons.button-item-phone-number'
                required:
                  - type
                discriminator:
                  propertyName: type
                  mapping:
                    URL: '#/components/schemas/templates.components.carousel.buttons.button-item-url'
                    PHONE_NUMBER: '#/components/schemas/templates.components.carousel.buttons.button-item-phone-number'
          required:
            - items
    templates.components.carousel.buttons.base:
      type: object
      properties:
        type:
          title: Content type
          type: string
      required:
        - type
    templates.components.carousel.buttons.button-item-base:
      type: object
      properties:
        type:
          title: Button type
          enum:
            - URL
            - PHONE_NUMBER
            - QUICK_REPLY
            - OPT_OUT
            - MPM
            - COPY_CODE
            - VIEW_LOCATION
            - SEARCH_LOCATION
            - SHARE_LOCATION
            - CALENDAR_EVENT
          type: string
      required:
        - type
    templates.components.carousel.buttons.button-item-phone-number:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.carousel.buttons.button-item-base'
        - $ref: '#/components/schemas/templates.components.carousel.buttons.button-item-text'
        - type: object
          properties:
            phoneNumber:
              title: Phone number of button
              description: Phone number to be sent in the button
              type: string
          required:
            - type
            - text
            - phoneNumber
    templates.components.carousel.buttons.button-item-quick-reply:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.carousel.buttons.button-item-base'
        - $ref: '#/components/schemas/templates.components.carousel.buttons.button-item-text'
        - type: object
          properties:
            payload:
              type: string
              title: Payload of button
              description: This payload is used for identify the click in the callback
          required:
            - type
            - text
            - payload
    templates.components.carousel.buttons.button-item-text:
      type: object
      properties:
        text:
          title: Button text
          type: string
      required:
        - text
    templates.components.carousel.buttons.button-item-url:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.carousel.buttons.button-item-base'
        - $ref: '#/components/schemas/templates.components.carousel.buttons.button-item-text'
        - type: object
          properties:
            url:
              title: URL of button
              description: URL to be sent in the button. It can be dynamic
              type: string
          required:
            - type
            - text
            - url
    templates.components.carousel.buttons.mixed:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.carousel.buttons.base'
        - type: object
          properties:
            items:
              title: Buttons
              description: List of buttons. It is allowed to mix the 3 types of buttons.
              minItems: 1
              maxItems: 2
              type: array
              items:
                type: object
                oneOf:
                  - $ref: '#/components/schemas/templates.components.carousel.buttons.button-item-phone-number'
                  - $ref: '#/components/schemas/templates.components.carousel.buttons.button-item-quick-reply'
                  - $ref: '#/components/schemas/templates.components.carousel.buttons.button-item-url'
                required:
                  - type
                discriminator:
                  propertyName: type
                  mapping:
                    PHONE_NUMBER: '#/components/schemas/templates.components.carousel.buttons.button-item-phone-number'
                    QUICK_REPLY: '#/components/schemas/templates.components.carousel.buttons.button-item-quick-reply'
                    URL: '#/components/schemas/templates.components.carousel.buttons.button-item-url'
          required:
            - items
    templates.components.carousel.buttons.quick-replies:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.carousel.buttons.base'
        - type: object
          properties:
            items:
              title: Buttons
              description: List of buttons
              minItems: 1
              maxItems: 2
              type: array
              items:
                type: object
                oneOf:
                  - $ref: '#/components/schemas/templates.components.carousel.buttons.button-item-quick-reply'
                required:
                  - type
                discriminator:
                  propertyName: type
                  mapping:
                    QUICK_REPLY: '#/components/schemas/templates.components.carousel.buttons.button-item-quick-reply'
          required:
            - items
    templates.components.email.index:
      type: object
      title: Email
      description: |-
        E-mail specific fields.
                        <br>*Only applicable to [E-Mail](#tag/E-Mail) channel.*
      properties:
        replyTo:
          allOf:
            - $ref: '#/components/schemas/content.email.reply-to'
    templates.components.footer.index:
      title: Footer
      description: |-
        Template footer.
                        <br>*Only applicable to [WhatsApp](#tag/WhatsApp) and [RCS](#tag/RCS) channels.*
                        <br>*Note: Footer component is not allowed for templates containing the REQUEST_CONTACT_INFO button.*
      type: object
      required:
        - type
        - text
      properties:
        type:
          title: Footer type
          description: The footer can only be a fixed text
          type: string
          enum:
            - TEXT_FIXED
        text:
          title: Footer text
          type: string
    templates.components.header.index:
      title: Header
      description: |-
        Template header. This will be used as subject in the [E-Mail](#tag/E-Mail) channel.
                        <br>*Only applicable to [WhatsApp](#tag/WhatsApp), [RCS](#tag/RCS) and [E-Mail](#tag/E-Mail) channels.*
                        <br>*Note: Header component is not allowed for templates containing the REQUEST_CONTACT_INFO button.*
      type: object
      required:
        - type
      properties:
        type:
          type: string
          title: Header type
          description: |-
            The header can have an image, document or text.
                                <br>*Only applicable to [WhatsApp](#tag/WhatsApp) and [RCS](#tag/RCS) and [E-Mail](#tag/E-Mail) channels.*
          enum:
            - MEDIA_DOCUMENT
            - MEDIA_IMAGE
            - MEDIA_VIDEO
            - TEXT_FIXED
            - TEXT_TEMPLATE
        text:
          type: string
          title: Header text
          description: 'Body header. This will be used as subject in the [E-Mail](#tag/E-Mail) channel.<br>In other channels it will be a title above the body.'
    templates.components.otp.base:
      type: object
      properties:
        type:
          title: Content type
          description: 'Set to COPY_CODE if you want the template to use a copy code button, or ONE_TAP to use an one-tap autofill button'
          type: string
        copyButtonText:
          description: 'Note that even if your template is using a one-tap autofill button, this value must still be supplied. If we are unable to validate your handshake the authentication template message will display a copy code button with this text instead.'
          type: string
          minLength: 1
          maxLength: 25
        addSecurityRecommendation:
          description: 'Set to true if you want the template to include the text: "For your security, do not share this code". Set to false to exclude the text.'
          type: boolean
        codeExpirationMinutes:
          description: 'Indicates number of minutes the password or code is valid. If omitted, the code expiration warning will not be displayed in the delivered message.'
          type: number
          minimum: 1
          maximum: 90
      required:
        - type
        - copyButtonText
    templates.components.otp.copy-code:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.otp.base'
      example:
        type: COPY_CODE
        copyButtonText: Copy the code
        addSecurityRecommendation: true
        codeExpirationMinutes: 5
    templates.components.otp.index:
      title: OTP
      description: |-
        Template OTP button. A copy code button copies the one-time password or code to the user's clipboard. The user can then manually switch to your app and paste the password or code into your app's interface. A one-tap autofill button automatically loads and passes your app the one-time password or code. Currently, ONE_TAP buttons only work for Android. On IOS systems it will work as a COPY_CODE button.
                        <br>*Only applicable to [WhatsApp](#tag/WhatsApp) channel.*
      type: object
      oneOf:
        - $ref: '#/components/schemas/templates.components.otp.one-tap'
        - $ref: '#/components/schemas/templates.components.otp.copy-code'
      required:
        - type
      discriminator:
        propertyName: type
        mapping:
          ONE_TAP: '#/components/schemas/templates.components.otp.one-tap'
          COPY_CODE: '#/components/schemas/templates.components.otp.copy-code'
    templates.components.otp.one-tap:
      type: object
      allOf:
        - $ref: '#/components/schemas/templates.components.otp.base'
        - type: object
          properties:
            autofillText:
              description: One-tap button text.
              type: string
              minLength: 1
              maxLength: 25
            packageName:
              description: Your Android app's package name.
              type: string
            signatureHash:
              description: Your app signing key hash.
              type: string
          required:
            - type
            - copyButtonText
            - autofillText
            - packageName
            - signatureHash
      example:
        type: ONE_TAP
        copyButtonText: Copy the code
        addSecurityRecommendation: true
        codeExpirationMinutes: 5
        autofillText: autofill
        packageName: com.example.myapplication
        signatureHash: K8a%2FAINcGX7
    templates.create.all:
      oneOf:
        - $ref: '#/components/schemas/templates.create.whatsapp'
        - $ref: '#/components/schemas/templates.create.sms'
        - $ref: '#/components/schemas/templates.create.facebook'
        - $ref: '#/components/schemas/templates.create.rcs'
        - $ref: '#/components/schemas/templates.create.email'
      discriminator:
        propertyName: channel
        mapping:
          WHATSAPP: '#/components/schemas/templates.create.whatsapp'
          SMS: '#/components/schemas/templates.create.sms'
          RCS: '#/components/schemas/templates.create.rcs'
          EMAIL: '#/components/schemas/templates.create.email'
          FACEBOOK: '#/components/schemas/templates.create.facebook'
    templates.create.base:
      title: Template Object
      description: This is a Template object model
      type: object
      required:
        - name
        - locale
        - channel
        - senderId
        - category
        - components
      properties:
        channel:
          title: Channel
          description: Channel where the template will be made available.
          type: string
          enum:
            - WHATSAPP
            - SMS
            - RCS
            - EMAIL
            - FACEBOOK
        id:
          title: Template ID
          type: string
          readOnly: true
        name:
          title: Template name
          description: The name of the template
          type: string
        locale:
          $ref: '#/components/schemas/templates.template-locale'
        examples:
          $ref: '#/components/schemas/templates.template-example'
        senderId:
          title: Sender ID
          description: The identifier of the sender of the template. The sender should be created with a credential.
          type: string
        metadata:
          $ref: '#/components/schemas/templates.template-metadata'
        notificationEmail:
          $ref: '#/components/schemas/templates.template-notification-email'
        text:
          title: Template text
          description: A text reference for the template. This field encompasses all content components.
          type: string
          readOnly: true
        fields:
          title: Fields
          description: The available fields to be used in this template
          type: array
          items:
            type: string
          minItems: 0
          readOnly: true
        comments:
          title: Comments
          description: Comments added to the template during the approval process
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/templates.template-comment'
        status:
          title: Status of template
          type: string
          readOnly: true
          enum:
            - WAITING_REVIEW
            - REJECTED
            - WAITING_APPROVAL
            - APPROVED
            - PAUSED
            - DISABLED
        createdAt:
          title: Creation timestamp
          description: Creation timestamp in ISO format
          type: string
          readOnly: true
        updatedAt:
          title: Update timestamp
          description: Update timestamp in ISO format
          type: string
          readOnly: true
    templates.create.email:
      type: object
      allOf:
        - type: object
          properties:
            components:
              $ref: '#/components/schemas/templates.components.email-components'
            category:
              $ref: '#/components/schemas/templates.category.email'
        - $ref: '#/components/schemas/templates.create.base'
    templates.create.facebook:
      type: object
      allOf:
        - type: object
          properties:
            components:
              $ref: '#/components/schemas/templates.components.facebook'
            category:
              $ref: '#/components/schemas/templates.category.facebook'
        - $ref: '#/components/schemas/templates.create.base'
    templates.create.rcs:
      type: object
      allOf:
        - type: object
          properties:
            components:
              $ref: '#/components/schemas/templates.components.rcs'
            category:
              $ref: '#/components/schemas/templates.category.all'
        - $ref: '#/components/schemas/templates.create.base'
    templates.create.sms:
      type: object
      allOf:
        - type: object
          properties:
            components:
              $ref: '#/components/schemas/templates.components.sms'
            category:
              $ref: '#/components/schemas/templates.category.all'
        - $ref: '#/components/schemas/templates.create.base'
    templates.create.whatsapp:
      type: object
      allOf:
        - type: object
          properties:
            components:
              $ref: '#/components/schemas/templates.components.whatsapp'
            category:
              $ref: '#/components/schemas/templates.category.whatsapp'
            qualityScore:
              title: Quality Score
              description: '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).'
              type: string
              enum:
                - UNKNOWN
                - GREEN
                - YELLOW
                - RED
              readOnly: true
        - $ref: '#/components/schemas/templates.create.base'
  responses:
    error:
      description: 'Error response. See the [Error Handling](#section/Error-Handling) section for details.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error.base'
  parameters:
    automationId:
      name: automationId
      in: path
      required: true
      description: The marketing automation identifier
      schema:
        type: string
    batchId:
      name: batchId
      in: path
      required: true
      description: Batch identifier
      schema:
        type: string
      example: b5agf1-y237-11e8-b127-1230f6c2d98m
    chatbotId:
      name: chatbotId
      in: path
      required: true
      description: the chatbot identifier
      schema:
        type: string
    configurationId:
      name: configurationId
      in: path
      required: true
      description: The configuration identifier
      schema:
        type: string
    flowBatchId:
      name: flowBatchId
      in: path
      required: true
      description: Flow Batch identifier
      schema:
        type: string
      example: b5agf1-y237-11e8-b127-1230f6c2d98m
    flowId:
      name: flowId
      in: query
      required: true
      description: 'The the flow identifier. You can view your <a href="https://app.zenvia.com/flows" target="_blank"> Flow IDs here.</a>'
      schema:
        type: string
      example: b5agf1-y237-11e8-b127-1230f6c2d98m
    limit:
      name: limit
      in: query
      required: false
      description: 'Number of elements on a page. If not filled, the default size is the total number of records'
      schema:
        title: size
        type: number
      example: 10
    page-legacy:
      name: page
      in: query
      required: false
      description: This is the page number.
      schema:
        title: page
        type: number
        default: 0
      example: 5
    page:
      name: page
      in: query
      required: false
      description: This is the page number.
      schema:
        title: page
        type: number
        default: 1
      example: 5
    size:
      name: size
      in: query
      required: false
      description: This is the page size.
      schema:
        title: size
        type: number
        default: 20
      example: 10
    statusGroupsId:
      name: componentId
      in: path
      required: true
      description: The component of the status groups identifier
      schema:
        type: string
    subscriptionId:
      name: subscriptionId
      in: path
      required: true
      description: The subscription identifier
      schema:
        type: string
    templateCommentId:
      name: templateCommentId
      in: path
      required: true
      description: The comment identifier
      schema:
        type: string
    templateId:
      name: templateId
      in: path
      required: true
      description: 'The <a href="https://app.zenvia.com/home/templates">template identifier</a>'
      schema:
        type: string
    tokenId:
      name: tokenId
      in: path
      required: true
      description: The token identifier
      schema:
        type: string
    contacts-management.channelList.id:
      name: channelList.id
      in: query
      description: The contact identifier
      schema:
        type: string
    contacts-management.contactId:
      name: contactId
      in: path
      required: true
      description: The contact identifier
      schema:
        type: string
    contacts-management.email:
      name: channels.email
      in: query
      required: false
      description: The email to filter contact
      schema:
        type: string
    contacts-management.facebook:
      name: channels.facebook
      in: query
      required: false
      description: The Facebook ID to filter contact
      schema:
        type: string
    contacts-management.fieldId:
      name: fieldId
      in: path
      required: true
      description: The data field identifier
      schema:
        type: string
    contacts-management.instagram:
      name: channels.instagram
      in: query
      required: false
      description: The Instagram ID to filter contact
      schema:
        type: string
    contacts-management.landline:
      name: channels.landline
      in: query
      required: false
      description: The landline to filter contact
      schema:
        type: string
    contacts-management.listId:
      name: listId
      in: path
      required: true
      description: The contact list identifier
      schema:
        type: string
    contacts-management.listIds:
      name: listId
      in: query
      required: false
      description: Contact list ids to filter the contacts.
      schema:
        type: array
        items:
          type: string
      example:
        - list-id-01
        - list-id-02
        - list-id-03
    contacts-management.meli:
      name: channels.meli
      in: query
      required: false
      description: The Mercado Livre ID to filter contact
      schema:
        type: string
    contacts-management.mobile:
      name: channels.mobile
      in: query
      required: false
      description: The mobile to filter contact
      schema:
        type: string
    contacts-management.twitter:
      name: channels.twitter
      in: query
      required: false
      description: The Twitter handle to filter contact
      schema:
        type: string
    conversations.contactId:
      name: contactId
      in: query
      required: false
      description: Filter by the linked contact identifier.
      schema:
        type: string
    conversations.conversationId:
      name: conversationId
      in: path
      required: true
      description: The conversation identifier.
      schema:
        type: string
    conversations.groupId:
      name: groupId
      in: query
      required: false
      description: 'Filter by one or more group identifiers (repeat the parameter for multiple values, e.g. groupId=a&groupId=b).'
      schema:
        type: array
        items:
          type: string
    conversations.id:
      name: id
      in: query
      required: false
      description: 'Filter by one or more conversation identifiers (repeat the parameter for multiple values, e.g. id=a&id=b).'
      schema:
        type: array
        items:
          type: string
    conversations.page:
      name: page
      in: query
      required: false
      description: 'The page number to retrieve (1-based). Defaults to 1, max: 1000.'
      schema:
        type: integer
        minimum: 1
        maximum: 1000
    conversations.search:
      name: search
      in: query
      required: false
      description: Free-text search over the conversation and its contact.
      schema:
        type: string
    conversations.size:
      name: size
      in: query
      required: false
      description: 'The maximum number of results per page (default: 10, max: 100).'
      schema:
        type: integer
        minimum: 1
        maximum: 100
    conversations.sort:
      name: sort
      in: query
      required: false
      description: 'The field to sort by, optionally followed by ",asc" or ",desc" (lowercase only, e.g. sort=createdAt,desc). If omitted entirely, defaults to createdAt,desc; if a field is given with no direction, defaults to ascending. Only a single field is supported.'
      schema:
        type: string
    conversations.status:
      name: status
      in: query
      required: false
      description: Filter by conversation status.
      schema:
        type: string
    conversations.userId:
      name: userId
      in: query
      required: false
      description: Filter by the assigned agent identifier.
      schema:
        type: string
    files.endTimestamp:
      name: endTimestamp
      in: query
      required: false
      description: 'Timestamp after which, the files to be returned, were created'
      schema:
        type: string
      example: '2022-02-21T12:30:45Z'
    files.fileId:
      name: fileId
      in: path
      required: true
      description: The file identifier
      schema:
        type: string
    files.limit:
      name: limit
      in: query
      description: The maximum amount of files to be returned.
      schema:
        type: integer
        default: 1000
        maximum: 10000
        minimum: 1
    files.startTimestamp:
      name: startTimestamp
      in: query
      required: false
      description: 'Timestamp after which, the files to be returned, were created'
      schema:
        type: string
      example: '2022-02-21T10:30:25Z'
    groups.groupId:
      name: groupId
      in: path
      required: true
      description: The group identifier.
      schema:
        type: string
    reports.flow.dispatchId:
      name: dispatchId
      in: query
      required: false
      description: The ID generated at the time of the dispatch
      schema:
        title: Dispatch ID
        type: string
    reports.flow.endDate:
      name: endDate
      in: query
      required: false
      description: The end date for query entries
      schema:
        type: string
        format: date
    reports.flow.flowId:
      name: flowId
      in: query
      required: false
      description: 'The the flow identifier. You can view your <a href="https://app.zenvia.com/flows" target="_blank"> Flow IDs here.</a>'
      schema:
        title: Flow ID
        type: string
    reports.flow.sessionId:
      name: sessionId
      in: query
      required: false
      description: 'An ID that represents a flow execution. In case of conversational flows, it identifies the conversation in our platform.'
      schema:
        title: Session ID
        type: string
    reports.flow.startDate:
      name: startDate
      in: query
      required: true
      description: The start date for query entries
      schema:
        type: string
        format: date
    reports.message.channels:
      name: channels
      in: query
      required: false
      description: A comma-separated list of the channels identifier
      schema:
        type: string
    reports.message.endDate:
      name: endDate
      in: query
      required: true
      description: The end date for query entries
      schema:
        type: string
        format: date
    reports.message.startDate:
      name: startDate
      in: query
      required: true
      description: The start date for query entries
      schema:
        type: string
        format: date
    reports.message.type:
      name: type
      in: query
      required: false
      description: The type of the messages
      schema:
        type: string
        enum:
          - message
          - notification
    support-service.createdAt:
      name: createdAt
      in: query
      required: false
      description: The date that the ticket was created.
      schema:
        type: string
        format: date
        example: '2024-01-31'
    support-service.size:
      name: size
      in: query
      required: false
      description: This is the page size.
      schema:
        title: size
        type: number
        default: 20
        maximum: 100
      example: 10
    support-service.statusId:
      name: statusId
      in: query
      required: false
      description: The status id of the ticket.
      schema:
        type: integer
    support-service.tagId:
      name: tagId
      in: path
      required: true
      description: The ticket tag identifier.
      schema:
        type: string
    support-service.teamId:
      name: teamId
      in: path
      required: true
      description: The team identifier.
      schema:
        type: integer
    support-service.ticketId:
      name: ticketId
      in: path
      required: true
      description: The ticket identifier.
      schema:
        type: string
    support-service.updatedAt:
      name: updatedAt
      in: query
      required: false
      description: The date that the ticket was updated.
      schema:
        type: string
        format: date
        example: '2024-01-31'
    support-service.updatedById:
      name: updatedById
      in: query
      required: false
      description: User that made the changes.
      schema:
        type: string
        example: 3525fdd7-34c7-4159-bf7c-b33e4e772c05
    templates.category:
      name: category
      in: query
      required: false
      description: Filter by category
      schema:
        type: string
        enum:
          - ACCOUNT_UPDATE
          - PAYMENT_UPDATE
          - PERSONAL_FINANCE_UPDATE
          - SHIPPING_UPDATE
          - RESERVATION_UPDATE
          - ISSUE_RESOLUTION
          - APPOINTMENT_UPDATE
          - TRANSPORTATION_UPDATE
          - TICKET_UPDATE
          - ALERT_UPDATE
          - AUTO_REPLY
          - AUTHENTICATION
          - MARKETING
          - UTILITY
          - OTHER
          - CUSTOMER_FEEDBACK
          - CONFIRMED_EVENT_UPDATE
          - POST_PURCHASE_UPDATE
      example: UTILITY
    templates.channel:
      name: channel
      in: query
      required: false
      description: Filter by channel
      schema:
        type: string
        enum:
          - WHATSAPP
          - SMS
          - RCS
          - EMAIL
          - FACEBOOK
      example: WHATSAPP
    templates.page:
      name: page
      in: query
      required: false
      description: This is the page number.
      schema:
        title: page
        type: number
        default: 1
      example: 5
    templates.senderId:
      name: senderId
      in: query
      required: false
      description: Filter by senderId
      schema:
        type: string
      example: b5agf1-y237-11e8-b127-1230f6c2d98m
    templates.size:
      name: size
      in: query
      required: false
      description: This is the page size.
      schema:
        title: size
        type: number
        default: 500
      example: 10
    templates.status:
      name: status
      in: query
      description: Filter by status
      required: false
      schema:
        type: string
        enum:
          - WAITING_REVIEW
          - REJECTED
          - WAITING_APPROVAL
          - APPROVED
          - PAUSED
          - DISABLED
      example: APPROVED
  examples: {}
  requestBodies: {}
  headers: {}
  securitySchemes:
    JWT:
      description: User JWT token used for Zenvia front-end service
      type: http
      scheme: bearer
      bearerFormat: JWT
    TOKEN:
      description: Token created on API console for clients using server to server integration
      type: apiKey
      in: header
      name: X-API-TOKEN
  links: {}
  callbacks:
    subscription-event:
      '{$request.body#/webhook/url}':
        post:
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/events.all'
          responses:
            '200':
              description: webhook successfully processed and no retries will be performed
security:
  - JWT: []
  - TOKEN: []
tags:
  - name: Content types
    description: |
      ## 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](#section/Text)                     |<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|
      | [file](#section/File)                     |<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|
      | [replyable_text](#section/Replyable-Text) |<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green"  >&#10004;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|
      | [template](#section/Template)             |<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="green"  >&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|
      | [card](#section/Card)                     |<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|
      | [carousel](#section/Carousel)             |<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|
      | [contacts](#section/Contacts)             |<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|
      | [location](#section/Location)             |<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|
      | [call](#section/Call)                     |<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|
      | [email](#section/E-Mail)                  |<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|
      | [button](#section/WhatsApp-Button)        |<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|
      | [list](#section/WhatsApp-List)            |<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|
      | [product_list](#section/Product-List)     |<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|
      | [product](#section/Product)               |<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|

      _*GBM stands for Google Business Messages_

      ## Text
      This type of content is the most used one and is composed of plain text.

      <SchemaDefinition schemaRef="#/components/schemas/content.text" showReadOnly={false} />

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

      <SchemaDefinition schemaRef="#/components/schemas/content.file" />

      ## Replyable Text
      This is the same as [text](#section/Text) content, but is followed by buttons for quick replying.

      <SchemaDefinition schemaRef="#/components/schemas/content.replyable-text" showReadOnly={false} />

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

      <SchemaDefinition schemaRef="#/components/schemas/content.template" />

      ### Submitting a template content for approval
      You may submit templates for approval using our [template console](https://app.zenvia.com/home/templates) 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:

      <SchemaDefinition schemaRef="#/components/schemas/content.card" />

      ## Carousel
      This type of content displays a horizontally scrollable sequence of [cards](#section/Card), with some differences and limitations.

      More details may be found below.

      <SchemaDefinition schemaRef="#/components/schemas/content.carousel" />

      ## Contacts
      This type of content is used to send contact information to the user.

      <SchemaDefinition schemaRef="#/components/schemas/content.contacts" />

      ## Location
      This type of content is used to send location messages represented as a point on the map to the user.

      <SchemaDefinition schemaRef="#/components/schemas/content.location" />

      ## WhatsApp Button
      <SchemaDefinition schemaRef="#/components/schemas/content.whatsapp.button.index" />

      ## WhatsApp List
      <SchemaDefinition schemaRef="#/components/schemas/content.whatsapp.list" />

      ## Call
      This is the [Voice](#tag/Voice) channel content.

      <SchemaDefinition schemaRef="#/components/schemas/content.call" showReadOnly={false} showWriteOnly={true} />

      ## E-Mail
      This is the [E-Mail](#tag/E-Mail) channel content.

      <SchemaDefinition schemaRef="#/components/schemas/content.email" showReadOnly={false} showWriteOnly={true} />

      ## SMS Text
      This the SMS version of the [text](#section/Text) content. It has additional parameters specific to the SMS integration.

      <SchemaDefinition schemaRef="#/components/schemas/content.sms.text" showReadOnly={false} showWriteOnly={true} />

      ## Product
      Single product message. This is a [WhatsApp](#tag/WhatsApp) channel content.

      <SchemaDefinition schemaRef="#/components/schemas/content.whatsapp.product" showReadOnly={false} showWriteOnly={true} />

      ## Product List
      Product list message. This is a [WhatsApp](#tag/WhatsApp) channel content.

      <SchemaDefinition schemaRef="#/components/schemas/content.whatsapp.product-list" showReadOnly={false} showWriteOnly={true} />

      ## OptIn Request
      This is [Instagram](#tag/Instagram) and [Facebook](#tag/Facebook) recurring message optin request content.

      <SchemaDefinition schemaRef="#/components/schemas/content.optin_request" showReadOnly={false} showWriteOnly={true} />

      ## Product List Order
      This is [Whatsapp](#tag/Whatsapp) Product List Order content. This is supported only in the [webhook content](#section/Webhook-supported-channels).

      <SchemaDefinition schemaRef="#/components/schemas/content.whatsapp.product-list-order" showReadOnly={true} showWriteOnly={true} />

      ## OptIn Response
      This is [Instagram](#tag/Instagram) and [Facebook](#tag/Facebook) recurring message optin response content. This is supported only in the [webhook content](#section/Webhook-supported-channels).

      <SchemaDefinition schemaRef="#/components/schemas/content.optin_response" showReadOnly={true} showWriteOnly={true} />

      ## Flow

      Flow message. This is a [WhatsApp](#tag/WhatsApp) channel content.

      <SchemaDefinition schemaRef="#/components/schemas/content.whatsapp.flow" showReadOnly={true} showWriteOnly={true} />

      ## Flow Response

      Flow message response. This is supported only in the [webhook content](#section/Webhook-supported-channels).

      <SchemaDefinition schemaRef="#/components/schemas/content.whatsapp.flow-response" showReadOnly={true} showWriteOnly{true} />

      ## Request Contact Info
      This content type is used to prompt the user to natively share their contact information within the channel.
      <br>*Only applicable to [WhatsApp](#tag/WhatsApp) channel.*

      <SchemaDefinition schemaRef="#/components/schemas/content.whatsapp.request-contact-info" showReadOnly={false} showWriteOnly={true} />
  - name: SMS
    description: |
      The SMS channel may be used after its activation on [Zenvia platform](https://app.zenvia.com/home/credentials).
      <br/>

      **Get in touch with Zenvia consultants to create your account.**

      Webhooks allow you to receive events in the configured URL. [Learn more here](#tag/Webhooks).

      ## 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.
      <br>Here are *some* examples of characters which are **only** supported by the unicode encoding:
      <br>`çÇáéíóúýÁÉÍÓÚÝàèìòùÀÈÌÒÙãõñäëïöüÿÄËÏÖÜÃÕÑâêîôûÂÊÎÔÛºª°|`

      ### Encoding selection
      By default, our API selects automatically the SMS encoding based on the message content.
      <br>However, it is also possible to enforce an `encoding strategy`. More details can be found in the [SMS Text](#section/SMS-Text) section.

      ### Concatenated SMS
      To overcome the SMS size limitation, cellphone manufacturers developed a feature called `concatenated SMS`.
      <br>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](https://app.zenvia.com/home/credentials).

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

      * Recipient: the SMS account alias connected on [Zenvia platform](https://app.zenvia.com/home/credentials).
      * 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.
  - name: WhatsApp
    description: |
      The WhatsApp channel may be used after its activation on [Zenvia platform](https://app.zenvia.com/home/credentials/whatsapp/list).

      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.](#tag/Webhooks)


      ## 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](#section/Template), 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.

      <br>
      Supported content types and sizes:

      | Media | Content Type | Post-Processing Media Size* |
      |---|---|---|
      | document | Any valid MIME type. | 100&nbsp;MB |
      | image | image/jpeg<br>image/png | 5 MB |
      | sticker | image/webp<br>**Note:** Animated sticker is not supported.  | 100 KB |
      | audio | audio/acc<br>audio/mp4<br>audio/amr<br>audio/mpeg<br>audio/ogg; codecs=opus<br>**Note:** The base audio/ogg type is not supported. | 16 MB |
      | video | video/mp4<br>video/3gpp<br>**Notes:** <ul><li>Only H.264 video codec and AAC audio codec is supported.</li><li>Only videos with a single audio stream are supported.</li></ul> | 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](https://app.zenvia.com/home/credentials/whatsapp/list)

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

      * Recipient: the WhatsApp sender id registered on [Zenvia platform](https://app.zenvia.com/home/credentials/whatsapp/list)
      * 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.
  - name: Facebook
    description: |
      The Facebook channel may be used after you connect a Facebook page on [Zenvia platform](https://app.zenvia.com/home/credentials/facebook/list).


      ## 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](#tag/Webhooks).


      ## 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.
  - name: Instagram
    description: |
      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](#tag/Webhooks).

      * 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<br>image/png<br>image/ico<br>image/bmp<br>image/webp<br>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.
  - name: Google Business Messages
    description: |
      The Google Business Messages channel may be used after its activation on [Zenvia platform](https://app.zenvia.com/home/credentials/google-business-messages/list).

      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](#tag/Webhooks).


      ## 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](https://app.zenvia.com/home/credentials/google-business-messages/list)
      * 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](https://app.zenvia.com/home/credentials/google-business-messages/list)

      The sender goes in the attribute `from` and the receiver goes in the attribute `to` of message object.
  - name: RCS
    description: |
      The RCS channel may be used after its activation on [Zenvia platform](https://app.zenvia.com/home/credentials/rcs/list).

      **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](#tag/Webhooks).

      ## 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](https://zenvia.chat/storage/files/3c7024318b63bcedac0a28412fd426ce73dcdeade2ea632e3c8016031d08066e.bin)


      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](#section/RCS-features).

      ## 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](https://app.zenvia.com/home/credentials/rcs/list)

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

      * Recipient: the agent id configured on [Zenvia platform](https://app.zenvia.com/home/credentials/rcs/list)
      * 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](https://zenvia.chat/storage/files/8c4484d81dda6c21f1a7d59aa492c27da6e059c3334a961133b8f5947c50066c.bin)

      ### 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](https://zenvia.chat/storage/files/2d4019f78db49bb4a0b49439abf6866a179a37f20ba8e4e51d5ba5bfaa78d96e.bin)

      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](https://zenvia.chat/storage/files/7e8f527fcfeb02746a63fcb4f2afbe0aff1327a152cca7544e9ab12427c96b31.bin)

      ### RCS Carousel

      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](https://zenvia.chat/storage/files/e0449c0659c99c6c7ae51e8f3b020b8bab15a035956217a1251ed306508649ea.bin)
  - name: Telegram
    description: |
      The Telegram can be used after its activation on [Zenvia platform](https://app.zenvia.com/home/credentials/telegram/list).

      **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](#tag/Webhooks).

      Supported content types and sizes:

      | Media | Content Type | Size |
      |---|---|---|
      | image | image/* | 5&nbsp;MB |
      | video | video/* | 20&nbsp;MB |
      | audio | audio/* | 20&nbsp;MB |
      | document | Any other valid MIME type. | 20&nbsp;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.
  - name: Voice
    description: |
      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](https://app.zenvia.com/home/credentials).

      **Get in touch with Zenvia consultants to create your account.**

      Webhooks allow you to receive status in the configured URL. [Learn more here.](#tag/Webhooks)


      ## Voice limitations

      Supported content types and sizes:

      | Media | Content Type | Size |
      |---|---|---|
      | audio | audio/mp3<br>audio/wav | 5&nbsp;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](https://app.zenvia.com/home/credentials)

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

      * Recipient: the sender id registered on [Zenvia platform](https://app.zenvia.com/home/credentials)
      * 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.
  - name: E-Mail
    description: |
      The E-mail channel may be used after its activation on [Zenvia platform](https://app.zenvia.com/home/credentials/email/list).
      <br/>

      Webhooks allow you to receive events in the configured URL. [Learn more here](#tag/Webhooks).

      ## 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](https://app.zenvia.com/home/credentials/email/list)

      <br>
      Supported content types and sizes:

      | Media    | Content Type         | E-Mail Size\* |
      | -------- | -------------------- | ------------- |
      | document | Any valid MIME type. | 25&nbsp;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](https://app.zenvia.com/home/credentials/email/list).

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

      - Recipient: the e-mail address connected on [Zenvia platform](https://app.zenvia.com/home/credentials/email/list).
      - 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.
  - name: Flow Batches
    description: |
      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 <a href="https://app.zenvia.com/flows" target="_blank">here</a>.
  - name: Message Batches
    description: |
      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](https://app.zenvia.com/home/credentials).

      The supported channels are SMS, WhatsApp, RCS(Basic) and E-mail.

      | Content Type | SMS | WhatsApp | RCS Basic | E-mail
      |---|:---:|:---:|:---:|:---:|
      | text | &#10004; | &#10005; | &#10004; | &#10005;
      | template | &#10005; | &#10004; | &#10004; | &#10004;


      > 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.
  - name: Two Factor Authentication
    description: |
      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.
  - name: Webhooks
    description: |
      Webhooks allow you to receive events in the configured URL. Note that the types of events below and their respective schemas define the payload of the events that will arrive on the registered webhook URL. They **do not** pertain to the creation and management of the webhooks themselves.

      The available type of events are:
      - [MESSAGE](#section/MESSAGE)
      - [MESSAGE_STATUS](#section/MESSAGE_STATUS)
      - [CONVERSATION_STATUS](#section/CONVERSATION_STATUS)
      - [CONVERSATION_MESSAGE](#section/CONVERSATION_MESSAGE)
      - [SUPPORT_EXPERT_AGENT](#section/SUPPORT_EXPERT_AGENT)
      - [CONTACT](#section/CONTACT)

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

      <SchemaDefinition schemaRef="#/components/schemas/events.message-event" />

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

      <SchemaDefinition schemaRef="#/components/schemas/events.message-status-event" />
      <br>

      ### Code field
      The <code>code</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 <code>causes</code> 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 <code>causes</code> 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.
      <br><br>

      ### Description field
      The <code>description</code> field is directly tied to the <code>code</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**".*

      ## CONVERSATION_STATUS

      The event type CONVERSATION_STATUS refers to the lifecycle progression of a conversation.

      A conversation has a finite lifecycle — it has a beginning, a middle, and an end.

      If you are subscribed to this type of event, your webhook will receive a request with the schema as follows:

      <SchemaDefinition schemaRef="#/components/schemas/events.conversation-status" />
      <br>

      ## CONVERSATION_MESSAGE

      The event type CONVERSATION_MESSAGE refers to individual messages exchanged within a conversation.

      It includes both inbound (MO), outbound (MT), and internal messages, all associated with an existing conversation.

      If you are subscribed to this type of event, your webhook will receive a request with the schema as follows:

      <SchemaDefinition schemaRef="#/components/schemas/events.conversation-message" />
      <br>

      ## SUPPORT_EXPERT_AGENT

      The event type SUPPORT_EXPERT_AGENT allows ZCC users to create subscriptions for events generated exclusively by support agents.

      Allowing a Support Agent to trigger a previously configured webhook when the agent's conditions are met.

      <SchemaDefinition schemaRef="#/components/schemas/events.support-expert-agent" />
      <br>

      ## CONTACT

      The event type CONTACT allows ZCC users to create subscriptions for changes in contacts. If a contact is created, updated or deleted, you may subscribe to the event.

      If you are subscribed to this type of event, your webhook will receive a request with the schema as follows:

      <SchemaDefinition schemaRef="#/components/schemas/events.contact" />


      ## 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.
      <br/><br/>

      ### 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*.
      <br>Event requests for *DEGRADED* webhooks are handled separately from *ACTIVE* webhooks.
      <br>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:
      * 1 request timeout is equivalent to 10 regular request fails.
      * 10 consecutive regular request fails on an *ACTIVE* webhook will result in demotion to *DEGRADED*.
      * 500 consecutive regular 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.
           <br>Therefore, slow responses should never result in demotion to *INACTIVE*.
        * All connection timeouts count as fail and may result in status demotion.
          <br>The connection timeout is *5 seconds*.
        * All response (read) timeouts count as a fail and may result in status demotion.
          <br>The response timeout is *5 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](https://app.zenvia.com/home/api) will automatically
      promote a *DEGRADED* webhook back to *ACTIVE*.

      Both the success and fail counters automatically reset themselves *8 hours* after the first increment.
      <br/><br/>

      ## Webhook Authentication
      Initially, webhooks only support authentication via [OAuth](https://www.oauth.com/), using the [client_credentials](https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/) grant type exclusively. The required fields for authentication must be provided within the auth object, which is nested inside the webhook object. All fields within auth are used to perform the authentication request. <br>
      It's important to ensure the authentication endpoint is always available, as failures or timeouts during this process will be treated the same as failures in the webhook's own requests and may result in equivalent penalties.
      <br/><br/>

      ## 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](#section/Supported-Channels).

      |Content Type                                       |SMS                                |Facebook                           |WhatsApp                           |RCS                                |Voice                              |Telegram                           |GBM*                               |Instagram                          |E-Mail                             |
      |:--------------------------------------------------|:----------------------------------|:----------------------------------|:----------------------------------|:----------------------------------|:----------------------------------|:----------------------------------|:----------------------------------|:----------------------------------|:----------------------------------|
      | [text](#section/Text)                             |<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|
      | [file](#section/File)                             |<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|
      | [contacts](#section/Contacts)                     |<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|
      | [location](#section/Location)                     |<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|
      | [email](#section/E-Mail)                          |<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|
      | [product_list_order](#section/Product-List-Order) |<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|
      | [optin_response](#section/OptIn-Response)         |<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|
      | [flow_response](#section/Flow-Response)          |<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="green">&#10004;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|<font color="red"  >&#10005;</font>|

      _*GBM stands for Google Business Messages_
  - name: Templates
    description: |
      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 <code>body</code> 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 <code>header</code> and <code>footer</code> 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 <code>button</code> 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, send a product catalog, or request contact information.

      *Note: The `REQUEST_CONTACT_INFO` button is mutually exclusive. It cannot be combined with other button types, and templates using it must not contain `Header` or `Footer` components.*

      ### 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 <code>text</code> and <code>payload</code> fields defined in the creation of interactive templates.

      You can learn more about it on the [subscriptions section](#section/MESSAGE).

      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
  - name: Message Report
    description: |
      A report that shows all messages sent and received during a period. It may also be filtered by channel or type.
  - name: Flow Report
    description: |
      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.
  - name: Files
    description: |
      This allows the storage files for later use elsewhere, usually for sending messages.
  - name: Marketing Automations
    description: |
      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 <a href="https://app.zenvia.com/attraction/dispatches" target="_blank">here</a>.
  - name: Status Groups
    description: |
      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.
  - name: Contact Batches
    description: |
      Import batches of contact-related data from platforms and databases external to ZENVIA Customer Cloud. This imported data will help power features like **RFV Calculation** and the **Contact Manager Database**, alongside other features that are used alongside other APIs like:

      - [Product Batches API](#tag/Product-Batches)
      - [Order Batches API](#tag/Order-Batches)
      - [Invoice Batches API](#tag/Invoice-Batches)

      ## Building the CSV File

      To use the Contact Batches API, you need to create a CSV file based on a predefined structure and in compliance with data types and their respective validations. You can read more about this standard below:

      ### CSV File Structure

      The CSV file must follow the structure below:

      - The first line must contain the table header.
      - The columns must be in the predefined order, listed below.
      - Columns must be separated by a semicolon (`;`).

      The predefined order must be:

      - **`externalPlatform`**: ERP identifier
        - **Required**: `false`
        - **Type**: `string`
        - **Enum**: `OMIE`, `BLING`, `TINY`, `MICROVIX`, `WBUY`, `OTHER`, `SENSEDATA`

      - **`externalId`**: Contact's id
        - **Required**: `false`
        - **Type**: `string`
        - **Max**: `255`

      - **`firstName`**: Contact's first name
        - **Required**: `true`
        - **Type**: `string`
        - **Max Size**: `100`
        - **Min Size**: `1`

      - **`lastName`**: Contact's last name
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `100`

      - **`birthdate`**: Contact's birthdate
        - **Required**: `false`
        - **Type**: `date`
        - **Format**: `YYYY-MM-DD` or `""`

      - **`email`**: Contact's email(s)
        - **Required**: `true` if `mobile` is not provided
        - **Type**: `list`
        - **Format**: `[youremail1@domain.com, youremail2@domain.com, ..., youremailn@domain.com]`
        - **Requirements**:
          - Existing domain;
          - Spaces will be replaced by an empty string (→ change to data mapping);
          - Uppercase characters will be replaced by lowercase (→ change to data mapping);
          - Must start with at least one letter or number;
          - No accents allowed;
          - No special characters except for `_`, `.`, `@`, `-`;
          - Must contain `@`;
          - Example Regex: `EMAIL_PATTERN = re.compile(r'([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+')`

      - **`mobile`**: Contact's mobile number(s)
        - **Required**: `true` if `email` is not provided
        - **Type**: `string`
        - **Format**: Phone numbers must be in E164 format.
        - **Requirements**:
          - Country Code - must be a valid country code.
          - Region Code - must be valid in the current country.
          - Must be a valid mobile phone.
          - Must be in E164 format ex: `+528187654321`.
          - Must have the `+` before the phone number.

      - **`landline`**: Contact's landline number(s)
        - **Required**: `false`
        - **Type**: `string`
        - **Format**: Phone numbers must be in E164 format.
        - **Requirements**:
          - Country Code - must be a valid country code.
          - Region Code - must be valid in the current country.
          - Must be a valid landline phone.
          - Must be in E164 format ex: `+525512345677`.
          - Must have the `+` before the phone number.

      - **`country`**: Contact's country
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `100`
        - **Requirements**: Will only be valid if a valid state exists.

      - **`zipcode`**: Contact's zipcode
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `50`
        - **Requirements**: Will only be imported if a valid state exists.

      - **`state`**: Contact's state
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `100`
        - **Requirements**: It is a required value to import the contact's address. If it's invalid or not provided, the address-related values will be discarded.

      - **`city`**: Contact's city
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `100`
        - **Requirements**: Will only be valid if a valid state exists.

      - **`address`**: Contact's address
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `100`
        - **Requirements**: Will only be valid if a valid state exists.

      - **`streetNumber`**: Contact's street number
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `50`
        - **Requirements**: Will only be valid if a valid state exists.

      - **`neighborhood`**: Contact's neighborhood
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `100`
        - **Requirements**: Will only be valid if a valid state exists.

      - **`identityDocument`**: Contact's personal identity document (CPF)
        - **Required**: `false`
        - **Type**: `string`
        - **Format**: CPF, with or without formatting characters (e.g. `529.982.247-25` or `52998224725`)
        - **Requirements**:
          - Must have exactly 11 digits (after removing any non-digit characters).
          - Must not be one of the 11 all-repeated-digit sequences (`00000000000`, `11111111111`, ..., `99999999999`).
          - Must have valid check digits.
        - This column is optional to include at all. Files with only the 15 columns above and files with this column added as the 16th are both accepted.

      ### Custom Fields

      After the fixed columns above (and the optional `identityDocument` column, if included), you can append any number of additional columns to carry your organization's own custom contact fields, as defined in Contact Manager.

      - This API does not create custom fields. You can only use fields that already exist in Contact Manager for your organization. To see which fields are available, use the [Custom Data Fields API](https://zenvia.github.io/zenvia-openapi-spec/v2/#tag/Contact-Custom-Data-Fields/paths/~1contact-custom-data-fields/get).
      - The header (first line) of each custom column must contain the field's **key** or **name**, exactly as registered in Contact Manager.
      - Custom columns must come strictly after the fixed columns (and `identityDocument`, if present). A custom column placed among the fixed columns will cause the whole file to be rejected.
      - Any custom column whose header does not match an existing field will cause the whole file to be rejected.
      - Field type limits, enforced by Contact Manager:
        - **Numeric fields**: integers only, up to 10 digits.
        - **Date fields**: format `YYYY-MM-DD` only.
        - **String fields**: up to 100 characters.
      - If a value does not match its field's type in Contact Manager, the contact is still created, but that specific field is left blank. The reason is reported in the row's `errorMessages` in the feedback file.

      #### CSV Lifecycle

      All CSV files stored in our infrastructure (imported CSVs and feedback CSVs) have and expiration date of 10 days.

      This 10 days will start couting by the day of it's creation.

      #### The Feedback CSV

      After your contact batch is processed, a CSV file will be generated containing feedback on the processing of the batch data.

      You can access and read this file. Simply retrieve its URL through one of the available GET routes in our API; the URL will be in the feedbackUrl property.

      This feedback file is the same as the file you sent to us, but with a few changes:

      Three new fields are created in it:

      - `status`: Indicates whether that row was processed correctly or not. It can have the values `SUCCESS` or `FAILED`.
      - `id`: If the row was processed correctly, it will return the ID of the import created in the Contact Manager.
      - `errorMessages`: Will display the errors that prevented the row in question from being validated.

      The fields will be updated as follows:

      - Any value that does not adhere to the field's validation rules will be transformed into a `''` value in the feedback file, regardless of whether it is a mandatory field or not.
      - If a value in a mandatory field does not adhere to the validation rules, the error message must be included in the `errorMessages` field, and the status will be `FAILED`.

      ### Batch lifecycle

      The contact batch will have the following lifecycle:

      1. The batch is imported and saved on our database
      2. The batch is processed in our infrastructure
      3. After this, the batch can have one of these two statuses:

      `SUCCESS` - The processment of the batch was successful. The data was send to the Contact Manager Database.

      `FAILED` - The processment of the batch was unsuccessful. The data was not send to the Contact Manager Database.

      On both cenarios, a feedback will be saved. You can check him using the GET requests to check it's URL.
  - name: Product Batches
    description: |
      Import batches of product-related data from platforms and databases external to ZENVIA Customer Cloud. This imported data will help power features like **RFV Calculation** and the **Product Catalog Database**, alongside other features that are used alongside other APIs like:

      - [Contact Batches API](#tag/Contact-Batches)
      - [Order Batches API](#tag/Order-Batches)
      - [Invoice Batches API](#tag/Invoice-Batches)

      ## Building the CSV File

      To use the Product Batches API, you need to create a CSV file based on a predefined structure and in compliance with data types and their respective validations. You can read more about this standard below:

      ### CSV File Structure

      The CSV file must follow the structure below:

      - The first line must contain the table header.
      - The columns must be in the predefined order, listed below.
      - Columns must be separated by a semicolon (`;`).

      The predefined order must be:

      - **`externalPlatform`**: ERP identifier
        - **Required**: `true`
        - **Type**: `string`
        - **Enum**: `OMIE`, `BLING`, `TINY`, `MICROVIX`, `WBUY`, `OTHER`, `SENSEDATA`

      - **`externalId`**: Product ID on external platform
        - **Required**: `true`
        - **Type**: `string`
        - **Max Size**: `255`

      - **`name`**: Product name
        - **Required**: `true`
        - **Type**: `string`
        - **Min Size**: `1`
        - **Max Size**: `500`

      - **`sku`**: SKU (Stock Keeping Unit) on product
        - **Required**: `true`
        - **Type**: `string`
        - **Min Size**: `1`
        - **Max Size**: `255`

      - **`ean`**: EAN (European Article Number) on product
        - **Required**: `false`
        - **Type**: `string`
        - **Min Size**: `1`
        - **Max Size**: `500`

      - **`brand`**: Product brand
        - **Required**: `true`
        - **Type**: `string`
        - **Min Size**: `1`
        - **Max Size**: `500`

      - **`description`**: Detailed Product Description
        - **Required**: `true`
        - **Type**: `string`
        - **Min Size**: `1`
        - **Max Size**: `500`

      - **`measurementUnit`**: Product unit of measurement
        - **Required**: `true`
        - **Type**: `string`
        - Only accept the following formats: [Tabela Unidades_de_Medida_Comercial](https://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=Q6Iyvm6qKsc=)
        - Accepts uppercase and lowercase

      - **`priceUnit`**: Unit price of the product
        - **Required**: `true`
        - **Type**: `string` || `number`
        - **Max Size**: `16` characters
        - **Format**:
          - Must only accept positive numbers;
          - Numbers should not have a thousand separator;
          - Must accept integers and decimals with `,` as a separator;
          - Must not accept `.` as a decimal separator;
          - Must accept up to 13 integer digits and a maximum of two decimal places;
          - **Example of valid formats**: `15236,15` | `458`
        - **Precision**: `13,2` in case of number.

      - **`currency`**: Currency
        - **Required**: `true`
        - **Type**: `string`
        - Only accept standard [ISO Code](https://www.iban.com/currency-codes) values (accept uppercase and lowercase characters and transform them into uppercase)

      - **`ncm`**: NCM (Mercosur Common Nomenclature)
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `255`

      #### CSV Lifecycle

      All CSV files stored in our infrastructure (imported CSVs and feedback CSVs) have and expiration date of 10 days.

      This 10 days will start couting by the day of it's creation.

      #### The Feedback CSV

      After your contact batch is processed, a CSV file will be generated containing feedback on the processing of the batch data.

      You can access and read this file. Simply retrieve its URL through one of the available GET routes in our API; the URL will be in the feedbackUrl property.

      This feedback file is the same as the file you sent to us, but with a few changes:

      Three new fields are created in it:

      - `status`: Indicates whether that row was processed correctly or not. It can have the values `SUCCESS` or `FAILED`.
      - `id`: If the row was processed correctly, it will return the ID of the import created in the Contact Manager.
      - `errorMessages`: Will display the errors that prevented the row in question from being validated.

      The fields will be updated as follows:

      - Any value that does not adhere to the field's validation rules will be transformed into a `''` value in the feedback file, regardless of whether it is a mandatory field or not.
      - If a value in a mandatory field does not adhere to the validation rules, the error message must be included in the `errorMessages` field, and the status will be `FAILED`.

      ### Batch lifecycle

      The contact batch will have the following lifecycle:

      1. The batch is imported and saved on our database
      2. The batch is processed in our infrastructure
      3. After this, the batch can have one of these two statuses:

      `SUCCESS` - The processment of the batch was successful. The data was send to the Contact Manager Database.

      `FAILED` - The processment of the batch was unsuccessful. The data was not send to the Contact Manager Database.

      On both cenarios, a feedback will be saved. You can check him using the GET requests to check it's URL.
  - name: Order Batches
    description: |
      Import batches of order-related data from platforms and databases external to ZENVIA Customer Cloud. This imported data will help power features like **RFV Calculation**, alongside other features that are used alongside other APIs like:

      - [Product Batches API](#tag/Product-Batches)
      - [Order Batches API](#tag/Order-Batches)
      - [Invoice Batches API](#tag/Invoice-Batches)

      ## Building the CSV File

      To use the Order Batches API, you need to create a CSV file based on a predefined structure and in compliance with data types and their respective validations. You can read more about this standard below:

      ### CSV File Structure

      The CSV file must follow the structure below:

      - The first line must contain the table header.
      - The columns must be in the predefined order, listed below.
      - Columns must be separated by a semicolon (`;`).

      The predefined order must be:

      - **`externalPlatform`**: ERP identifier
        - **Required**: `true`
        - **Type**: `string`
        - **Enum**: `OMIE`, `BLING`, `TINY`, `MICROVIX`, `WBUY`, `OTHER`, `SENSEDATA`

      - **`externalId`**: Order ID on external platform
        - **Required**: `true`
        - **Type**: `string`
        - **Max Size**: `255`

      - **`invoiceExternalId`**: External ID of the invoice
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `500`

      - **`customerExternalId`**: Customer ID on external platform
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `255`

      - **`orderNumber`**: Order number
        - **Required**: `true`
        - **Type**: `string`
        = **Min Size**: `1`
        - **Max Size**: `255`

      - **`orderTimestamp`**: Order creation timestamp
        - **Required**: `true`
        - **Type**: `string`
        - **Format**: `YYYY-MM-DD HH:MM:SS`

      - **`totalAmount`**: Total amount of the order
        - **Required**: `true`
        - **Type**: `string` || `number`
        - **Max Size**: `16` characters
        - **Format**:
          - Must only accept positive numbers;
          - Numbers should not have a thousand separator;
          - Must accept integers and decimals with `,` as a separator;
          - Must not accept `.` as a decimal separator;
          - Must accept up to 13 integer digits and a maximum of two decimal places;
          - **Example of valid formats**: `15236,15` | `458`
        - **Precision**: `13,2` in case of number.

      - **`legalCode`**: Legal code (e.g., CNPJ, CPF)
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `500`

      - **`legalName`**: Legal name of the customer
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `500`

      - **`primaryPhone`** - Customer's main phone number
        - **Required**: `false`
        - **Type**: `string`
        - **Format**: Phone numbers must be in E164 format.
        - **Requirements**:
          - Country Code - must be a valid country code.
          - Region Code - must be valid in the current country.
          - Must be a valid phone number.
          - Must be in E164 format ex: `+528187654321`.
          - Must have the `+` before the phone number.

      - **`email`**: Contact's email(s)
        - **Required**: `true` if `mobile` is not provided
        - **Type**: `list`
        - **Format**: `[youremail1@domain.com, youremail2@domain.com, ..., youremailn@domain.com]`
        - **Requirements**:
          - Existing domain;
          - Spaces will be replaced by an empty string (→ change to data mapping);
          - Uppercase characters will be replaced by lowercase (→ change to data mapping);
          - Must start with at least one letter or number;
          - No accents allowed;
          - No special characters except for `_`, `.`, `@`, `-`;
          - Must contain `@`;
          - Example Regex: `EMAIL_PATTERN = re.compile(r'([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+')`

      - **`orderStatus`**: Order status
        - **Required**: `true`
        - **Type**: `string`
        - **Enum**: `WAITING_PAYMENT`,
        `PAYMENT_ANALYSIS`,
        `PAYMENT_CONFIRMED`,
        `ORDER_EXPEDITING`,
        `ORDER_SHIPPED`,
        `ORDER_CANCELED`,
        `ORDER_FINISHED`,
        `PAYMENT_DENIED`,
        `ORDER_AVAILABLE`,
        `ORDER_RETURNED`,
        `ORDER_REVIEW`,
        `INVOICE_ISSUED`,
        `ORDER_PREPARING`,
        `RECEIPT_ISSUED`,
        `ON_ROUTE`,
        `PICKUP_AVAILABLE`,
        `DELIVERED`

      - **`items`**: Order items
        - **Item**:
          - The item is included within the order.
          - **Multiple items per order**: Item fields can contain multiple values separated by commas to represent various products in a single order.
          - **`productExternalId`**: Product ID on external platform
            - **Required**: `false`
            - **Type**: `string`
            - **Max Size**: `500`
          - **`sku`**: SKU (Stock Keeping Unit)
            - **Required**: `false`
            - **Type**: `string`
            - **Max Size**: `255`
          - **`ean`**: EAN (European Article Number)
            - **Required**: `false`
            - **Type**: `string`
            - **Max Size**: `500`
          - **`name`**: Product name
            - **Required**: `true`
            - **Type**: `string`
            - **Min Size**: `1`
            - **Max Size**: `500`
          - **`quantity`**: Item quantity
            - **Required**: `true`
            - **Type**: `string` || `number`
            - **Max Size**: `16` characters
            - **Format**:
              - Must only accept positive numbers;
              - Numbers should not have a thousand separator;
              - Must accept integers and decimals with `,` as a separator;
              - Must not accept `.` as a decimal separator;
              - Must accept up to 13 integer digits and a maximum of two decimal places;
              - **Example of valid formats**: `15236,15` | `458`
            - **Precision**: `13,2` in case of number.
          - **`measurementUnit`**: Item unit of measurement
            - **Required**: `true`
            - **Type**: `string`
            - Only accept the following formats: [Tabela Unidades_de_Medida_Comercial](https://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=Q6Iyvm6qKsc=)
            - Accepts uppercase and lowercase
          - `priceUnit` - Unit price
            - **Required**: `true`
            - **Type**: `string or number`
              - Maintain decimal precision, do not round
            - **Max Size**: `16` characters
            - **Format**:
              - Must only accept positive numbers;
              - Numbers should not have a thousand separator;
              - Must accept integers and decimals with `,` as a separator;
              - Must not accept `.` as a decimal separator;
              - Must accept up to 13 integer digits and a maximum of two decimal places;
              - **Example of valid formats**: `15236,15` | `458`
            - **Precision**: `13,2` in case of number.
          - **`currency`**: Currency
            - **Required**: `true`
            - **Type**: `string`
            - Only accept standard [ISO Code](https://www.iban.com/currency-codes) values (accept uppercase and lowercase characters and transform them into uppercase)

      #### Working with multiple items

      To include multiple products in a single order, use the comma-separated list format in each item-related field. For example:

      - `productExternalId`: `PROD001, PROD002, PROD003`
      - `name`: `Product A, Product B, Product C`
      - `quantity`: `2, 1, 5`

      If it's a numeric field, you must make sure that there is space between the numbers, for example: `2, 1`. This happens because for numeric fields the separator is the space, not the usual comma.

      The API will process these values as an ordered list, where the first value of each field corresponds to the first item, the second value to the second item, and so on.

      #### CSV Lifecycle

      All CSV files stored in our infrastructure (imported CSVs and feedback CSVs) have and expiration date of 10 days.

      This 10 days will start couting by the day of it's creation.

      #### The Feedback CSV

      After your contact batch is processed, a CSV file will be generated containing feedback on the processing of the batch data.

      You can access and read this file. Simply retrieve its URL through one of the available GET routes in our API; the URL will be in the feedbackUrl property.

      This feedback file is the same as the file you sent to us, but with a few changes:

      Three new fields are created in it:

      - `status`: Indicates whether that row was processed correctly or not. It can have the values `SUCCESS` or `FAILED`.
      - `id`: If the row was processed correctly, it will return the ID of the import created in the Contact Manager.
      - `errorMessages`: Will display the errors that prevented the row in question from being validated.

      The fields will be updated as follows:

      - Any value that does not adhere to the field's validation rules will be transformed into a `''` value in the feedback file, regardless of whether it is a mandatory field or not.
      - If a value in a mandatory field does not adhere to the validation rules, the error message must be included in the `errorMessages` field, and the status will be `FAILED`.

      ### Batch lifecycle

      The contact batch will have the following lifecycle:

      1. The batch is imported and saved on our database
      2. The batch is processed in our infrastructure
      3. After this, the batch can have one of these two statuses:

      `SUCCESS` - The processment of the batch was successful. The data was send to the Contact Manager Database.

      `FAILED` - The processment of the batch was unsuccessful. The data was not send to the Contact Manager Database.

      On both cenarios, a feedback will be saved. You can check him using the GET requests to check it's URL.
  - name: Invoice Batches
    description: |
      Import batches of invoice-related data from platforms and databases external to ZENVIA Customer Cloud. This imported data will help power features like **RFV Calculation**, alongside other features that are used alongside other APIs like:

      - [Contact Batches API](#tag/Contact-Batches)
      - [Product Batches API](#tag/Product-Batches)
      - [Order Batches API](#tag/Order-Batches)

      ## Building the CSV File

      To use the Invoice Batches API, you need to create a CSV file based on a predefined structure and in compliance with data types and their respective validations. You can read more about this standard below:

      ### CSV File Structure

      The CSV file must follow the structure below:

      - The first line must contain the table header.
      - The columns must be in the predefined order, listed below.
      - Columns must be separated by a semicolon (`;`).

      The predefined order must be:

      - `externalPlatform` - Source ERP identification
      - **Required**: `true`
        - **Type**: `string (uppercase and lowercase)`
        - **Enum**: `OMIE`, `BLING`, `TINY`, `MICROVIX`, `WBUY`, `OTHER`, `SENSEDATA`
      - `externalId` - Internal code from the source system
        - **Required**: `true`
        - **Type**: `string`
        - **Max Size**: `255`
        - **Min Size**: `1`
      - `customerExternalId` - Internal contact code in the source system
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `500`
      - `issueTimestamp` - Date and time of the fiscal note issuance
        - **Required**: `true`
        - **Type**: `string`
        - **Format**: `YYYY-MM-DD HH:MM:SS`
      - `invoiceKey` - Fiscal note key
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `500`
      - `invoiceNumber` - Fiscal note number
        - **Required**: `true`
        - **Type**: `string`
        - **Max Size**: `500`
        - **Min Size**: `1`
      - `invoiceSerie` - Fiscal note series
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `500`
      - `orderNumber` - Related order number
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `255`
      - `orderExternalId` - Unique order ID
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `500`
      - `legalCode` - Issuing company's legal code
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `500`
      - `legalName` - Issuing company's legal name
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `500`
      - `primaryPhone` - Customer's main phone number
        - **Required**: `false`
        - **Type**: `string`
        - **Format**: Phone numbers must be in E164 format.
        - **Requirements**:
          - Country Code - must be a valid country code.
          - Region Code - must be valid in the current country.
          - Must be a valid phone number.
          - Must be in E164 format ex: `+528187654321`.
          - Must have the `+` before the phone number.
      - **`email`**: Customer's email
        - **Required**: `false`
        - **Type**: `string`
        - **Max Size**: `255`
        - **Format**:
          - Must contain `@`;
          - No special characters except for `_`, `.`, `@`, `-`;
          - Example: `isaac.hermel@zenvia.com`
      - `totalAmount` - Total value of the fiscal note
        - **Required**: `true`
        - **Type**: `string or number`
          - Maintain decimal precision, do not round
          - **Max Size**: `16` characters
          - **Format**:
            - Must only accept positive numbers;
            - Numbers should not have a thousand separator;
            - Must accept integers and decimals with `,` as a separator;
            - Must not accept `.` as a decimal separator;
            - Must accept up to 13 integer digits and a maximum of two decimal places;
          - **Example of valid formats**: `15236,15` | `458`
        - **Precision**: `13,2` in case of number.

      - `items`: Invoice items
        - **Item**:
          - The item is included within the invoice.
          - **Multiple items per invoice**: Item fields can contain multiple values separated by commas to represent various products in a single invoice.
          - `productExternalId` - Product's source code
            - **Required**: `false`
            - **Type**: `string`
            - **Max Size**: `500`
          - `sku` - Product's SKU
            - **Required**: `false`
            - **Type**: `string`
            - **Max Size**: `255`
          - `ean` - Product's EAN code
            - **Required**: `false`
            - **Type**: `string`
            - **Max Size**: `500`
          - `name` - Product's name/description
            - **Required**: `true`
            - **Type**: `string`
            - **Max Size**: `500`
            - **Min Size**: `1`
          - `quantity` - Item quantity
            - **Required**: `true`
            - **Type**: `string or number`
            - **Max Size**: `16` characters
            - **Format**:
              - Must only accept positive numbers;
              - Numbers should not have a thousand separator;
              - Must accept integers and decimals with `,` as a separator;
              - Must not accept `.` as a decimal separator;
              - Must accept up to 13 integer digits and a maximum of two decimal places;
              - **Example of valid formats**: `15236,15` | `458`
          - **`measurementUnit`**: Item unit of measurement
            - **Required**: `true`
            - **Type**: `string`
            - Only accept the following formats: [Tabela Unidades_de_Medida_Comercial](https://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=Q6Iyvm6qKsc=)
            - Accepts uppercase and lowercase
          - `priceUnit` - Unit price
            - **Required**: `true`
            - **Type**: `string or number`
              - Maintain decimal precision, do not round
            - **Max Size**: `16` characters
            - **Format**:
              - Must only accept positive numbers;
              - Numbers should not have a thousand separator;
              - Must accept integers and decimals with `,` as a separator;
              - Must not accept `.` as a decimal separator;
              - Must accept up to 13 integer digits and a maximum of two decimal places;
              - **Example of valid formats**: `15236,15` | `458`
            - **Precision**: `13,2` in case of number.
          - `totalValue` - Total value of the item
            - **Required**: `false`
            - **Type**: `string | string[] / number | number[]`
            - **Max Size**: `16` characters
            - **Format**:
              - Must only accept positive numbers;
              - Numbers should not have a thousand separator;
              - Must accept integers and decimals with `,` as a separator;
              - Must not accept `.` as a decimal separator;
              - Must accept up to 13 integer digits and a maximum of two decimal places;
              - **Example of valid formats**: `15236,15` | `458`
            - **Precision**: `13,2` in case of number.
          - `fiscalOperationCode` - Fiscal operation code
            - **Required**: `false`
            - **Type**: `string`
            - **Max Size**: `500`
          - `ncm` - Product's NCM code
            - **Required**: `false`
            - **Type**: `string`
            - **Max Size**: `255`
          - `currency` - Currency
            - **Required**: `true`
            - **Type**: `string`
            - Only accept standard [ISO Code](https://www.iban.com/currency-codes) values (accept uppercase and lowercase characters and transform them into uppercase)

      #### Working with multiple items

      To include multiple products in a single invoice, use the comma-separated list format in each item-related field. For example:

      - `productExternalId`: `PROD001, PROD002, PROD003`
      - `name`: `Product A, Product B, Product C`
      - `quantity`: `2, 1, 5`

      If it's a numeric field, you must make sure that there is space between the numbers, for example: `2, 1`. This happens because for numeric fields the separator is the space, not the usual comma.

      The API will process these values as an ordered list, where the first value of each field corresponds to the first item, the second value to the second item, and so on.

      #### CSV Lifecycle

      All CSV files stored in our infrastructure (imported CSVs and feedback CSVs) have and expiration date of 10 days.

      This 10 days will start couting by the day of it's creation.

      #### The Feedback CSV

      After your contact batch is processed, a CSV file will be generated containing feedback on the processing of the batch data.

      You can access and read this file. Simply retrieve its URL through one of the available GET routes in our API; the URL will be in the feedbackUrl property.

      This feedback file is the same as the file you sent to us, but with a few changes:

      Three new fields are created in it:

      - `status`: Indicates whether that row was processed correctly or not. It can have the values `SUCCESS` or `FAILED`.
      - `id`: If the row was processed correctly, it will return the ID of the import created in the Contact Manager.
      - `errorMessages`: Will display the errors that prevented the row in question from being validated.

      The fields will be updated as follows:

      - Any value that does not adhere to the field's validation rules will be transformed into a `''` value in the feedback file, regardless of whether it is a mandatory field or not.
      - If a value in a mandatory field does not adhere to the validation rules, the error message must be included in the `errorMessages` field, and the status will be `FAILED`.

      ### Batch lifecycle

      The contact batch will have the following lifecycle:

      1. The batch is imported and saved on our database
      2. The batch is processed in our infrastructure
      3. After this, the batch can have one of these two statuses:

      `SUCCESS` - The processment of the batch was successful. The data was send to the Contact Manager Database.

      `FAILED` - The processment of the batch was unsuccessful. The data was not send to the Contact Manager Database.

      On both cenarios, a feedback will be saved. You can check him using the GET requests to check it's URL.
  - name: Conversations
    description: |
      Conversations lets external integrators manage NCA (Novo Conceito de Atendimento) sales conversations programmatically: creating conversations, listing them, sending outbound messages and internal notes, archiving and transferring them to another user or group.

      This surface is exclusively for organizations running on NCA. Legado/ZCC accounts continue to be served by the Sales API (`sales.zenvia.com`).

      ## Notes vs. messages

      A note is not a distinct entity — it is a message sent with `direction: INTERNAL`, never delivered to the contact. Use `POST /conversations/{conversationId}/notes` as the ergonomic route for it; it is translated internally to the same message contract used by `POST /conversations/{conversationId}/messages`.

      ## Sessions

      Sending a message on a conversation without an active messaging session with the contact fails with a `SESSION_REQUIRED` error. The API does not silently reopen a session.

      ## Actor authorization

      Actions that depend on state or permission (sending a message, archiving, transferring) validate that the acting agent has access to the conversation (group membership or assignment). A caller without access is rejected with an authorization error.
  - name: Groups
    description: |
      Groups are the teams agents are organized into for conversation distribution on NCA (Novo Conceito de Atendimento) accounts. Use these endpoints to list an organization's groups and to see which agents in a group are currently online.
x-tagGroups:
  - name: Messaging
    tags:
      - Content types
      - SMS
      - WhatsApp
      - Instagram
      - Facebook
      - RCS
      - Telegram
      - Google Business Messages
      - Voice
      - E-Mail
      - Message Batches
      - Two Factor Authentication
  - name: Webhooks
    tags:
      - Webhooks
  - name: Templates
    tags:
      - Templates
  - name: File Storage
    tags:
      - Files
  - name: Flow
    tags:
      - Flow Batches
  - name: Chatbot
    tags:
      - Chatbot Outbound
  - name: Contacts
    tags:
      - Contacts
      - Contact Lists
      - Contact Custom Data Fields
      - Contact Batches
  - name: Products
    tags:
      - Product Batches
  - name: Orders
    tags:
      - Order Batches
  - name: Invoices
    tags:
      - Invoice Batches
  - name: Reports
    tags:
      - Message Report
      - Flow Report
  - name: Marketing Automations
    tags:
      - Marketing Automations
  - name: Support Service
    tags:
      - Tickets
      - Ticket Actions
      - Ticket Tags
  - name: Status
    tags:
      - Status Groups
  - name: Conversations
    tags:
      - Conversations
      - Groups
