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

# Superchat API reference

> API reference for the Superchat plugin in Corsair: every `superchat.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Channels

### get

`channels.get`

Read one channel with its type, name and the inbox it belongs to

**Risk:** `read`

```ts theme={null}
await corsair.superchat.api.channels.get({ channelId: 'mc_1aBMS9FKwvSDjljRJI1aZ' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `channelId` | `string` | Yes | The channel id, as `mc_...`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `inbox_id` | `string \| null` | No | — |

***

### list

`channels.list`

List the channels in the workspace, optionally only those in one inbox; a channel id is what a message is sent from

**Risk:** `read`

```ts theme={null}
await corsair.superchat.api.channels.list({ inbox_id: 'in_1aBMS9FKwvSDjljRJI1aZ' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor: the id to read records after. |
| `before` | `string` | No | Cursor: the id to read records before. |
| `limit` | `number` | No | Objects per page, 1 to 100. Defaults to 50. |
| `inbox_id` | `string` | No | Only channels in this inbox. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | — |
| `results` | `object[]` | Yes | — |
| `pagination` | `object` | Yes | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   type?: string | null,
>   name?: string | null,
>   inbox_id?: string | null
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   next_cursor?: string | null,
>   previous_cursor?: string | null,
>   next_url?: string | null,
>   previous_url?: string | null
> }
> ```

***

## Contact Lists

### addContact

`contactLists.addContact`

Add a contact to a contact list. The list is named in the body on this route, not in the path

**Risk:** `write`

```ts theme={null}
await corsair.superchat.api.contactLists.addContact({ contactId: 'ct_1aBMS9FKwvSDjljRJI1aZ', contactListId: 'cl_1aBMS9FKwvSDjljRJI1aZ' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contactId` | `string` | Yes | — |
| `contactListId` | `string` | Yes | — |

The list id goes in the body as `{ id }`, not in the path, on this route. Removing a contact takes it in the path instead.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |

***

### create

`contactLists.create`

Create a contact list that contacts can be added to

**Risk:** `write`

```ts theme={null}
await corsair.superchat.api.contactLists.create({ name: 'Newsletter Subscribers', description: 'Contacts subscribed to the newsletter' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |
| `description` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |

***

### delete

`contactLists.delete`

Delete a contact list. Its membership goes with it, and this cannot be undone

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.superchat.api.contactLists.delete({ contactListId: 'cl_1aBMS9FKwvSDjljRJI1aZ' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contactListId` | `string` | Yes | The contact list id, as `cl_...`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |

***

### forContact

`contactLists.forContact`

List the contact lists one contact belongs to, paged by cursor like the other lists

**Risk:** `read`

```ts theme={null}
await corsair.superchat.api.contactLists.forContact({ contactId: 'ct_1aBMS9FKwvSDjljRJI1aZ' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contactId` | `string` | Yes | — |
| `after` | `string` | No | Cursor: the id to read records after. |
| `before` | `string` | No | Cursor: the id to read records before. |
| `limit` | `number` | No | Objects per page, 1 to 100. Defaults to 50. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | — |
| `results` | `object[]` | Yes | — |
| `pagination` | `object` | Yes | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id: string,
>   name: string,
>   description?: string | null,
>   url?: string | null
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   next_cursor?: string | null,
>   previous_cursor?: string | null,
>   next_url?: string | null,
>   previous_url?: string | null
> }
> ```

***

### list

`contactLists.list`

List the contact lists in the workspace

**Risk:** `read`

```ts theme={null}
await corsair.superchat.api.contactLists.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor: the id to read records after. |
| `before` | `string` | No | Cursor: the id to read records before. |
| `limit` | `number` | No | Objects per page, 1 to 100. Defaults to 50. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | — |
| `results` | `object[]` | Yes | — |
| `pagination` | `object` | Yes | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id: string,
>   name: string,
>   description?: string | null,
>   url?: string | null
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   next_cursor?: string | null,
>   previous_cursor?: string | null,
>   next_url?: string | null,
>   previous_url?: string | null
> }
> ```

***

### removeContact

`contactLists.removeContact`

Remove a contact from a contact list; the contact itself stays

**Risk:** `write`

```ts theme={null}
await corsair.superchat.api.contactLists.removeContact({ contactId: 'ct_1aBMS9FKwvSDjljRJI1aZ', contactListId: 'cl_1aBMS9FKwvSDjljRJI1aZ' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contactId` | `string` | Yes | — |
| `contactListId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |

***

## Contacts

### create

`contacts.create`

Create a contact. At least one handle is required, and a handle is the email address or phone number that identifies them on a channel

**Risk:** `write`

```ts theme={null}
await corsair.superchat.api.contacts.create({ first_name: 'Jane', last_name: 'Smith', gender: null, handles: [{ id: null, type: 'mail', value: 'jane@example.com' }] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `first_name` | `string \| null` | Yes | Required; the value may be null. |
| `last_name` | `string \| null` | Yes | Required; the value may be null. |
| `gender` | `male \| female \| diverse \| unknown \| null` | Yes | Required; the value may be null. |
| `custom_attributes` | `object[] \| null` | No | — |
| `handles` | `object[]` | Yes | — |

At least one handle is required; a handle is the email address or phone number that identifies the contact on a channel.

> [accordion] custom\_attributes full type
>
> ```ts theme={null}
> {
>   identifier?: string | null,
>   type?: string | null,
>   value?: any | null,
>   attribute_id?: string | null
> }[] | null
> ```

> [accordion] handles full type
>
> ```ts theme={null}
> {
>   id: string | null,
>   type: mail | phone,
>   value: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `first_name` | `string \| null` | No | — |
| `last_name` | `string \| null` | No | — |
| `gender` | `male \| female \| diverse \| unknown \| null` | No | — |
| `handles` | `object[] \| null` | No | — |
| `custom_attributes` | `object[] \| null` | No | — |
| `created_at` | `string \| null` | No | ISO 8601. |
| `updated_at` | `string \| null` | No | ISO 8601. |

> [accordion] handles full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   type?: mail | phone | null,
>   value?: string | null
> }[] | null
> ```

> [accordion] custom\_attributes full type
>
> ```ts theme={null}
> {
>   identifier?: string | null,
>   type?: string | null,
>   value?: any | null,
>   attribute_id?: string | null
> }[] | null
> ```

***

### delete

`contacts.delete`

Delete a contact and their handles. Conversations that referenced them lose the link, and this cannot be undone

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.superchat.api.contacts.delete({ contactId: 'ct_1aBMS9FKwvSDjljRJI1aZ' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contactId` | `string` | Yes | The Superchat contact id, as `ct_...`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `deleted` | `true` | Yes | — |

***

### get

`contacts.get`

Read one contact with their handles, gender and custom attribute values

**Risk:** `read`

```ts theme={null}
await corsair.superchat.api.contacts.get({ contactId: 'ct_1aBMS9FKwvSDjljRJI1aZ' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contactId` | `string` | Yes | The Superchat contact id, as `ct_...`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `first_name` | `string \| null` | No | — |
| `last_name` | `string \| null` | No | — |
| `gender` | `male \| female \| diverse \| unknown \| null` | No | — |
| `handles` | `object[] \| null` | No | — |
| `custom_attributes` | `object[] \| null` | No | — |
| `created_at` | `string \| null` | No | ISO 8601. |
| `updated_at` | `string \| null` | No | ISO 8601. |

> [accordion] handles full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   type?: mail | phone | null,
>   value?: string | null
> }[] | null
> ```

> [accordion] custom\_attributes full type
>
> ```ts theme={null}
> {
>   identifier?: string | null,
>   type?: string | null,
>   value?: any | null,
>   attribute_id?: string | null
> }[] | null
> ```

***

### list

`contacts.list`

List contacts newest first, paging with a cursor id; set after or before, never both

**Risk:** `read`

```ts theme={null}
await corsair.superchat.api.contacts.list({ limit: 10 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor: the id to read records after. |
| `before` | `string` | No | Cursor: the id to read records before. |
| `limit` | `number` | No | Objects per page, 1 to 100. Defaults to 50. |

Paging is by cursor: set after or before, never both, and limit is 1 to 100 with a default of 50.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | — |
| `results` | `object[]` | Yes | — |
| `pagination` | `object` | Yes | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   gender?: male | female | diverse | unknown | null,
>   handles?: {
>     id?: string | null,
>     type?: mail | phone | null,
>     value?: string | null
>   }[] | null,
>   custom_attributes?: {
>     identifier?: string | null,
>     type?: string | null,
>     value?: any | null,
>     attribute_id?: string | null
>   }[] | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   next_cursor?: string | null,
>   previous_cursor?: string | null,
>   next_url?: string | null,
>   previous_url?: string | null
> }
> ```

***

### search

`contacts.search`

Search contacts by email, phone, Instagram or WhatsApp username, or a custom attribute; every expression has to match

**Risk:** `read`

```ts theme={null}
await corsair.superchat.api.contacts.search({ query: { value: [{ field: 'mail', operator: '=', value: 'jane@example.com' }] } });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor: the id to read records after. |
| `before` | `string` | No | Cursor: the id to read records before. |
| `limit` | `number` | No | Objects per page, 1 to 100. Defaults to 50. |
| `query` | `object` | Yes | The expressions to match, sent as the route expects them. |

Every expression has to match. A custom\_attribute expression also needs an identifier; the schema rejects one without it.

> [accordion] query full type
>
> ```ts theme={null}
> {
>   value: {
>     field: mail | phone | instagram | whats_app_username | custom_attribute,
>     operator: =,
>     value: string,
>     identifier?: string
>   }[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | — |
| `results` | `object[]` | Yes | — |
| `pagination` | `object` | Yes | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   gender?: male | female | diverse | unknown | null,
>   handles?: {
>     id?: string | null,
>     type?: mail | phone | null,
>     value?: string | null
>   }[] | null,
>   custom_attributes?: {
>     identifier?: string | null,
>     type?: string | null,
>     value?: any | null,
>     attribute_id?: string | null
>   }[] | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   next_cursor?: string | null,
>   previous_cursor?: string | null,
>   next_url?: string | null,
>   previous_url?: string | null
> }
> ```

***

### update

`contacts.update`

Change a contact's names, gender, handles or custom attributes. The route requires first name, last name and gender, so all three are sent back

**Risk:** `write`

```ts theme={null}
await corsair.superchat.api.contacts.update({ contactId: 'ct_1aBMS9FKwvSDjljRJI1aZ', first_name: 'Jane', last_name: 'Smith', gender: null });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contactId` | `string` | Yes | — |
| `first_name` | `string \| null` | Yes | Required by the route; the value may be null. |
| `last_name` | `string \| null` | Yes | Required by the route. |
| `gender` | `male \| female \| diverse \| unknown \| null` | Yes | Required by the route. |
| `handles` | `object[] \| null` | No | — |
| `custom_attributes` | `object[] \| null` | No | — |

The route requires first\_name, last\_name and gender even though it is a PATCH. Their values may be null, but the keys must be present.

> [accordion] handles full type
>
> ```ts theme={null}
> {
>   id: string | null,
>   type: mail | phone,
>   value: string
> }[] | null
> ```

> [accordion] custom\_attributes full type
>
> ```ts theme={null}
> {
>   identifier?: string | null,
>   type?: string | null,
>   value?: any | null,
>   attribute_id?: string | null
> }[] | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `first_name` | `string \| null` | No | — |
| `last_name` | `string \| null` | No | — |
| `gender` | `male \| female \| diverse \| unknown \| null` | No | — |
| `handles` | `object[] \| null` | No | — |
| `custom_attributes` | `object[] \| null` | No | — |
| `created_at` | `string \| null` | No | ISO 8601. |
| `updated_at` | `string \| null` | No | ISO 8601. |

> [accordion] handles full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   type?: mail | phone | null,
>   value?: string | null
> }[] | null
> ```

> [accordion] custom\_attributes full type
>
> ```ts theme={null}
> {
>   identifier?: string | null,
>   type?: string | null,
>   value?: any | null,
>   attribute_id?: string | null
> }[] | null
> ```

***

## Conversations

### get

`conversations.get`

Read one conversation with its labels, assignees, linked contacts and snooze state

**Risk:** `read`

```ts theme={null}
await corsair.superchat.api.conversations.get({ id: 'cv_1aBMS9FKwvSDjljRJI1aZ' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The conversation id, as `cv_...`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `status` | `string \| null` | No | — |
| `channel` | `object \| null` | No | — |
| `inbox` | `object \| null` | No | — |
| `labels` | `any[] \| null` | No | — |
| `assigned_users` | `any[] \| null` | No | — |
| `contacts` | `any[] \| null` | No | — |
| `snoozed_until` | `string \| null` | No | ISO 8601. |
| `time_window` | `object \| null` | No | — |
| `url` | `string \| null` | No | — |

> [accordion] channel full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   type?: string | null
> } | null
> ```

> [accordion] inbox full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null
> } | null
> ```

> [accordion] time\_window full type
>
> ```ts theme={null}
> {
>   start?: string | null,
>   end?: string | null
> } | null
> ```

***

### list

`conversations.list`

List conversations with their status, channel, inbox and assigned users, paging with a cursor id

**Risk:** `read`

```ts theme={null}
await corsair.superchat.api.conversations.list({ limit: 20 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor: the id to read records after. |
| `before` | `string` | No | Cursor: the id to read records before. |
| `limit` | `number` | No | Objects per page, 1 to 100. Defaults to 50. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | — |
| `results` | `object[]` | Yes | — |
| `pagination` | `object` | Yes | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id: string,
>   status?: string | null,
>   channel?: {
>     id?: string | null,
>     type?: string | null
>   } | null,
>   inbox?: {
>     id?: string | null,
>     name?: string | null
>   } | null,
>   labels?: any[] | null,
>   assigned_users?: any[] | null,
>   contacts?: any[] | null,
>   snoozed_until?: string | null,
>   time_window?: {
>     start?: string | null,
>     end?: string | null
>   } | null,
>   url?: string | null
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   next_cursor?: string | null,
>   previous_cursor?: string | null,
>   next_url?: string | null,
>   previous_url?: string | null
> }
> ```

***

### messages

`conversations.messages`

List the messages in one conversation, paging with a cursor id

**Risk:** `read`

```ts theme={null}
await corsair.superchat.api.conversations.messages({ id: 'cv_1aBMS9FKwvSDjljRJI1aZ' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The conversation id, as `cv_...`. |
| `after` | `string` | No | Cursor: the id to read records after. |
| `before` | `string` | No | Cursor: the id to read records before. |
| `limit` | `number` | No | Objects per page, 1 to 100. Defaults to 50. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | — |
| `results` | `object[]` | Yes | — |
| `pagination` | `object` | Yes | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id: string,
>   status?: string | null,
>   conversation_id?: string | null,
>   in_reply_to?: string | null,
>   content?: {
>     type?: string | null,
>     body?: string | null
>   } | null,
>   to?: any[] | {
>     channel_id?: string | null
>   } | null,
>   from?: any | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   direction?: string | null,
>   url?: string | null
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   next_cursor?: string | null,
>   previous_cursor?: string | null,
>   next_url?: string | null,
>   previous_url?: string | null
> }
> ```

***

### update

`conversations.update`

Change a conversation's status, inbox, labels or assignees. Snoozing needs both a status of snoozed and a snoozed\_until time

**Risk:** `write`

```ts theme={null}
await corsair.superchat.api.conversations.update({ id: 'cv_1aBMS9FKwvSDjljRJI1aZ', status: 'snoozed', snoozed_until: '2026-03-20T09:00:00Z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `status` | `open \| done \| spam \| archived \| snoozed \| null` | No | The values the PATCH route accepts. |
| `inbox_id` | `string \| null` | No | — |
| `snoozed_until` | `string \| null` | No | ISO 8601. |
| `assigned_users` | `string[] \| null` | No | — |
| `labels` | `string[] \| null` | No | — |

Snoozing needs both status snoozed and a snoozed\_until time, or the API rejects the call.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `status` | `string \| null` | No | — |
| `channel` | `object \| null` | No | — |
| `inbox` | `object \| null` | No | — |
| `labels` | `any[] \| null` | No | — |
| `assigned_users` | `any[] \| null` | No | — |
| `contacts` | `any[] \| null` | No | — |
| `snoozed_until` | `string \| null` | No | ISO 8601. |
| `time_window` | `object \| null` | No | — |
| `url` | `string \| null` | No | — |

> [accordion] channel full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   type?: string | null
> } | null
> ```

> [accordion] inbox full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null
> } | null
> ```

> [accordion] time\_window full type
>
> ```ts theme={null}
> {
>   start?: string | null,
>   end?: string | null
> } | null
> ```

***

## Inboxes

### get

`inboxes.get`

Read one inbox with its name and workspace url

**Risk:** `read`

```ts theme={null}
await corsair.superchat.api.inboxes.get({ inboxId: 'in_1aBMS9FKwvSDjljRJI1aZ' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `inboxId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `name` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |

***

### list

`inboxes.list`

List the inboxes in the workspace

**Risk:** `read`

```ts theme={null}
await corsair.superchat.api.inboxes.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor: the id to read records after. |
| `before` | `string` | No | Cursor: the id to read records before. |
| `limit` | `number` | No | Objects per page, 1 to 100. Defaults to 50. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string \| null` | No | — |
| `results` | `object[]` | Yes | — |
| `pagination` | `object` | Yes | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   url?: string | null
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   next_cursor?: string | null,
>   previous_cursor?: string | null,
>   next_url?: string | null,
>   previous_url?: string | null
> }
> ```

***

## Messages

### get

`messages.get`

Read one message with its content, direction and status

**Risk:** `read`

```ts theme={null}
await corsair.superchat.api.messages.get({ id: 'me_1aBMS9FKwvSDjljRJI1aZ' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The message id, as `mc_...` or `me_...`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `in_reply_to` | `string \| null` | No | — |
| `content` | `object \| null` | No | — |
| `to` | `any[] \| object \| null` | No | — |
| `from` | `any \| null` | No | — |
| `created_at` | `string \| null` | No | ISO 8601. |
| `updated_at` | `string \| null` | No | ISO 8601. |
| `direction` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |

> [accordion] content full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   body?: string | null
> } | null
> ```

> [accordion] to full type
>
> ```ts theme={null}
> any[] | {
>   channel_id?: string | null
> } | null
> ```

***

### send

`messages.send`

Send a text message on a channel to one recipient. This reaches a real person on WhatsApp, SMS or another channel, and the content has to suit that channel

**Risk:** `destructive`

```ts theme={null}
await corsair.superchat.api.messages.send({ to: [{ identifier: 'jane@example.com' }], from: { channel_id: 'mc_1aBMS9FKwvSDjljRJI1aZ', name: 'Acme Support' }, content: { type: 'text', body: 'Hello!' } });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `to` | `object[]` | Yes | The recipient: one entry, whose identifier is the handle on the target channel. |
| `from` | `object` | Yes | — |
| `content` | `object` | Yes | A text message. The media, email and template content shapes are not typed by this plugin. |

Delivers to a real person on the channel named in from. The content has to suit that channel, and the spec caps to at one recipient.

> [accordion] to full type
>
> ```ts theme={null}
> {
>   identifier: string
> }[]
> ```

> [accordion] from full type
>
> ```ts theme={null}
> {
>   channel_id: string,
>   name?: string | null
> }
> ```

> [accordion] content full type
>
> ```ts theme={null}
> {
>   type: text,
>   body: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `status` | `string \| null` | No | — |
| `conversation_id` | `string \| null` | No | — |
| `in_reply_to` | `string \| null` | No | — |
| `content` | `object \| null` | No | — |
| `to` | `any[] \| object \| null` | No | — |
| `from` | `any \| null` | No | — |
| `created_at` | `string \| null` | No | ISO 8601. |
| `updated_at` | `string \| null` | No | ISO 8601. |
| `direction` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |

> [accordion] content full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   body?: string | null
> } | null
> ```

> [accordion] to full type
>
> ```ts theme={null}
> any[] | {
>   channel_id?: string | null
> } | null
> ```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.