> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nekt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RD Station Conversas as a data source

> Bring data from RD Station Conversas to Nekt.

RD Station Conversas is RD Station's conversation and messaging platform for managing customer interactions across channels (WhatsApp, Instagram, email, and others). The connector extracts contacts, message history, flows, templates, and related data from the Conversas API so you can centralize conversation data in your Lakehouse.

<img width="200" src="https://mintcdn.com/nekt/TSt2o1hqczxnLH_H/assets/logo/logo-rd-station-conversas.png?fit=max&auto=format&n=TSt2o1hqczxnLH_H&q=85&s=143b5ce647319f4a777c9d4996c18e55" data-path="assets/logo/logo-rd-station-conversas.png" />

## Configuring RD Station Conversas as a Source

In the [Sources](https://app.nekt.ai/sources) tab, click on the "Add source" button located on the top right of your screen. Then, select the RD Station Conversas option from the list of connectors.

Click **Next** and you'll be prompted to add your access.

### 1. Add account access

You'll need to provide authentication so Nekt can access your RD Station Conversas data. The API uses a JWT sent in the `Authorization: Bearer` header.

The following configurations are available:

* **Access token**: Token used for authentication. Required. You can get it at **Apps & Integrations > API > RD Station Conversas** ([developers.rdstation.com](https://developers.rdstation.com)).

* **Private key (JWK) for decryption**: JWK (JSON Web Key) of the private key as a JSON string, to decrypt messages history responses. Optional. Generate it at **Apps & Integrations > API > Generate Key**. See [Conversas v2 encryption](https://developers.rdstation.com/reference/conversas-v2-encryption). If not provided, message history is stored as encrypted payload in the `data` field.

* **Start date**: Start date for fetching historical messages. Required if using the messages history stream. Only messages from this date onward are fetched. You can use common date formats (e.g. `2024-01-01`).

Once you're done, click **Next**.

### 2. Select streams

Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis. You can select entire groups of streams or pick specific ones.

> Tip: The stream can be found more easily by typing its name.

<Note>The **messages\_history** stream is a child of **contacts**: it fetches conversation history per contact. Selecting **messages\_history** will sync history for every contact. Ensure **Start Date** is set if you use this stream. This stream is available only on the **Advanced** plan — see [planos RD Station Conversas](https://www.rdstation.com/planos/conversas/).</Note>

Select the streams and click **Next**.

### 3. Configure data streams

Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.

* **Layer**: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
* **Folder**: a folder can be created inside the selected layer to group all tables being created from this new data source.
* **Table name**: we suggest a name, but feel free to customize it. You have the option to add a **prefix** to all tables at once and make this process faster!
* **Sync Type**: all streams in this connector are full table; select the option that best fits how you want to refresh the data.

Once you are done configuring, click **Next**.

### 4. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters.

To define your [Trigger](https://docs.nekt.com/get-started/core-concepts/triggers), consider how often you want data to be extracted from this source. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times).

Optionally, you can define some additional settings:

* Configure Delta Log Retention and determine for how long we should store old states of this table as it gets updated. Read more about this resource [here](https://docs.nekt.com/get-started/core-concepts/resource-control).
* Determine when to execute an **Additional [Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#additional-full-sync)**. This will complement the incremental data extractions, ensuring that your data is completely synchronized with your source every once in a while.

Once you are ready, click **Next** to finalize the setup.

### 5. Check your new source

You can view your new source on the [Sources](https://app.nekt.ai/sources) page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.

<Warning>For you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you need at least one successful source run.</Warning>

# Streams and Fields

Below you'll find all available data streams from RD Station Conversas and their corresponding fields. API reference: [developers.rdstation.com](https://developers.rdstation.com).

<AccordionGroup>
  <Accordion title="Contacts">
    List contacts (GET /v2/customers). Base stream for conversation data; **messages\_history** is a child of this stream.

    | Field       | Type   | Description                           |
    | :---------- | :----- | :------------------------------------ |
    | `_id`       | String | ID do contato                         |
    | `full_name` | String | Nome completo do contato              |
    | `email`     | String | Endereço de e-mail do contato         |
    | `cel_phone` | String | Número de telefone celular do contato |

    **Address (object):**

    | Field                | Type   | Description |
    | :------------------- | :----- | :---------- |
    | `address.city`       | String | Cidade      |
    | `address.complement` | String | Complemento |
    | `address.country`    | String | País        |
    | `address.district`   | String | Bairro      |
    | `address.number`     | String | Número      |
    | `address.state`      | String | Estado/UF   |
    | `address.street`     | String | Logradouro  |
    | `address.zip_code`   | String | CEP         |

    **Job (object):**

    | Field                 | Type   | Description           |
    | :-------------------- | :----- | :-------------------- |
    | `job.cnpj`            | String | CNPJ da empresa       |
    | `job.company`         | String | Nome da empresa       |
    | `job.department`      | String | Departamento          |
    | `job.email`           | String | E-mail profissional   |
    | `job.occupation_area` | String | Área de atuação       |
    | `job.phone`           | String | Telefone profissional |
    | `job.site`            | String | Site da empresa       |
    | `job.title`           | String | Cargo                 |
  </Accordion>

  <Accordion title="Custom Fields">
    List custom fields (GET /v2/custom-fields). Variables that can be used in message templates.

    | Field   | Type   | Description                                |
    | :------ | :----- | :----------------------------------------- |
    | `id`    | String | Custom field ID                            |
    | `key`   | String | Variable to reference in message templates |
    | `label` | String | Label of the custom field                  |
    | `info`  | String | Additional information about the field     |
  </Accordion>

  <Accordion title="Employees">
    List employees (GET /v2/employees).

    | Field   | Type   | Description            |
    | :------ | :----- | :--------------------- |
    | `id`    | String | Employee ID            |
    | `name`  | String | Employee name          |
    | `email` | String | Employee email address |
  </Accordion>

  <Accordion title="Flows">
    List flows (GET /v2/flows).

    | Field   | Type   | Description |
    | :------ | :----- | :---------- |
    | `id`    | String | Flow ID     |
    | `title` | String | Flow title  |
  </Accordion>

  <Accordion title="Messages History">
    List message history per contact (GET /v2/messages/history). **Child stream of Contacts** — one partition per contact. Requires **Start Date** in the source configuration. Response is encrypted (JWE); use **Private Key (JWK)** to store decrypted message JSON in the `data` field; otherwise `data` contains the encrypted payload.

    <Warning>
      This stream is available only for the **Advanced** plan of RD Station Conversas. Basic and Pro plans do not have access to the conversation history API. See [planos e preços](https://www.rdstation.com/planos/conversas/) for details.
    </Warning>

    | Field         | Type   | Description                                                                                  |
    | :------------ | :----- | :------------------------------------------------------------------------------------------- |
    | `customer_id` | String | Contact ID this message history belongs to                                                   |
    | `data`        | String | Message content: decrypted JSON string if private key is set, otherwise encrypted JWE string |
  </Accordion>

  <Accordion title="Reports">
    List reports (GET /v4/reports). Uses the Conversas v4 API base.

    | Field         | Type    | Description        |
    | :------------ | :------ | :----------------- |
    | `id`          | Integer | Report ID          |
    | `title`       | String  | Report title       |
    | `description` | String  | Report description |
    | `createdAt`   | String  | Creation date      |
    | `updatedAt`   | String  | Last update date   |
  </Accordion>

  <Accordion title="Templates">
    List message templates (GET /v2/template/all).

    | Field           | Type   | Description                       |
    | :-------------- | :----- | :-------------------------------- |
    | `id`            | String | Template ID                       |
    | `title`         | String | Template title                    |
    | `channel`       | String | Channel (e.g. whatsapp, email)    |
    | `content`       | String | Template text content             |
    | `content_media` | String | Media type of the message content |
  </Accordion>

  <Accordion title="Wallets">
    List wallets (GET /v2/wallets).

    | Field  | Type   | Description |
    | :----- | :----- | :---------- |
    | `id`   | String | Wallet ID   |
    | `name` | String | Wallet name |
  </Accordion>

  <Accordion title="WhatsApp Official Integrations">
    List official WhatsApp integrations (GET /v2/whatsapp/integrations/official).

    | Field   | Type   | Description              |
    | :------ | :----- | :----------------------- |
    | `key`   | String | Official integration key |
    | `label` | String | Integration label        |
  </Accordion>

  <Accordion title="Workflows">
    List workflows (GET /v2/workflows).

    | Field    | Type   | Description                          |
    | :------- | :----- | :----------------------------------- |
    | `title`  | String | Workflow title                       |
    | `stages` | String | Workflow stages as JSON array string |
  </Accordion>
</AccordionGroup>

# Data Model

The following diagram illustrates the main relationships. **Contacts** is the core entity; **messages\_history** is partitioned by contact (child stream). Other streams are independent configuration or metadata entities.

```mermaid theme={null}
graph TD;
    subgraph "Core"
        Contacts("Contacts");
        MessagesHistory("Messages History");
    end

    subgraph "Configuration & Metadata"
        CustomFields("Custom Fields");
        Employees("Employees");
        Flows("Flows");
        Templates("Templates");
        Workflows("Workflows");
        Reports("Reports");
        Wallets("Wallets");
        WhatsAppOfficial("WhatsApp Official Integrations");
    end

    MessagesHistory -- "customer_id" --> Contacts;
```

# Implementation Notes

### Message history and encryption

* The **messages\_history** stream returns responses encrypted with JWE (RSA-OAEP-256). To store decrypted message content in the `data` field, configure **Private key (JWK)** in the source. If not set, the raw encrypted payload is stored in `data`.
* **Start Date** is required for messages\_history so the API can filter messages from that date onward (YYYY-MM-DD or common date formats).

### Child stream behavior

* **messages\_history** is a child of **contacts**. The tap first syncs all contacts, then requests message history for each contact. Selecting both streams will result in one messages history partition per contact; ensure Start Date is set for consistent results.

## Skills for agents

<Snippet file="agent-skills-intro.mdx" />

<Card title="Download RD Station Conversas skills file" icon="wand-magic-sparkles" href="/sources/rd-station-conversas.md">
  RD Station Conversas connector documentation as plain markdown, for use in AI agent contexts.
</Card>
