# MailMessagesByMailThreadId
## Documentation
The e-mail messages of one conversation. Each request costs 20 tokens of the daily budget of the company.
- Catalog: `Pipedrive`
- Schema: `Mail`
- Primary Keys: `id`
This is a read-only table function. The Pipedrive API may not support changing the data or the Invantive UniversalSQL driver for Pipedrive does not cover it. In the latter case, please use the table NativePlatformScalarRequests to upload data to the Pipedrive API.
## Parameters of Table Function
The following parameters can be used to control the behaviour of the table function `MailMessagesByMailThreadId`. A value must be provided at all times for required parameters, but optional parameters in general do not need to have a value and the execution will default to a pre-defined behaviour. Values can be specified by position and by name. In both cases, all parameters not specified will be evaluated using their default values.
Value specification by position is done by listing all values from the first to the last needed value. For example: a `select * from table(value1, value2, value3)` on a table with four parameters will use the default value for the fourth parameter and the specified values for the first three.
Value specification by name is done by listing all values that require a value. For example with `select * from table(name1 => value1, name3 => value3)` on the same table will use the default values for the second and fourth parameters and the specified values for the first and third.
| Name | Data Type | Required | Default Value | Documentation |
|---|:---:|:---:|:---:|---|
| `mail_thread_id` | `int64` | ☑ | | The mail thread id. |
## Columns of Table Function
The columns of the table function `MailMessagesByMailThreadId` are shown below. Each column has an SQL data type.
| Name | Data Type | Label | Required | Documentation |
|---|:---:|---|:---:|---|
| `account_id` | `varchar2` | | ☐ | The connection account ID. |
| `add_time` | `datetime` | | ☐ | The time when the mail message was inserted to database. |
| `bcc` | `varchar2` | | ☐ | Participants of the Bcc. |
| `body_url` | `varchar2` | | ☐ | A link to the mail thread message. |
| `cc` | `varchar2` | | ☐ | Participants of the Cc. |
| `deleted_flag` | `varchar2` | | ☐ | The deleted flag. |
| `draft` | `varchar2` | | ☐ | If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise null. |
| `from` | `varchar2` | | ☐ | Senders of the mail thread. |
| `has_attachments_flag` | `varchar2` | | ☐ | The has attachments flag. |
| `has_body_flag` | `varchar2` | | ☐ | The has body flag. |
| `has_inline_attachments_flag` | `varchar2` | | ☐ | The has inline attachments flag. |
| `has_real_attachments_flag` | `varchar2` | | ☐ | The has real attachments flag. |
| `id` | `int64` | | ☑ | ID of the mail thread. |
| `mail_link_tracking_enabled_flag` | `varchar2` | | ☐ | The mail link tracking enabled flag. |
| `mail_thread_id` | `int64` | | ☐ | ID of the mail thread. |
| `mail_tracking_status` | `varchar2` | | ☐ | Mail tracking status. |
| `message_time` | `datetime` | | ☐ | The time when the mail message was received or created. |
| `read_flag` | `varchar2` | | ☐ | The read flag. |
| `sent_flag` | `varchar2` | | ☐ | The sent flag. |
| `sent_from_pipedrive_flag` | `varchar2` | | ☐ | The sent from pipedrive flag. |
| `smart_bcc_flag` | `varchar2` | | ☐ | The smart bcc flag. |
| `snippet` | `varchar2` | | ☐ | A snippet. |
| `subject` | `varchar2` | | ☐ | The subject. |
| `synced_flag` | `varchar2` | | ☐ | The synced flag. |
| `to` | `varchar2` | | ☐ | Recipients of the mail thread. |
| `update_time` | `datetime` | | ☐ | The time when the mail message was updated in database received. |
| `user_id` | `int64` | | ☐ | ID of the user whom mail message will be assigned to. |