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

# API

> API reference for Unipile: every `unipile.api.*` operation with input and output types.

Every `unipile.api.*` operation is listed below with parameter shapes and return types from the plugin 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).

## Accounts

### createAuthLink

`accounts.createAuthLink`

Create a Hosted Auth link for a user to connect a LinkedIn (or other) account, or to reconnect one with account\_id; LinkedIn sign-in can offer credentials, cookies or the UniLogin extension

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.accounts.createAuthLink({ providers: 'linkedin', redirect_uri: 'https://app.example.com/linkedin/connected', state: 'user_123', config: { linkedin: { allow_methods: ['unilogin', 'credentials'] } } });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `providers` | `* \| *:MESSAGING \| *:EMAILS \| *:CALENDAR \| *:SOCIAL \| linkedin \| mock \| whatsapp \| google \| outlook \| imap \| telegram \| instagram \| linkedin \| mock \| whatsapp \| google \| outlook \| imap \| telegram \| instagram[]` | No | Providers to offer when linking a new account, e.g. linkedin. Omit when reconnecting with account\_id |
| `account_id` | `string` | No | Reconnect or reconfigure this existing account instead of linking a new one |
| `expires_on` | `string` | No | When the link stops working, ISO 8601 with a timezone. Defaults to one hour from now |
| `redirect_uri` | `string` | Yes | Where to send the user afterwards. On success Unipile adds account\_id, provider and state to the query; on failure error\_title |
| `state` | `string` | No | Your own ID for this user or session. Unipile returns it on the redirect and in the account.add / account.reconnect webhook |
| `account_scope_id` | `string` | No | Scope to assign the account to |
| `domain` | `string` | No | White-label Hosted Auth hostname already verified by Unipile |
| `config` | `object` | No | — |

> **config full type**
>
> ```ts theme={null}
> {
>   linkedin?: {
>     allow_methods?: credentials | cookies | unilogin[],
>     products?: classic | company | recruiter | sales_navigator[],
>     allow_product_selection?: boolean,
>     auto_proxy_config?: {
>       country?: string,
>       ip?: string,
>       allow_country_fallback?: boolean
>     }
>   },
>   global?: {
>     login_hint?: string,
>     allow_user_proxy_override?: boolean,
>     allow_user_country_override?: boolean
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `link` | `string` | Yes | Hosted Auth URL to send the user to |

***

### get

`accounts.get`

Get one connected account: provider, status (running, disconnected, errored…), lock state and connection method

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.accounts.get({ account_id: 'acc_9f2c1d7e' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `id` | `string` | Yes | — |
| `name` | `string` | No | — |
| `user_id` | `string` | No | The owner's user ID on the provider |
| `provider` | `string` | Yes | — |
| `status` | `string` | Yes | running, errored, disconnected (needs re-authentication), degraded or partial |
| `is_locked` | `boolean` | No | — |
| `created_at` | `string` | No | — |
| `application_id` | `string` | No | — |
| `account_scope_id` | `string` | No | — |
| `metadata` | `object` | No | — |

> **metadata full type**
>
> ```ts theme={null}
> {
>   connection_method?: string | null,
>   products_connection_status?: {
>   } | null,
>   custom_data?: {
>   } | null
> }
> ```

***

### list

`accounts.list`

List connected Unipile accounts (LinkedIn and others) with their acc\_ IDs, provider and status; filter by provider or status

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.accounts.list({ provider: 'linkedin', status: 'running' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `provider` | `linkedin \| mock \| whatsapp \| google \| outlook \| imap \| telegram \| instagram` | No | — |
| `status` | `running \| errored \| disconnected \| degraded \| partial` | No | — |
| `search` | `string` | No | Match on account name or id |
| `account_scope_id` | `string` | No | Scope ID, or `none` for accounts without a scope |
| `offset` | `number` | No | Number of items to skip |
| `limit` | `number` | No | Number of items to return |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `data` | `object[]` | Yes | — |
| `has_more` | `boolean` | No | — |

> **data full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id: string,
>   name?: string | null,
>   user_id?: string | null,
>   provider: string,
>   status: string,
>   is_locked?: boolean | null,
>   created_at?: string | null,
>   application_id?: string | null,
>   account_scope_id?: string | null,
>   metadata?: {
>     connection_method?: string | null,
>     products_connection_status?: {
>     } | null,
>     custom_data?: {
>     } | null
>   } | null
> }[]
> ```

***

### remove

`accounts.remove`

Disconnect an account from Unipile and delete all its Unipile data. The user must link it again to use it

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

```ts theme={null}
await corsair.unipile.api.accounts.remove({ account_id: 'acc_9f2c1d7e' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### update

`accounts.update`

Update a connected account: its name, custom data, proxy settings or LinkedIn products

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.accounts.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `account_scope_id` | `string` | No | The Scope to permanently assign to an unscoped Account. This field requires a Service API Key, and the Scope cannot be removed or replaced after assignment. |
| `metadata` | `object` | No | Custom key-value data for the account. Replaces the account `metadata.custom_data` field; other metadata fields are not modified. Any fields not provided will be removed. |
| `auto_proxy_country` | `string` | No | The rotation country to use for Automatic Proxy Protection. Choose from the countries where Unipile offers automatic proxies. A proxy may be temporarily unavailable even in a country included in the offering. |
| `allow_country_fallback` | `boolean` | No | Whether Automatic Proxy Protection may use an available proxy from another country when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. |
| `proxy` | `object` | No | A new proxy configuration for the account. This will restart the account. Set to `null` to remove the proxy. Removing the proxy will revert the account to using Automatic Proxy Protection if required for the provider. |

> **metadata full type**
>
> ```ts theme={null}
> {
> }
> ```

> **proxy full type**
>
> ```ts theme={null}
> {
>   host: string,
>   port: number,
>   username?: string,
>   password?: string,
>   protocol?: https | http | socks5 | socks4
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | The type of the returned object. |
| `user_id` | `string` | Yes | The ID of the user that owns the account for the provider. |
| `name` | `string` | No | The name of the account. This is usually the display name or public identifier (phone number, email address, etc.) of the user that owns the account. |
| `created_at` | `string` | Yes | The date and time the account was linked with Unipile. |
| `id` | `string` | Yes | ID of the account. |
| `application_id` | `string` | Yes | ID of the parent application. |
| `account_scope_id` | `string` | No | ID of the Scope assigned to the Account. Once assigned, the Scope cannot be removed or replaced. |
| `status` | `string` | Yes | The current status of the account. - `running` is Operational. - `errored` is Service Interuption. - `disconnected` requires authentication. |
| `is_locked` | `boolean` | Yes | Whether API access to the account is locked. |
| `provider` | `string` | Yes | The provider's of the Account. - `mock` is mock. - `whatsapp` is WhatsApp. - `linkedin` is LinkedIn. - `instagram` is Instagram. - `google` is Google. |
| `oauth_scope` | `string` | No | If the provider is OAuth, this is the scope of comma-separated permissions granted to the account. |
| `metadata` | `object` | Yes | Metadata associated with the Account. |
| `initial_sync` | `object` | No | Sync details if the account has initial sync enabled. |
| `proxy` | `object` | No | The proxy used for the account. |

> **metadata full type**
>
> ```ts theme={null}
> {
>   auto_proxy_country?: string | null,
>   allow_country_fallback?: boolean | null,
>   connection_method?: string | null,
>   v1_account_id?: string | null,
>   v1_instance_port?: number | null,
>   products_connection_status?: {
>   } | null,
>   custom_data?: {
>   } | null
> }
> ```

> **initial\_sync full type**
>
> ```ts theme={null}
> {
>   status: string,
>   started_at?: string | null
> }
> ```

> **proxy full type**
>
> ```ts theme={null}
> {
>   country?: string | null,
>   auto_proxy: boolean,
>   host?: string | null,
>   port?: number | null,
>   username?: string | null,
>   protocol?: string | null
> }
> ```

***

## Api Keys

### create

`apiKeys.create`

Create a global or scoped Account API Key. Returns the key once, and only here: store it right away. Needs a Service API Key

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.apiKeys.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | Internal name for the key |
| `expires_at` | `string` | Yes | When the key stops working, ISO 8601 date-time |
| `access` | `object` | Yes | global: every account in the application. scope: only accounts in one scope |

> **access full type**
>
> ```ts theme={null}
> {
>   type: global
> } | {
>   type: scope,
>   scope_id: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | The type of the created object. |
| `id` | `string` | Yes | The unique public ID of the created API Key. |
| `api_key` | `string` | Yes | The secret API Key token. It is returned only once and must be stored securely. |

***

### delete

`apiKeys.delete`

Delete an API key; requests using it fail from then on. Needs a Service API Key

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

```ts theme={null}
await corsair.unipile.api.apiKeys.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `api_key_id` | `string` | Yes | The ID of the Account API Key to delete. |

**Output**

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

***

### list

`apiKeys.list`

List the application's API keys (names, prefixes, roles and expiry; never the keys themselves). Needs a Service API Key

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.apiKeys.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `access` | `global \| scope` | No | — |
| `account_scope_id` | `string` | No | — |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | The type of the returned collection. |
| `data` | `object[]` | Yes | The Account API Keys in the current page. |
| `has_more` | `boolean` | Yes | Whether more API Keys are available after the current page. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   application_id: string,
>   prefix: string,
>   issued_at: string,
>   expires_at: string,
>   name: string,
>   role: string,
>   account_scope_id?: string | null
> }[]
> ```

***

## Auth

### requestCheckpoint

`auth.requestCheckpoint`

Ask the provider for a different checkpoint method (for example SMS instead of email) during auth.startIntent

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.auth.requestCheckpoint({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `intent_id` | `string` | Yes | The ID of the intent for which a checkpoint must be requested. |
| `challenge` | `string` | No | The alternative verification method to switch to. Must be one of the `id`s listed in the CHALLENGE\_SELECTION checkpoint. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `checkpoint` | `object` | No | The details of the checkpoint that user needs to solve. |
| `intent_id` | `string` | No | The ID of the auth intent. This should be used in Solve Checkpoint. |
| `qrcode` | `string` | No | The QR Code to scan. |

> **checkpoint full type**
>
> ```ts theme={null}
> {
>   type?: string | null,
>   channel?: string | null,
>   code?: string | null,
>   platform?: string | null,
>   public_key?: string | null | null,
>   data?: string | null | null,
>   contracts?: any[] | null,
>   products?: any[] | null,
>   challenges?: any[] | null
> }
> ```

***

### resendCheckpoint

`auth.resendCheckpoint`

Ask the provider to send the checkpoint code or notification again during auth.startIntent

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.auth.resendCheckpoint({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `intent_id` | `string` | Yes | The ID of the intent for which a checkpoint must be resent. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### solveCheckpoint

`auth.solveCheckpoint`

Answer the checkpoint (2FA code, OTP, captcha, in-app approval) that auth.startIntent returned

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.auth.solveCheckpoint({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `string` | Yes | The code to solve the checkpoint. Check the AuthenticationCheckpoint response you have already obtained to see what type of code is expected. |
| `intent_id` | `string` | Yes | The ID of the intent for which a checkpoint must be solved. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `checkpoint` | `object` | No | The details of the checkpoint that user needs to solve. |
| `intent_id` | `string` | No | The ID of the auth intent. This should be used in Solve Checkpoint. |
| `qrcode` | `string` | No | The QR Code to scan. |
| `url` | `string` | No | The URL to redirect to start the oauth flow of the provider. |
| `user_id` | `string` | No | The ID of the user that owns the account for the provider. |
| `name` | `string` | No | The name of the account. This is usually the display name or public identifier (phone number, email address, etc.) of the user that owns the account. |
| `created_at` | `string` | No | The date and time the account was linked with Unipile. |
| `id` | `string` | No | ID of the account. |
| `application_id` | `string` | No | ID of the parent application. |
| `account_scope_id` | `string` | No | ID of the Scope assigned to the Account. Once assigned, the Scope cannot be removed or replaced. |
| `status` | `string` | No | The current status of the account. - `running` is Operational. - `errored` is Service Interuption. - `disconnected` requires authentication. |
| `is_locked` | `boolean` | No | Whether API access to the account is locked. |
| `provider` | `string` | No | The provider's of the Account. - `mock` is mock. - `whatsapp` is WhatsApp. - `linkedin` is LinkedIn. - `instagram` is Instagram. - `google` is Google. |
| `oauth_scope` | `string` | No | If the provider is OAuth, this is the scope of comma-separated permissions granted to the account. |
| `metadata` | `object` | No | Metadata associated with the Account. |
| `initial_sync` | `object` | No | Sync details if the account has initial sync enabled. |
| `proxy` | `object` | No | The proxy used for the account. |

> **checkpoint full type**
>
> ```ts theme={null}
> {
>   type?: string | null,
>   channel?: string | null,
>   code?: string | null,
>   platform?: string | null,
>   public_key?: string | null | null,
>   data?: string | null | null,
>   contracts?: any[] | null,
>   products?: any[] | null,
>   challenges?: any[] | null
> }
> ```

> **metadata full type**
>
> ```ts theme={null}
> {
>   auto_proxy_country?: string | null,
>   allow_country_fallback?: boolean | null,
>   connection_method?: string | null,
>   v1_account_id?: string | null,
>   v1_instance_port?: number | null,
>   products_connection_status?: {
>   } | null,
>   custom_data?: {
>   } | null
> }
> ```

> **initial\_sync full type**
>
> ```ts theme={null}
> {
>   status: string,
>   started_at?: string | null
> }
> ```

> **proxy full type**
>
> ```ts theme={null}
> {
>   country?: string | null,
>   auto_proxy: boolean,
>   host?: string | null,
>   port?: number | null,
>   username?: string | null,
>   protocol?: string | null
> }
> ```

***

### startIntent

`auth.startIntent`

Advanced: connect an account without Hosted Auth by sending the user's provider credentials (or UniLogin) yourself. Returns a checkpoint to solve or the new account. Prefer accounts.createAuthLink

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.auth.startIntent({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `provider` | `string` | Yes | Provider to connect, e.g. LINKEDIN, WHATSAPP, GOOGLE |
| `account_id` | `string` | No | Existing account to reconnect. Omit to link a new one |
| `account_scope_id` | `string` | No | Scope to assign a newly linked account to |
| `state` | `string` | No | Returned in the account.add / account.reconnect webhook |
| `unilogin` | `boolean` | No | LinkedIn and Instagram: connect through the UniLogin extension instead of credentials |
| `config` | `object` | No | — |

> **config full type**
>
> ```ts theme={null}
> {
> }
> ```

**Output:** `any`

***

## Calendar Events

### cancel

`calendarEvents.cancel`

Cancel an event the account organizes and notify the attendees. Google keeps it as cancelled; Outlook moves it to Deleted Items

**Risk:** `destructive`

```ts theme={null}
await corsair.unipile.api.calendarEvents.cancel({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `calendar_id` | `string` | Yes | Identifier of the parent calendar. |
| `event_id` | `string` | Yes | ID of the event to cancel. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `comment` | `string` | No | A message about the cancellation sent to the attendees. Only available for outlook. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### create

`calendarEvents.create`

Create an event (timed: date\_time plus IANA timezone; all-day: date). Attendees are invited by the provider; leave conference.url out to ask for a native Meet or Teams link

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.calendarEvents.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `calendar_id` | `string` | Yes | Identifier of the parent calendar. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `title` | `string` | Yes | The title of the event. |
| `body` | `string` | No | The body of the event. |
| `location` | `string` | No | The location of the event. |
| `background_color` | `string` | No | Background color of the calendar in hexadecimal format. For Google we match the closest palette available |
| `transparency` | `opaque \| transparent` | No | The transparency of the event. - `opaque` does block time on the calendar and is equivalent to setting Show me as to Busy in the Calendar UI. |
| `visibility` | `public \| private` | No | The visibility of the event. - `public` is visible to all. - `private` is visible only to the calendar owner. |
| `conference` | `object` | No | A conference to generate or attach to the event. The way the conference is associated with the event may vary depending on the calendar and the selected provider: it can be generated and hosted natively by the provider (e.g. |
| `is_attendees_list_hidden` | `boolean` | No | Is the attendees list hidden for attendees. |
| `attendees` | `object[]` | Yes | — |
| `recurrence` | `string[]` | No | List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as specified in RFC5545. |
| `start` | `object` | Yes | The start date and time of the event. Use date for all day events. |
| `end` | `object` | Yes | The end date and time of the event. Use date for all day events. |
| `notify` | `all \| externalOnly \| none` | No | Only available for google, guests to send updates to: - `all`: Notify all guests. - `externalOnly`: Notify only guests not on the calendar's domain. - `none`: Do not notify any guests. |
| `timezone` | `string` | No | The IANA timezone the event is expressed in (e.g. `Europe/Paris`). Defaults to UTC when omitted. |

> **conference full type**
>
> ```ts theme={null}
> {
>   provider: google_meet | zoom | skype | teams | unknown,
>   conference_id?: string,
>   url?: string
> }
> ```

> **attendees full type**
>
> ```ts theme={null}
> {
>   email: string,
>   type?: required | optional
> }[]
> ```

> **start full type**
>
> ```ts theme={null}
> {
>   type: datetime,
>   date_time: string,
>   timezone?: string
> } | {
>   type: date,
>   date: string,
>   timezone?: string
> }
> ```

> **end full type**
>
> ```ts theme={null}
> {
>   type: datetime,
>   date_time: string,
>   timezone?: string
> } | {
>   type: date,
>   date: string,
>   timezone?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the calendar event. |
| `master_event_id` | `string` | No | If event instance, the ID of the master event. |
| `calendar_id` | `string` | Yes | The ID of the calendar the event belongs to. |
| `ical_uid` | `string` | No | The iCalendar UID (RFC5545 UID) of the event. Unlike `id`, it is shared by every copy of the event across the calendars of its attendees, and stays stable when… |
| `created_at` | `string` | Yes | The date the event was created. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SSZ). |
| `updated_at` | `string` | Yes | The date the event was last updated. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `title` | `string` | Yes | The title of the event. |
| `body` | `string` | No | The body of the event. |
| `location` | `string` | No | The location of the event. |
| `is_cancelled` | `boolean` | Yes | Is the event cancelled. |
| `is_all_day` | `boolean` | Yes | Is the event all day. |
| `is_attendees_list_hidden` | `boolean` | Yes | Is the attendees list hidden for attendees. |
| `attendees` | `object[]` | No | The attendees of the event. |
| `start` | `object` | Yes | The start date and time of the event. |
| `end` | `object` | Yes | The end date and time of the event. |
| `recurrence` | `string[]` | No | List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as specified in RFC5545. |
| `organizer` | `object` | Yes | — |
| `conference` | `object` | No | — |
| `visibility` | `string` | Yes | The visibility of the event. - `public` is visible to all. - `private` is visible only to the calendar owner. |
| `transparency` | `string` | Yes | The transparency of the event. - `opaque` does block time on the calendar and is equivalent to setting Show me as to Busy in the Calendar UI. |
| `event_type` | `string` | Yes | The type of the event (`birthday`, `fromGmail`, `outOfOffice`...) |
| `timezone` | `string` | No | The IANA timezone when start and end share the same timezone (e.g. `Europe/Paris`). Omitted when they differ; use `start.timezone` and `end.timezone` instead. |
| `background_color` | `string` | No | Background color of the calendar in hexadecimal format. |
| `text_color` | `string` | No | Foreground color of the event in hexadecimal format. |
| `specifics` | `any` | No | Object containing provider-specific calendar event data. |

> **attendees full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null,
>   comment?: string | null,
>   is_organizer: boolean,
>   is_self: boolean,
>   is_optional: boolean,
>   is_resource: boolean,
>   type: string,
>   response_status: string
> }[]
> ```

> **start full type**
>
> ```ts theme={null}
> {
>   type?: string | null,
>   date_time?: string | null,
>   timezone?: string | null,
>   date?: string | null
> }
> ```

> **end full type**
>
> ```ts theme={null}
> {
>   type?: string | null,
>   date_time?: string | null,
>   timezone?: string | null,
>   date?: string | null
> }
> ```

> **organizer full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }
> ```

> **conference full type**
>
> ```ts theme={null}
> {
>   provider: string,
>   hosting: string,
>   conference_id?: string | null,
>   url: string
> }
> ```

***

### delete

`calendarEvents.delete`

Delete an event from the account's calendar permanently. To call off a meeting you organize and notify attendees, use calendarEvents.cancel

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

```ts theme={null}
await corsair.unipile.api.calendarEvents.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `calendar_id` | `string` | Yes | Identifier of the parent calendar. |
| `event_id` | `string` | Yes | ID of the event to delete. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### get

`calendarEvents.get`

Get one event with its attendees and their responses (Outlook invitations show only the account's own response)

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.calendarEvents.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `calendar_id` | `string` | Yes | Identifier of the parent calendar. |
| `event_id` | `string` | Yes | Identifier of the event to retrieve |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the calendar event. |
| `master_event_id` | `string` | No | If event instance, the ID of the master event. |
| `calendar_id` | `string` | Yes | The ID of the calendar the event belongs to. |
| `ical_uid` | `string` | No | The iCalendar UID (RFC5545 UID) of the event. Unlike `id`, it is shared by every copy of the event across the calendars of its attendees, and stays stable when… |
| `created_at` | `string` | Yes | The date the event was created. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SSZ). |
| `updated_at` | `string` | Yes | The date the event was last updated. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `title` | `string` | Yes | The title of the event. |
| `body` | `string` | No | The body of the event. |
| `location` | `string` | No | The location of the event. |
| `is_cancelled` | `boolean` | Yes | Is the event cancelled. |
| `is_all_day` | `boolean` | Yes | Is the event all day. |
| `is_attendees_list_hidden` | `boolean` | Yes | Is the attendees list hidden for attendees. |
| `attendees` | `object[]` | No | The attendees of the event. |
| `start` | `object` | Yes | The start date and time of the event. |
| `end` | `object` | Yes | The end date and time of the event. |
| `recurrence` | `string[]` | No | List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as specified in RFC5545. |
| `organizer` | `object` | Yes | — |
| `conference` | `object` | No | — |
| `visibility` | `string` | Yes | The visibility of the event. - `public` is visible to all. - `private` is visible only to the calendar owner. |
| `transparency` | `string` | Yes | The transparency of the event. - `opaque` does block time on the calendar and is equivalent to setting Show me as to Busy in the Calendar UI. |
| `event_type` | `string` | Yes | The type of the event (`birthday`, `fromGmail`, `outOfOffice`...) |
| `timezone` | `string` | No | The IANA timezone when start and end share the same timezone (e.g. `Europe/Paris`). Omitted when they differ; use `start.timezone` and `end.timezone` instead. |
| `background_color` | `string` | No | Background color of the calendar in hexadecimal format. |
| `text_color` | `string` | No | Foreground color of the event in hexadecimal format. |
| `specifics` | `any` | No | Object containing provider-specific calendar event data. |

> **attendees full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null,
>   comment?: string | null,
>   is_organizer: boolean,
>   is_self: boolean,
>   is_optional: boolean,
>   is_resource: boolean,
>   type: string,
>   response_status: string
> }[]
> ```

> **start full type**
>
> ```ts theme={null}
> {
>   type?: string | null,
>   date_time?: string | null,
>   timezone?: string | null,
>   date?: string | null
> }
> ```

> **end full type**
>
> ```ts theme={null}
> {
>   type?: string | null,
>   date_time?: string | null,
>   timezone?: string | null,
>   date?: string | null
> }
> ```

> **organizer full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }
> ```

> **conference full type**
>
> ```ts theme={null}
> {
>   provider: string,
>   hosting: string,
>   conference_id?: string | null,
>   url: string
> }
> ```

***

### list

`calendarEvents.list`

List the events in a calendar between two dates, with paging; cancelled events are included unless is\_cancelled is false. Outlook does not refresh other attendees' responses on invitations

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.calendarEvents.list({ account_id: 'acc_9f2c1d7e', calendar_id: 'primary', start: '2026-11-02T00:00:00Z', end: '2026-11-09T00:00:00Z' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `calendar_id` | `string` | Yes | Identifier of the calendar. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `is_cancelled` | `boolean` | No | — |
| `title` | `string` | No | — |
| `description` | `string` | No | — |
| `ical_uid` | `string` | No | — |
| `location` | `string` | No | — |
| `start` | `string` | No | — |
| `end` | `string` | No | — |
| `busy` | `boolean` | No | — |
| `updated_before` | `string` | No | — |
| `updated_after` | `string` | No | — |
| `attendees` | `string` | No | — |
| `event_type` | `string` | No | — |
| `expand_recurring` | `boolean` | No | — |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   master_event_id?: string | null,
>   calendar_id: string,
>   ical_uid?: string | null,
>   created_at: string,
>   updated_at: string,
>   title: string,
>   body?: string | null,
>   location?: string | null,
>   is_cancelled: boolean,
>   is_all_day: boolean,
>   is_attendees_list_hidden: boolean,
>   attendees?: any[] | null,
>   start: {
>   },
>   end: {
>   },
>   recurrence?: string[] | null,
>   organizer: {
>   },
>   conference?: {
>   } | null,
>   visibility: string,
>   transparency: string,
>   event_type: string,
>   timezone?: string | null,
>   background_color?: string | null,
>   text_color?: string | null,
>   specifics?: any | null
> }[]
> ```

***

### respond

`calendarEvents.respond`

Answer an invitation: yes, maybe or no, with an optional comment. The organizer sees it; on Outlook, declining removes the event

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.calendarEvents.respond({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `calendar_id` | `string` | Yes | Identifier of the parent calendar. |
| `event_id` | `string` | Yes | ID of the event to respond to. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `status` | `yes \| maybe \| no` | Yes | The response of the connected account to the invitation. - `yes` accepts the invitation. - `maybe` accepts the invitation tentatively. - `no` declines the invitation. |
| `comment` | `string` | No | A comment sent to the organizer along with the response. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### restore

`calendarEvents.restore`

Restore an event the account cancelled. Google Calendar only, organizer only, while Google still has it

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.calendarEvents.restore({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `calendar_id` | `string` | Yes | Identifier of the parent calendar. |
| `event_id` | `string` | Yes | ID of the event to restore. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### update

`calendarEvents.update`

Change an event; send only the fields that change. A series ID edits the whole series, an occurrence ID just that one. Attendees may be notified

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.calendarEvents.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `calendar_id` | `string` | Yes | Identifier of the parent calendar. |
| `event_id` | `string` | Yes | ID of the event to update. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `title` | `string` | No | The title of the event. |
| `body` | `string` | No | The body of the event. |
| `location` | `string` | No | The location of the event. |
| `background_color` | `string` | No | Background color of the calendar in hexadecimal format. For Google we match the closest palette available |
| `transparency` | `opaque \| transparent` | No | The transparency of the event. - `opaque` does block time on the calendar and is equivalent to setting Show me as to Busy in the Calendar UI. |
| `visibility` | `public \| private` | No | The visibility of the event. - `public` is visible to all. - `private` is visible only to the calendar owner. |
| `conference` | `object` | No | A conference to generate or attach, or `null` to remove the conference currently on the event. |
| `is_attendees_list_hidden` | `boolean` | No | Is the attendees list hidden for attendees. |
| `attendees` | `object[]` | No | — |
| `recurrence` | `string[]` | No | List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as specified in RFC5545. |
| `start` | `object` | No | The start date and time of the event. |
| `end` | `object` | No | The end date and time of the event. |
| `notify` | `all \| externalOnly \| none` | No | Only available for google, guests to send updates to: - `all`: Notify all guests. - `externalOnly`: Notify only guests not on the calendar's domain. - `none`: Do not notify any guests. |
| `timezone` | `string` | No | The IANA timezone the event is expressed in (e.g. `Europe/Paris`). Defaults to UTC when omitted. |

> **conference full type**
>
> ```ts theme={null}
> {
>   provider: google_meet | zoom | skype | teams | unknown,
>   conference_id?: string,
>   url?: string
> }
> ```

> **attendees full type**
>
> ```ts theme={null}
> {
>   email: string,
>   type?: required | optional
> }[]
> ```

> **start full type**
>
> ```ts theme={null}
> {
>   type: datetime,
>   date_time: string,
>   timezone?: string
> } | {
>   type: date,
>   date: string,
>   timezone?: string
> }
> ```

> **end full type**
>
> ```ts theme={null}
> {
>   type: datetime,
>   date_time: string,
>   timezone?: string
> } | {
>   type: date,
>   date: string,
>   timezone?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the calendar event. |
| `master_event_id` | `string` | No | If event instance, the ID of the master event. |
| `calendar_id` | `string` | Yes | The ID of the calendar the event belongs to. |
| `ical_uid` | `string` | No | The iCalendar UID (RFC5545 UID) of the event. Unlike `id`, it is shared by every copy of the event across the calendars of its attendees, and stays stable when… |
| `created_at` | `string` | Yes | The date the event was created. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SSZ). |
| `updated_at` | `string` | Yes | The date the event was last updated. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `title` | `string` | Yes | The title of the event. |
| `body` | `string` | No | The body of the event. |
| `location` | `string` | No | The location of the event. |
| `is_cancelled` | `boolean` | Yes | Is the event cancelled. |
| `is_all_day` | `boolean` | Yes | Is the event all day. |
| `is_attendees_list_hidden` | `boolean` | Yes | Is the attendees list hidden for attendees. |
| `attendees` | `object[]` | No | The attendees of the event. |
| `start` | `object` | Yes | The start date and time of the event. |
| `end` | `object` | Yes | The end date and time of the event. |
| `recurrence` | `string[]` | No | List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as specified in RFC5545. |
| `organizer` | `object` | Yes | — |
| `conference` | `object` | No | — |
| `visibility` | `string` | Yes | The visibility of the event. - `public` is visible to all. - `private` is visible only to the calendar owner. |
| `transparency` | `string` | Yes | The transparency of the event. - `opaque` does block time on the calendar and is equivalent to setting Show me as to Busy in the Calendar UI. |
| `event_type` | `string` | Yes | The type of the event (`birthday`, `fromGmail`, `outOfOffice`...) |
| `timezone` | `string` | No | The IANA timezone when start and end share the same timezone (e.g. `Europe/Paris`). Omitted when they differ; use `start.timezone` and `end.timezone` instead. |
| `background_color` | `string` | No | Background color of the calendar in hexadecimal format. |
| `text_color` | `string` | No | Foreground color of the event in hexadecimal format. |
| `specifics` | `any` | No | Object containing provider-specific calendar event data. |

> **attendees full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null,
>   comment?: string | null,
>   is_organizer: boolean,
>   is_self: boolean,
>   is_optional: boolean,
>   is_resource: boolean,
>   type: string,
>   response_status: string
> }[]
> ```

> **start full type**
>
> ```ts theme={null}
> {
>   type?: string | null,
>   date_time?: string | null,
>   timezone?: string | null,
>   date?: string | null
> }
> ```

> **end full type**
>
> ```ts theme={null}
> {
>   type?: string | null,
>   date_time?: string | null,
>   timezone?: string | null,
>   date?: string | null
> }
> ```

> **organizer full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }
> ```

> **conference full type**
>
> ```ts theme={null}
> {
>   provider: string,
>   hosting: string,
>   conference_id?: string | null,
>   url: string
> }
> ```

***

## Calendars

### create

`calendars.create`

Create a calendar on the account

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.calendars.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `name` | `string` | Yes | Name of the new calendar |
| `description` | `string` | No | Description of the calendar |
| `background_color` | `string` | No | Background color of the calendar in hexadecimal format. |
| `timezone` | `string` | No | Timezone used in this calendar (IANA, e.g. `Europe/Paris`). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the calendar. |
| `name` | `string` | Yes | Name of the calendar. |
| `description` | `string` | No | Description of the calendar. |
| `is_read_only` | `boolean` | Yes | Indicates if the calendar is read-only or not. |
| `is_owned_by_user` | `boolean` | Yes | Indicates if the user owns this calendar. |
| `is_default` | `boolean` | Yes | Indicates if this is the primary calendar of the user. |
| `background_color` | `string` | Yes | Background color of the calendar in hexadecimal format. |
| `text_color` | `string` | No | Foreground color of the calendar in hexadecimal format. |
| `timezone` | `string` | No | Timezone used in this calendar. |
| `specifics` | `any` | No | Object containing provider-specific calendar data. |

***

### delete

`calendars.delete`

Delete a calendar and permanently delete all its events. The default calendar cannot be deleted

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

```ts theme={null}
await corsair.unipile.api.calendars.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `calendar_id` | `string` | Yes | ID of the calendar to delete. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### get

`calendars.get`

Get one calendar: name, timezone, colour, and whether it is the default or read-only

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.calendars.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `calendar_id` | `string` | Yes | Identifier of the calendar to retrieve |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the calendar. |
| `name` | `string` | Yes | Name of the calendar. |
| `description` | `string` | No | Description of the calendar. |
| `is_read_only` | `boolean` | Yes | Indicates if the calendar is read-only or not. |
| `is_owned_by_user` | `boolean` | Yes | Indicates if the user owns this calendar. |
| `is_default` | `boolean` | Yes | Indicates if this is the primary calendar of the user. |
| `background_color` | `string` | Yes | Background color of the calendar in hexadecimal format. |
| `text_color` | `string` | No | Foreground color of the calendar in hexadecimal format. |
| `timezone` | `string` | No | Timezone used in this calendar. |
| `specifics` | `any` | No | Object containing provider-specific calendar data. |

***

### list

`calendars.list`

List the account's calendars, owned and shared (Google Calendar or Outlook)

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.calendars.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   name: string,
>   description?: string | null,
>   is_read_only: boolean,
>   is_owned_by_user: boolean,
>   is_default: boolean,
>   background_color: string,
>   text_color?: string | null,
>   timezone?: string | null,
>   specifics?: any | null
> }[]
> ```

***

### update

`calendars.update`

Rename or change a calendar

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.calendars.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `calendar_id` | `string` | Yes | ID of the Calendar to update. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `name` | `string` | No | Name of the new calendar |
| `description` | `string` | No | Description of the calendar |
| `background_color` | `string` | No | Background color of the calendar in hexadecimal format. |
| `timezone` | `string` | No | Timezone used in this calendar (IANA, e.g. `Europe/Paris`). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the calendar. |
| `name` | `string` | Yes | Name of the calendar. |
| `description` | `string` | No | Description of the calendar. |
| `is_read_only` | `boolean` | Yes | Indicates if the calendar is read-only or not. |
| `is_owned_by_user` | `boolean` | Yes | Indicates if the user owns this calendar. |
| `is_default` | `boolean` | Yes | Indicates if this is the primary calendar of the user. |
| `background_color` | `string` | Yes | Background color of the calendar in hexadecimal format. |
| `text_color` | `string` | No | Foreground color of the calendar in hexadecimal format. |
| `timezone` | `string` | No | Timezone used in this calendar. |
| `specifics` | `any` | No | Object containing provider-specific calendar data. |

***

## Chats

### addParticipant

`chats.addParticipant`

Add someone to a group chat; they are notified. On WhatsApp, Telegram and Instagram the account needs permission to add members, or the call can succeed without adding anyone

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.chats.addParticipant({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | The ID of the Chat to add the participant to. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `user_id` | `string` | Yes | The ID of the User to add as participant. |

**Output**

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

***

### delete

`chats.delete`

Delete a whole chat. LinkedIn Classic and WhatsApp only; other providers answer 501

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

```ts theme={null}
await corsair.unipile.api.chats.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | ID of the Chat to delete. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### get

`chats.get`

Get one chat on any provider: participants, unread count, last message and whether sending is restricted

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.chats.get({ account_id: 'acc_9f2c1d7e', chat_id: 'chat_5a6b7c' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `chat_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `id` | `string` | Yes | — |
| `name` | `string` | No | — |
| `type` | `string` | No | 1to1, group or channel |
| `provider` | `string` | No | — |
| `created_at` | `string` | No | — |
| `updated_at` | `string` | No | — |
| `last_message_timestamp` | `string` | No | — |
| `unread_count` | `number` | No | — |
| `is_archived` | `boolean` | No | — |
| `is_readonly` | `boolean` | No | — |
| `is_group` | `boolean` | No | — |
| `is_1to1` | `boolean` | No | — |
| `participants_count` | `number` | No | — |
| `restrictions` | `string[]` | No | — |
| `folders` | `string[]` | No | — |
| `user` | `object` | No | — |
| `participants` | `object[]` | No | — |
| `last_message` | `object` | No | — |

> **user full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object?: string | null,
>   type?: string | null,
>   public_identifier?: string | null,
>   display_name?: string | null,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   description?: string | null,
>   specifics?: {
>     location?: string | null,
>     network_distance?: string | null,
>     industry?: string | null,
>     is_following?: boolean | null,
>     followers_count?: number | null,
>     relations_count?: number | null,
>     shared_relations_count?: number | null,
>     is_premium?: boolean | null,
>     is_verified?: boolean | null
>   } | null
> }
> ```

> **participants full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object?: string | null,
>   type?: string | null,
>   public_identifier?: string | null,
>   display_name?: string | null,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   description?: string | null,
>   specifics?: {
>     location?: string | null,
>     network_distance?: string | null,
>     industry?: string | null,
>     is_following?: boolean | null,
>     followers_count?: number | null,
>     relations_count?: number | null,
>     shared_relations_count?: number | null,
>     is_premium?: boolean | null,
>     is_verified?: boolean | null
>   } | null
> }[]
> ```

> **last\_message full type**
>
> ```ts theme={null}
> {
> }
> ```

***

### getPicture

`chats.getPicture`

Download a chat's picture (Telegram only). Returns the type and size only, unless include\_content is set (then base64, up to max\_bytes)

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.chats.getPicture({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `include_content` | `boolean` | No | Return the file itself as base64 in content\_base64. Off by default: only the type and size come back |
| `max_bytes` | `number` | No | Largest file to return with include\_content (default 5 MB); bigger files come back without content |
| `chat_id` | `string` | Yes | — |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `content_type` | `string` | Yes | MIME type Unipile sent |
| `size_bytes` | `number` | Yes | Size of the file in bytes |
| `filename` | `string` | No | File name from Content-Disposition, when sent |
| `content_base64` | `string` | No | The file as base64, only with include\_content |
| `content_omitted` | `string` | No | Why content\_base64 is missing although include\_content was set |

***

### list

`chats.list`

List the account's chats, newest first, filtered by type, date, unread or archived. WhatsApp, Telegram and Instagram; on LinkedIn use inboxes.listChats. WhatsApp and Telegram channels, communities and broadcasts are not returned

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.chats.list({ account_id: 'acc_9f2c1d7e', is_unread: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `type` | `1to1 \| group \| channel` | No | — |
| `before` | `string` | No | Only chats with a last message before this date-time |
| `after` | `string` | No | Only chats with a last message after this date-time |
| `is_archived` | `boolean` | No | — |
| `is_unread` | `boolean` | No | — |
| `offset` | `number` | No | Offset pagination: add the previous limit to get the next page. Use `cursor` instead when the previous page returned next\_cursor |
| `cursor` | `string` | No | next\_cursor from the previous page. Send it alone, without offset |
| `limit` | `number` | No | Page size. Leave unset to use the provider's own page size, which Unipile recommends |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | — |
| `next_cursor` | `string` | No | Pass as cursor to get the next page; absent on the last page |

> **data full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id: string,
>   name?: string | null,
>   type?: string | null,
>   provider?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   last_message_timestamp?: string | null,
>   unread_count?: number | null,
>   is_archived?: boolean | null,
>   is_readonly?: boolean | null,
>   is_group?: boolean | null,
>   is_1to1?: boolean | null,
>   participants_count?: number | null,
>   restrictions?: string[] | null,
>   folders?: string[] | null,
>   user?: {
>     id: string,
>     object?: string | null,
>     type?: string | null,
>     public_identifier?: string | null,
>     display_name?: string | null,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     description?: string | null,
>     specifics?: {
>       location?: string | null,
>       network_distance?: string | null,
>       industry?: string | null,
>       is_following?: boolean | null,
>       followers_count?: number | null,
>       relations_count?: number | null,
>       shared_relations_count?: number | null,
>       is_premium?: boolean | null,
>       is_verified?: boolean | null
>     } | null
>   } | null,
>   participants?: {
>     id: string,
>     object?: string | null,
>     type?: string | null,
>     public_identifier?: string | null,
>     display_name?: string | null,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     description?: string | null,
>     specifics?: {
>       location?: string | null,
>       network_distance?: string | null,
>       industry?: string | null,
>       is_following?: boolean | null,
>       followers_count?: number | null,
>       relations_count?: number | null,
>       shared_relations_count?: number | null,
>       is_premium?: boolean | null,
>       is_verified?: boolean | null
>     } | null
>   }[] | null,
>   last_message?: {
>   } | null
> }[]
> ```

***

### listParticipants

`chats.listParticipants`

List the participants of a group chat (fails on 1-to-1 chats). LinkedIn Classic, WhatsApp, Telegram and Instagram

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.chats.listParticipants({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | ID of the Chat to retrieve participants from. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   is_self: boolean,
>   is_admin: boolean,
>   user: {
>   }
> }[]
> ```

***

### removeParticipant

`chats.removeParticipant`

Remove someone from a group chat, or pass the account's own user ID to leave it (the chat becomes read-only). Non-admins on WhatsApp, Telegram and Instagram can get success without a removal

**Risk:** `destructive`

```ts theme={null}
await corsair.unipile.api.chats.removeParticipant({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | The ID of the Chat to remove the participant from. |
| `user_id` | `string` | Yes | The ID of the User to remove from the chat. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

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

***

### setComposing

`chats.setComposing`

Show the 'typing…' or 'recording' indicator in a chat. LinkedIn Classic, WhatsApp and Telegram (Telegram clears it after about 5 seconds)

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.chats.setComposing({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | ID of the Chat where the composing action is taking place. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `action` | `typing \| recording` | Yes | — |

**Output**

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

***

### start

`chats.start`

Start a chat on WhatsApp, Telegram or Instagram by sending the first message (an array of users\_ids makes a group; an existing 1-to-1 chat just gets the message). On LinkedIn use inboxes.startChat. Never retried after a timeout or 5xx

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.chats.start({ account_id: 'acc_9f2c1d7e', users_ids: 'ACoAAB1cDeFgHiJkLmNoPqRsTuVwXyZ0123456', text: 'Thanks for connecting, Maya!' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `users_ids` | `string \| string[]` | Yes | One user ID (string) starts a 1-to-1 chat; an array starts a group |
| `text` | `string` | Yes | First message. Plain text; Unipile advises against HTML or Markdown |
| `name` | `string` | No | Group name, where allowed |
| `attachments` | `object[]` | No | — |
| `specifics` | `object` | No | — |

> **attachments full type**
>
> ```ts theme={null}
> {
>   filename: string,
>   content: string,
>   content_type: string,
>   send_mode?: file | native
> }[]
> ```

> **specifics full type**
>
> ```ts theme={null}
> {
>   linkedin?: {
>     classic?: {
>       inmail?: boolean,
>       relation_request_id?: string,
>       company_topic?: SERVICE_REQUEST | REQUEST_A_DEMO | SUPPORT | CAREERS | OTHER
>     },
>     sales_navigator?: {
>       subject: string
>     }
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `chat_id` | `string` | Yes | — |
| `message_id` | `string \| string[]` | No | — |

***

### update

`chats.update`

Change a chat: mark it read or unread, archive, mute, rename (groups) or label (WhatsApp Business). Marking read does not mark its messages; Telegram cannot archive

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.chats.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | ID of the Chat to update. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `name` | `string` | No | A custom name for the chat. Some providers allow custom names only on groups. |
| `pin_status` | `boolean` | No | If supported, set to `true` to pin the chat at the top of the list, or `false` to unpin it. |
| `archive_status` | `boolean` | No | If supported, set to `true` to archive the chat, or `false` to move it back to the main inbox. |
| `label` | `string` | No | If supported, associate the chat with the given label. For Whatsapp, this is resolved by label name and created if missing. |
| `muted_until` | `boolean \| string` | No | If supported, the date until which the conversation should be muted. Else `true` to mute the chat for an indefinite time, else `false` to un-mute an already muted chat. |
| `read_status` | `boolean` | No | Set to `true` to mark the chat as read. This is useful when displaying the list of messages in your app. Set to `false` to mark the chat as unread. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The unique identifier of the chat for the provider. |
| `name` | `string` | Yes | The name / title of the chat. If the provider does not provide a name, name is built out of participants usernames. |
| `label` | `string` | No | If supported by the provider, a label associated with the chat. |
| `description` | `string` | No | The description / subject of the chat. |
| `public_picture_url` | `string` | No | Public URL of the chat picture. |
| `private_picture_download_url` | `string` | No | Private URL to download the chat picture. This URL requires authentication. |
| `image_url` | `string` | No | The URL of the chat image. Use public\_picture\_url or private\_picture\_download\_url instead. |
| `created_at` | `string` | No | The creation date of the chat. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `updated_at` | `string` | No | The last update date of the chat. Use ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). Some providers update this field on new messages. |
| `last_message_timestamp` | `string` | No | The timestamp of the last message in the chat. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `muted_until` | `string \| boolean` | Yes | The date until the chat is muted. Use ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). Is `true` if muted indefinitely. |
| `creator_id` | `string` | No | The ID of the user who created the chat. |
| `user_id` | `string` | No | The ID of the other participant in the chat if 1to1 chat. |
| `is_group` | `boolean` | Yes | Is the chat a group chat. |
| `is_1to1` | `boolean` | Yes | Is the chat a 1to1 chat. |
| `is_channel` | `boolean` | Yes | Is the chat a channel chat. |
| `type` | `string` | Yes | The type of the chat. - `group` is a group chat. - `1to1` is a 1to1 chat. - `channel` is a channel chat. |
| `is_pinned` | `boolean` | Yes | Is the chat pinned at the top of the list, if supported by the provider. |
| `is_readonly` | `boolean` | Yes | Is the chat read-only for the current user. Trying to send messages in read-only chats will fail. |
| `is_archived` | `boolean` | Yes | Is the chat archived. Archived chats are usually hidden from the chat list. |
| `folders` | `string[]` | Yes | A list of folders the chat belongs to. |
| `participants_count` | `number` | No | The number of participants in the chat if the chat is a group. |
| `unread_count` | `number` | Yes | The number of unread messages in the chat. `0` if the chat is read, `-1` if the chat was manually marked as unread by the user and does not have any unread mess… |
| `restrictions` | `string[]` | No | List of action restrictions of the chat. - `send_message` is the permission to send messages. |
| `participants` | `object[]` | No | List of participants in the chat if group chat. |
| `last_message` | `object` | No | The last message in the chat. |
| `user` | `object` | No | The other participant if 1to1 chat. |
| `provider` | `string` | Yes | The provider's of the Account. - `mock` is mock. - `whatsapp` is WhatsApp. - `linkedin` is LinkedIn. - `instagram` is Instagram. - `google` is Google. |
| `specifics` | `any` | No | — |

> **participants full type**
>
> ```ts theme={null}
> {
>   object: string,
>   user: {
>   },
>   is_self: boolean,
>   is_admin: boolean
> }[]
> ```

> **last\_message full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   text?: string | null,
>   sender_display_name?: string | null,
>   is_sender?: boolean | null,
>   sender_id?: string | null,
>   chat_id?: string | null,
>   timestamp?: string | null,
>   is_hidden?: boolean | null,
>   is_seen?: boolean | null,
>   is_delivered?: boolean | null,
>   is_deleted?: boolean | null,
>   is_edited?: boolean | null,
>   is_pinned?: boolean | null,
>   is_event?: boolean | null,
>   is_mentionned?: boolean | null,
>   view_mode?: string | null,
>   event_type?: number | null,
>   event_metadata?: {
>     user_id?: string | null,
>     user_name?: string | null,
>     reason?: string | null,
>     title?: string | null,
>     description?: string | null,
>     call_id?: string | null,
>     is_video?: boolean | null,
>     link?: string | null,
>     start?: string | null,
>     end?: string | null,
>     duration?: number | null,
>     message_id?: string | null,
>     is_pin?: boolean | null,
>     subject?: string | null,
>     reaction?: string | null
>   } | null,
>   content_relation?: {
>     type: string,
>     attachment_id?: string | null
>   } | null,
>   reactions_counter?: any[] | null,
>   sender?: {
>     id: string,
>     object: string,
>     type: string,
>     public_identifier?: string | null,
>     display_name: string,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     private_picture_download_url?: string | null,
>     description?: string | null,
>     specifics?: any | null
>   } | null,
>   provider?: string | null,
>   attachments?: any[] | null,
>   hyperlinks?: any[] | null,
>   quoted?: {
>     object: string,
>     id: string,
>     text?: string | null,
>     specifics?: any | null,
>     attachments: any[],
>     sender?: {
>     } | null
>   } | null,
>   forwarded?: {
>     text?: string | null,
>     specifics?: any | null,
>     attachments: any[],
>     sender?: {
>     } | null,
>     object: string
>   } | null,
>   specifics?: any | null
> }
> ```

> **user full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: any | null
> }
> ```

***

## Contacts

### list

`contacts.list`

List the account's contacts on WhatsApp, Gmail or Outlook (not Telegram or IMAP), with paging. A contact does not mean a chat exists

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.contacts.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   user?: {
>   } | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   picture_url?: string | null,
>   first_name?: string | null,
>   middle_name?: string | null,
>   last_name?: string | null,
>   display_name?: string | null,
>   suffix?: string | null,
>   birth_date?: string | null,
>   company_name?: string | null,
>   job_title?: string | null,
>   manager_name?: string | null,
>   office_location?: string | null,
>   notes?: string | null,
>   emails?: string[] | null,
>   phone_numbers?: string[] | null,
>   social_handles?: {
>   } | null,
>   addresses?: any[] | null,
>   websites?: string[] | null,
>   groups?: any[] | null
> }[]
> ```

***

## Drafts

### create

`drafts.create`

Save an email draft without sending it; reply drafts use reply\_to\_message\_id. Outlook attachments must be under 3 MB each

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.drafts.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `html` | `string` | No | The HTML content of the draft. Required for tracking. |
| `plain_text` | `string` | No | The plain text content of the draft. |
| `subject` | `string` | No | Subject of the draft. |
| `from` | `object` | No | — |
| `to` | `object[]` | Yes | List of attendees to set in `to` header. An empty list clears the header. |
| `cc` | `object[]` | No | List of attendees to set in `cc` header. An empty list clears the header. |
| `bcc` | `object[]` | No | List of attendees to set in `bcc` header. An empty list clears the header. |
| `reply_to` | `object[]` | No | List of attendees to set in the standard `Reply-To` header. Recipients answering the email will reply to these addresses instead of `from`. To reply inside an existing conversation, use `reply_to_message_id` instead. |
| `reply_to_message_id` | `string` | No | The ID of the email message that you're replying to. For Gmail and Outlook, use the provider message ID. For IMAP, use the RFC822 Message-ID header. |
| `attachments` | `object[]` | No | The list of file attachments to the draft. For Outlook, each attachment must be smaller than 3 MB. |
| `tracking_options` | `object` | No | Configuration of tracking for this email. |

> **from full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }
> ```

> **to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }[]
> ```

> **cc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }[]
> ```

> **bcc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }[]
> ```

> **reply\_to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }[]
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   content: string,
>   content_type: string,
>   filename: string,
>   metadata?: {
>     duration?: number
>   },
>   content_id?: string
> }[]
> ```

> **tracking\_options full type**
>
> ```ts theme={null}
> {
>   opens?: boolean,
>   clicks?: boolean,
>   label?: string,
>   custom_domain?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the draft. |
| `thread_id` | `string` | No | The ID of the thread the draft belongs to. For IMAP drafts, this field is present only when the server provides a native thread ID. |
| `body` | `string` | Yes | The body of the draft. |
| `snippet` | `string` | Yes | The snippet (preview) of the draft. |
| `subject` | `string` | Yes | The subject of the draft. |
| `from` | `object[]` | No | The list of attendees that the email should be sent from. |
| `to` | `object[]` | No | The list of attendees that the email should be sent to. |
| `cc` | `object[]` | No | The list of attendees that the email should be CC'd to. |
| `bcc` | `object[]` | No | The list of attendees that the email should be BCC'd to. |
| `reply_to` | `object[]` | No | The list of attendees that the replies should be sent to. |
| `attachments` | `object[]` | Yes | The attachments of the draft. |
| `folders` | `string[]` | Yes | The folder the draft is in. For Gmail, the labels assigned to the draft. |
| `categories` | `string[]` | No | List of categories assigned to the draft. |

> **from full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **cc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **bcc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **reply\_to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   file_size?: number | null,
>   is_inline?: boolean | null,
>   content_id?: string | null,
>   is_unavailable?: boolean | null,
>   mimetype?: string | null,
>   url?: string | null,
>   url_expires_at?: string | null,
>   content?: string | null,
>   type?: string | null,
>   duration?: number | null,
>   voice_note?: boolean | null,
>   size?: {
>   } | null,
>   sticker?: boolean | null,
>   gif?: boolean | null,
>   filename?: string | null,
>   media_type?: string | null,
>   author?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   organization?: string | null,
>   phones?: any[] | null,
>   emails?: any[] | null
> }[]
> ```

***

### delete

`drafts.delete`

Delete an email draft permanently

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

```ts theme={null}
await corsair.unipile.api.drafts.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `draft_id` | `string` | Yes | — |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### get

`drafts.get`

Get one email draft with its recipients, subject, body and attachment metadata

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.drafts.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `draft_id` | `string` | Yes | — |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the draft. |
| `thread_id` | `string` | No | The ID of the thread the draft belongs to. For IMAP drafts, this field is present only when the server provides a native thread ID. |
| `body` | `string` | Yes | The body of the draft. |
| `snippet` | `string` | Yes | The snippet (preview) of the draft. |
| `subject` | `string` | Yes | The subject of the draft. |
| `from` | `object[]` | No | The list of attendees that the email should be sent from. |
| `to` | `object[]` | No | The list of attendees that the email should be sent to. |
| `cc` | `object[]` | No | The list of attendees that the email should be CC'd to. |
| `bcc` | `object[]` | No | The list of attendees that the email should be BCC'd to. |
| `reply_to` | `object[]` | No | The list of attendees that the replies should be sent to. |
| `attachments` | `object[]` | Yes | The attachments of the draft. |
| `folders` | `string[]` | Yes | The folder the draft is in. For Gmail, the labels assigned to the draft. |
| `categories` | `string[]` | No | List of categories assigned to the draft. |

> **from full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **cc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **bcc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **reply\_to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   file_size?: number | null,
>   is_inline?: boolean | null,
>   content_id?: string | null,
>   is_unavailable?: boolean | null,
>   mimetype?: string | null,
>   url?: string | null,
>   url_expires_at?: string | null,
>   content?: string | null,
>   type?: string | null,
>   duration?: number | null,
>   voice_note?: boolean | null,
>   size?: {
>   } | null,
>   sticker?: boolean | null,
>   gif?: boolean | null,
>   filename?: string | null,
>   media_type?: string | null,
>   author?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   organization?: string | null,
>   phones?: any[] | null,
>   emails?: any[] | null
> }[]
> ```

***

### list

`drafts.list`

List email drafts, newest first (Gmail and Outlook; IMAP answers 501)

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.drafts.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `to` | `string` | No | — |
| `from` | `string` | No | — |
| `any_email` | `string` | No | — |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   thread_id?: string | null,
>   body: string,
>   snippet: string,
>   subject: string,
>   from?: any[] | null,
>   to?: any[] | null,
>   cc?: any[] | null,
>   bcc?: any[] | null,
>   reply_to?: any[] | null,
>   attachments: any[],
>   folders: string[],
>   categories?: string[] | null
> }[]
> ```

***

### send

`drafts.send`

Send an existing draft; the draft is deleted afterwards. Never retried after a timeout or 5xx

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.drafts.send({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `draft_id` | `string` | Yes | ID of the draft to send. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the email. |
| `message_id` | `string` | No | The Message-ID header value of the email. Use `id` in Unipile requests. May be absent when the header could not be retrieved after sending (the email has been s… |

***

### update

`drafts.update`

Change an email draft; fields left out stay, but attachments replaces the whole list. Outlook attachments must be under 3 MB each

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.drafts.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `draft_id` | `string` | Yes | — |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `html` | `string` | No | The HTML content of the draft. Required for tracking. |
| `plain_text` | `string` | No | The plain text content of the draft. |
| `subject` | `string` | No | Subject of the draft. |
| `from` | `object` | No | — |
| `to` | `object[]` | No | List of attendees to set in `to` header. |
| `cc` | `object[]` | No | List of attendees to set in `cc` header. |
| `bcc` | `object[]` | No | List of attendees to set in `bcc` header. |
| `reply_to` | `object[]` | No | List of attendees to set in the standard `Reply-To` header. Recipients answering the email will reply to these addresses instead of `from`. To reply inside an existing conversation, use `reply_to_message_id` instead. |
| `reply_to_message_id` | `string` | No | The ID of the email message that you're replying to. For Gmail, use the provider message ID. For IMAP, use the RFC822 Message-ID header. |
| `attachments` | `object[]` | No | The list of file attachments to the draft. Any attachment already existing will be removed and replaced by the new ones. For Outlook, each attachment must be smaller than 3 MB. |
| `tracking_options` | `object` | No | Configuration of tracking for this email. |
| `specifics` | `object` | No | — |

> **from full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }
> ```

> **to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }[]
> ```

> **cc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }[]
> ```

> **bcc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }[]
> ```

> **reply\_to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }[]
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   content: string,
>   content_type: string,
>   filename: string,
>   metadata?: {
>     duration?: number
>   },
>   content_id?: string
> }[]
> ```

> **tracking\_options full type**
>
> ```ts theme={null}
> {
>   opens?: boolean,
>   clicks?: boolean,
>   label?: string,
>   custom_domain?: string
> }
> ```

> **specifics full type**
>
> ```ts theme={null}
> {
>   outlook?: {
>     categories?: string[]
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the draft. |
| `thread_id` | `string` | No | The ID of the thread the draft belongs to. For IMAP drafts, this field is present only when the server provides a native thread ID. |
| `body` | `string` | Yes | The body of the draft. |
| `snippet` | `string` | Yes | The snippet (preview) of the draft. |
| `subject` | `string` | Yes | The subject of the draft. |
| `from` | `object[]` | No | The list of attendees that the email should be sent from. |
| `to` | `object[]` | No | The list of attendees that the email should be sent to. |
| `cc` | `object[]` | No | The list of attendees that the email should be CC'd to. |
| `bcc` | `object[]` | No | The list of attendees that the email should be BCC'd to. |
| `reply_to` | `object[]` | No | The list of attendees that the replies should be sent to. |
| `attachments` | `object[]` | Yes | The attachments of the draft. |
| `folders` | `string[]` | Yes | The folder the draft is in. For Gmail, the labels assigned to the draft. |
| `categories` | `string[]` | No | List of categories assigned to the draft. |

> **from full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **cc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **bcc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **reply\_to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   file_size?: number | null,
>   is_inline?: boolean | null,
>   content_id?: string | null,
>   is_unavailable?: boolean | null,
>   mimetype?: string | null,
>   url?: string | null,
>   url_expires_at?: string | null,
>   content?: string | null,
>   type?: string | null,
>   duration?: number | null,
>   voice_note?: boolean | null,
>   size?: {
>   } | null,
>   sticker?: boolean | null,
>   gif?: boolean | null,
>   filename?: string | null,
>   media_type?: string | null,
>   author?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   organization?: string | null,
>   phones?: any[] | null,
>   emails?: any[] | null
> }[]
> ```

***

## Emails

### get

`emails.get`

Get one email: headers, sender and recipients, body, folders or labels, and attachment metadata (download with emails.getAttachment)

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.emails.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_id` | `string` | Yes | ID of the Email to retrieve. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `meta_only` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the email. |
| `message_id` | `string` | Yes | The Message-ID header value of the email. Use `id` in Unipile requests. |
| `thread_id` | `string` | No | The thread identifier. For IMAP, Unipile uses the server-provided thread ID when available. |
| `body` | `string` | Yes | The complete body of the email: HTML when available, otherwise plain text. An empty string when the email has no body or meta\_only=true. |
| `body_plain` | `string` | Yes | The complete plain-text body of the email. Uses the original plain-text version when available, otherwise text converted from HTML. |
| `snippet` | `string` | Yes | A short preview of the email, not its complete plain-text body. Use body\_plain for the full text. |
| `subject` | `string` | Yes | The subject of the email. |
| `headers` | `object[]` | Yes | List of headers. A single email can sometimes have multiple headers with the same key name. |
| `from` | `object[]` | No | The list of attendees that the email was sent from. |
| `to` | `object[]` | No | The list of attendees that the email was sent to. |
| `cc` | `object[]` | Yes | The list of attendees that the email was CC'd to. An empty array when none are available. |
| `bcc` | `object[]` | Yes | The list of attendees that the email was BCC'd to. An empty array when none are available. |
| `reply_to` | `object[]` | Yes | The list of attendees that the replies should be sent to. An empty array when none are available. |
| `date` | `string` | Yes | The date the email was sent. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `attachments` | `object[]` | Yes | The attachments of the email. |
| `folders` | `string[]` | Yes | The IDs of folders the email is in. For Gmail, the IDs of labels assigned to the email, excluding the UNREAD system label, which is exposed through is\_unread in… |
| `categories` | `string[]` | No | List of categories assigned to the email. |
| `is_unread` | `boolean` | Yes | Is the email unread. For Gmail, this reflects the UNREAD system label. |

> **headers full type**
>
> ```ts theme={null}
> {
>   name: string,
>   value: string
> }[]
> ```

> **from full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **cc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **bcc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **reply\_to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   file_size?: number | null,
>   is_inline?: boolean | null,
>   content_id?: string | null,
>   is_unavailable?: boolean | null,
>   mimetype?: string | null,
>   url?: string | null,
>   url_expires_at?: string | null,
>   content?: string | null,
>   type?: string | null,
>   duration?: number | null,
>   voice_note?: boolean | null,
>   size?: {
>   } | null,
>   sticker?: boolean | null,
>   gif?: boolean | null,
>   filename?: string | null,
>   media_type?: string | null,
>   author?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   organization?: string | null,
>   phones?: any[] | null,
>   emails?: any[] | null
> }[]
> ```

***

### getAttachment

`emails.getAttachment`

Download an email attachment. Returns the type and size only, unless include\_content is set (then base64, up to max\_bytes)

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.emails.getAttachment({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `include_content` | `boolean` | No | Return the file itself as base64 in content\_base64. Off by default: only the type and size come back |
| `max_bytes` | `number` | No | Largest file to return with include\_content (default 5 MB); bigger files come back without content |
| `email_id` | `string` | Yes | — |
| `attachment_id` | `string` | Yes | — |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `content_type` | `string` | Yes | MIME type Unipile sent |
| `size_bytes` | `number` | Yes | Size of the file in bytes |
| `filename` | `string` | No | File name from Content-Disposition, when sent |
| `content_base64` | `string` | No | The file as base64, only with include\_content |
| `content_omitted` | `string` | No | Why content\_base64 is missing although include\_content was set |

***

### getThread

`emails.getThread`

Get a whole email conversation by the email's thread\_id (not its id). IMAP threads are inferred from headers and can be incomplete

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.emails.getThread({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `thread_id` | `string` | Yes | ID of the thread to retrieve. For IMAP, use the thread\_id returned by an email; results based on header-derived IDs may be incomplete. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `meta_only` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the thread. |
| `emails` | `object[]` | Yes | — |

> **emails full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   message_id: string,
>   thread_id?: string | null,
>   body: string,
>   body_plain: string,
>   snippet: string,
>   subject: string,
>   headers: any[],
>   from?: any[] | null,
>   to?: any[] | null,
>   cc: any[],
>   bcc: any[],
>   reply_to: any[],
>   date: string,
>   attachments: any[],
>   folders: string[],
>   categories?: string[] | null,
>   is_unread: boolean
> }[]
> ```

***

### list

`emails.list`

List emails across folders, newest first, with filters (folder, from, to, date, text) and cursor paging; meta\_only skips bodies. Gmail and Outlook; IMAP only with Initial Sync, otherwise use emails.listInFolder

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.emails.list({ account_id: 'acc_9f2c1d7e', limit: 20 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `q` | `string` | No | — |
| `meta_only` | `boolean` | No | — |
| `to` | `string` | No | — |
| `from` | `string` | No | — |
| `any_email` | `string` | No | — |
| `has_attachment` | `boolean` | No | — |
| `is_starred` | `boolean` | No | — |
| `is_unread` | `boolean` | No | — |
| `before` | `string` | No | — |
| `exclude_folder` | `string` | No | — |
| `after` | `string` | No | — |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   message_id: string,
>   thread_id?: string | null,
>   body: string,
>   body_plain: string,
>   snippet: string,
>   subject: string,
>   headers: any[],
>   from?: any[] | null,
>   to?: any[] | null,
>   cc: any[],
>   bcc: any[],
>   reply_to: any[],
>   date: string,
>   attachments: any[],
>   folders: string[],
>   categories?: string[] | null,
>   is_unread: boolean
> }[]
> ```

***

### listInFolder

`emails.listInFolder`

List the emails in one folder or Gmail label (folder\_id from folders.list), newest first. Works on IMAP without Initial Sync

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.emails.listInFolder({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `folder_id` | `string` | Yes | ID of the Folder to retrieve emails from. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `q` | `string` | No | — |
| `meta_only` | `boolean` | No | — |
| `to` | `string` | No | — |
| `from` | `string` | No | — |
| `any_email` | `string` | No | — |
| `has_attachment` | `boolean` | No | — |
| `is_starred` | `boolean` | No | — |
| `is_unread` | `boolean` | No | — |
| `before` | `string` | No | — |
| `exclude_folder` | `string` | No | — |
| `after` | `string` | No | — |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   message_id: string,
>   thread_id?: string | null,
>   body: string,
>   body_plain: string,
>   snippet: string,
>   subject: string,
>   headers: any[],
>   from?: any[] | null,
>   to?: any[] | null,
>   cc: any[],
>   bcc: any[],
>   reply_to: any[],
>   date: string,
>   attachments: any[],
>   folders: string[],
>   categories?: string[] | null,
>   is_unread: boolean
> }[]
> ```

***

### listSenders

`emails.listSenders`

List the addresses the account can send from: the main address plus aliases (Gmail; Outlook on Microsoft 365 or Exchange)

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.emails.listSenders({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   email: string,
>   display_name?: string | null,
>   is_primary: boolean,
>   is_default?: boolean | null,
>   verification_status: string,
>   signature?: string | null
> }[]
> ```

***

### markRead

`emails.markRead`

Mark an email as read for the account (does not trigger the sender's tracking pixel)

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.emails.markRead({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_id` | `string` | Yes | ID of the Email to mark as read. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

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

***

### markUnread

`emails.markUnread`

Mark an email as unread

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.emails.markUnread({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_id` | `string` | Yes | ID of the Email to mark as unread. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

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

***

### modify

`emails.modify`

Move an email or set its labels: folders\_ids replaces them all (on Gmail list every label to keep; Outlook allows one folder). Archive, junk or flag by moving to the folder with that role

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.emails.modify({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_id` | `string` | Yes | ID of the Email to modify. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `folders_ids` | `string[]` | No | The ID(s) of the folder(s) to apply, overwriting all folders previously associated with the Email. Outlook emails can be in a single folder only. Google allows a single email to appear in multiple folders. |
| `specifics` | `object` | No | — |

> **specifics full type**
>
> ```ts theme={null}
> {
>   outlook?: {
>     categories?: string[]
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the email. |
| `message_id` | `string` | Yes | The Message-ID header value of the email. Use `id` in Unipile requests. |
| `thread_id` | `string` | No | The thread identifier. For IMAP, Unipile uses the server-provided thread ID when available. |
| `body` | `string` | Yes | The complete body of the email: HTML when available, otherwise plain text. An empty string when the email has no body or meta\_only=true. |
| `body_plain` | `string` | Yes | The complete plain-text body of the email. Uses the original plain-text version when available, otherwise text converted from HTML. |
| `snippet` | `string` | Yes | A short preview of the email, not its complete plain-text body. Use body\_plain for the full text. |
| `subject` | `string` | Yes | The subject of the email. |
| `headers` | `object[]` | Yes | List of headers. A single email can sometimes have multiple headers with the same key name. |
| `from` | `object[]` | No | The list of attendees that the email was sent from. |
| `to` | `object[]` | No | The list of attendees that the email was sent to. |
| `cc` | `object[]` | Yes | The list of attendees that the email was CC'd to. An empty array when none are available. |
| `bcc` | `object[]` | Yes | The list of attendees that the email was BCC'd to. An empty array when none are available. |
| `reply_to` | `object[]` | Yes | The list of attendees that the replies should be sent to. An empty array when none are available. |
| `date` | `string` | Yes | The date the email was sent. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `attachments` | `object[]` | Yes | The attachments of the email. |
| `folders` | `string[]` | Yes | The IDs of folders the email is in. For Gmail, the IDs of labels assigned to the email, excluding the UNREAD system label, which is exposed through is\_unread in… |
| `categories` | `string[]` | No | List of categories assigned to the email. |
| `is_unread` | `boolean` | Yes | Is the email unread. For Gmail, this reflects the UNREAD system label. |

> **headers full type**
>
> ```ts theme={null}
> {
>   name: string,
>   value: string
> }[]
> ```

> **from full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **cc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **bcc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **reply\_to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string | null
> }[]
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   file_size?: number | null,
>   is_inline?: boolean | null,
>   content_id?: string | null,
>   is_unavailable?: boolean | null,
>   mimetype?: string | null,
>   url?: string | null,
>   url_expires_at?: string | null,
>   content?: string | null,
>   type?: string | null,
>   duration?: number | null,
>   voice_note?: boolean | null,
>   size?: {
>   } | null,
>   sticker?: boolean | null,
>   gif?: boolean | null,
>   filename?: string | null,
>   media_type?: string | null,
>   author?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   organization?: string | null,
>   phones?: any[] | null,
>   emails?: any[] | null
> }[]
> ```

***

### send

`emails.send`

Send an email (from must be one of emails.listSenders; reply in-thread with reply\_to\_message\_id), with base64 attachments and optional open/click tracking. Gmail advises 50-100 a day. Never retried after a timeout or 5xx

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.emails.send({ account_id: 'acc_9f2c1d7e', to: [{ email: 'maya@example.com', display_name: 'Maya Ruiz' }], subject: 'Following up', plain_text: 'Does Tuesday at 10 work?' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `html` | `string` | No | The HTML content of the email. Required for tracking. |
| `plain_text` | `string` | No | The plain text content of the email. |
| `subject` | `string` | No | Subject of the email. |
| `from` | `object` | No | — |
| `to` | `object[]` | Yes | List of attendees to set in `to` header. |
| `cc` | `object[]` | No | List of attendees to set in `cc` header. |
| `bcc` | `object[]` | No | List of attendees to set in `bcc` header. |
| `reply_to` | `object[]` | No | List of attendees to set in the standard `Reply-To` header. Recipients answering the email will reply to these addresses instead of `from`. To reply inside an existing conversation, use `reply_to_message_id` instead. |
| `reply_to_message_id` | `string` | No | The ID of the email message that you're replying to. For Gmail and Outlook, this is the provider ID for the email message that you're replying to. |
| `attachments` | `object[]` | No | The list of file attachments to the email. |
| `custom_headers` | `object[]` | No | An array of custom headers to add to the email. Each header overrides any existing header with the same name (case-insensitive), including headers set by other fields such as `to`, `cc`, `bcc`, `from`, `subject`, or `reply_to`. |
| `tracking_options` | `object` | No | Configuration of tracking for this email. |

> **from full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }
> ```

> **to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }[]
> ```

> **cc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }[]
> ```

> **bcc full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }[]
> ```

> **reply\_to full type**
>
> ```ts theme={null}
> {
>   email: string,
>   display_name?: string
> }[]
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   content: string,
>   content_type: string,
>   filename: string,
>   metadata?: {
>     duration?: number
>   },
>   content_id?: string
> }[]
> ```

> **custom\_headers full type**
>
> ```ts theme={null}
> {
>   name: string,
>   value: string
> }[]
> ```

> **tracking\_options full type**
>
> ```ts theme={null}
> {
>   opens?: boolean,
>   clicks?: boolean,
>   label?: string,
>   custom_domain?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the email. |
| `message_id` | `string` | No | The Message-ID header value of the email. Use `id` in Unipile requests. May be absent when the header could not be retrieved after sending (the email has been s… |

***

### trash

`emails.trash`

Move an email to the provider's trash. Permanent deletion is not available

**Risk:** `destructive`

```ts theme={null}
await corsair.unipile.api.emails.trash({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email_id` | `string` | Yes | ID of the Email to trash. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

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

***

## Folders

### create

`folders.create`

Create an email folder or Gmail label. parent\_id (sub-folders) is Outlook only; colors are Gmail only

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.folders.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `name` | `string` | Yes | Name of the folder. For Gmail, name of the label. |
| `parent_id` | `string` | No | (Outlook only) ID of the parent folder. |
| `text_color` | `string` | No | (Gmail only) Hexadecimal color code for the text of the label. |
| `background_color` | `string` | No | (Gmail only) Hexadecimal color code for the background of the label. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the folder for the provider. |
| `name` | `string` | Yes | The name of the folder. |
| `role` | `string` | No | The folder role represents a supported special-use purpose (based on RFC special-use attributes where applicable); it does not indicate whether the folder is sy… |
| `total_count` | `number` | Yes | The total number of emails in the folder. For Gmail, the total number of emails assigned with this label. |
| `unread_count` | `number` | Yes | The number of unread emails in the folder. For Gmail, the number of unread emails assigned with this label. |
| `background_color` | `string` | No | (Gmail Only) The background color of the folder. |
| `text_color` | `string` | No | (Gmail Only) The text color of the folder. |
| `is_system` | `boolean` | No | (Gmail Only) If `true`, the label is created by Google. If `false`, the label was created by the user. |
| `parent_id` | `string` | No | (Outlook only) The ID of the parent folder. |

***

### delete

`folders.delete`

Delete an email folder or label. Gmail keeps the emails (only the label goes); Outlook and IMAP permanently delete every email in the folder

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

```ts theme={null}
await corsair.unipile.api.folders.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `folder_id` | `string` | Yes | ID of the Folder / Label to delete. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### get

`folders.get`

Get one email folder or label by its provider ID from folders.list

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.folders.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `folder_id` | `string` | Yes | ID of the Folder / Label to retrieve. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the folder for the provider. |
| `name` | `string` | Yes | The name of the folder. |
| `role` | `string` | No | The folder role represents a supported special-use purpose (based on RFC special-use attributes where applicable); it does not indicate whether the folder is sy… |
| `total_count` | `number` | Yes | The total number of emails in the folder. For Gmail, the total number of emails assigned with this label. |
| `unread_count` | `number` | Yes | The number of unread emails in the folder. For Gmail, the number of unread emails assigned with this label. |
| `background_color` | `string` | No | (Gmail Only) The background color of the folder. |
| `text_color` | `string` | No | (Gmail Only) The text color of the folder. |
| `is_system` | `boolean` | No | (Gmail Only) If `true`, the label is created by Google. If `false`, the label was created by the user. |
| `parent_id` | `string` | No | (Outlook only) The ID of the parent folder. |

***

### list

`folders.list`

List email folders (Outlook, IMAP) or labels (Gmail) with their role (INBOX, SENT, TRASH, ARCHIVE, JUNK…) and counts, with paging

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.folders.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   name: string,
>   role?: string | null,
>   total_count: number,
>   unread_count: number,
>   background_color?: string | null,
>   text_color?: string | null,
>   is_system?: boolean | null,
>   parent_id?: string | null
> }[]
> ```

***

### update

`folders.update`

Rename or change an email folder or label; colors are Gmail only, parent\_id Outlook only

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.folders.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `folder_id` | `string` | Yes | ID of the Folder / Label to update. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `name` | `string` | No | Name of the folder. For Gmail, name of the label. |
| `parent_id` | `string` | No | (Outlook only) ID of the parent folder. |
| `text_color` | `string` | No | (Gmail only) Hexadecimal color code for the text of the label. |
| `background_color` | `string` | No | (Gmail only) Hexadecimal color code for the background of the label. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the folder for the provider. |
| `name` | `string` | Yes | The name of the folder. |
| `role` | `string` | No | The folder role represents a supported special-use purpose (based on RFC special-use attributes where applicable); it does not indicate whether the folder is sy… |
| `total_count` | `number` | Yes | The total number of emails in the folder. For Gmail, the total number of emails assigned with this label. |
| `unread_count` | `number` | Yes | The number of unread emails in the folder. For Gmail, the number of unread emails assigned with this label. |
| `background_color` | `string` | No | (Gmail Only) The background color of the folder. |
| `text_color` | `string` | No | (Gmail Only) The text color of the folder. |
| `is_system` | `boolean` | No | (Gmail Only) If `true`, the label is created by Google. If `false`, the label was created by the user. |
| `parent_id` | `string` | No | (Outlook only) The ID of the parent folder. |

***

## Inboxes

### list

`inboxes.list`

List a LinkedIn account's inboxes (Classic, Sales Navigator, Recruiter, company pages). Only a product's primary inbox (e.g. CLASSIC\_PRIMARY) can start chats

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.inboxes.list({ account_id: 'acc_9f2c1d7e' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   description?: string | null,
>   disabled: boolean
> }[]
> ```

***

### listChats

`inboxes.listChats`

List the chats in one LinkedIn inbox, newest first. This is how LinkedIn chats are listed (chats.list covers the other providers); Classic and Sales Navigator page by offset, Recruiter by cursor

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.inboxes.listChats({ account_id: 'acc_9f2c1d7e', inbox_id: 'CLASSIC_PRIMARY' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `inbox_id` | `string` | Yes | ID of the Inbox to retrieve Chats from. Use List all Inboxes to get the ID of an inbox. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |
| `type` | `1to1 \| group \| channel` | No | — |
| `before` | `string` | No | — |
| `after` | `string` | No | — |
| `is_archived` | `boolean` | No | — |
| `is_unread` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   name: string,
>   label?: string | null,
>   description?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   image_url?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   last_message_timestamp?: string | null,
>   muted_until: string | boolean,
>   creator_id?: string | null,
>   user_id?: string | null,
>   is_group: boolean,
>   is_1to1: boolean,
>   is_channel: boolean,
>   type: string,
>   is_pinned: boolean,
>   is_readonly: boolean,
>   is_archived: boolean,
>   folders: string[],
>   participants_count?: number | null,
>   unread_count: number,
>   restrictions?: string[] | null,
>   last_message?: {
>   } | null,
>   provider: string,
>   specifics?: any | null,
>   user?: {
>   } | null,
>   participants?: any[] | null
> }[]
> ```

***

### startChat

`inboxes.startChat`

Start a LinkedIn chat from a primary inbox (e.g. CLASSIC\_PRIMARY) by sending the first message; an existing 1-to-1 chat just gets it. InMail spends credits; Sales Navigator needs a subject. Never retried after a timeout or 5xx

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.inboxes.startChat({ account_id: 'acc_9f2c1d7e', inbox_id: 'CLASSIC_PRIMARY', users_ids: ['ACoAAB1cDeFgHiJkLmNoPqRsTuVwXyZ0123456'], text: 'Thanks for connecting, Maya!' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `inbox_id` | `string` | Yes | ID of the Inbox to start the Chat in. Use List all Inboxes to get the ID of an inbox. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `text` | `string` | Yes | The textual content of the first message to be sent in the chat. It's recommended not to use HTML or Markdown. Use empty string to start a chat without a message (if supported by the provider). |
| `name` | `string` | No | A custom name for the chat. Some providers allow custom names only on groups. Default is made of participant names. |
| `users_ids` | `string[] \| string` | Yes | Participant(s) of the chat. To start a 1to1 chat, pass a single user id as a string. To start a group, pass an array of user ids. Passing an array with a single user id will attempt to start a group with that user only. |
| `attachments` | `object[]` | No | The list of attachments (uploaded files or a shared post or job) to be sent with the message. |
| `specifics` | `object` | No | Object containing provider-specific chat data. |

> **attachments full type**
>
> ```ts theme={null}
> {
>   content: string,
>   content_type: string,
>   filename: string,
>   metadata?: {
>     duration?: number
>   },
>   send_mode?: file | native,
>   voice_note?: boolean
> }[]
> ```

> **specifics full type**
>
> ```ts theme={null}
> {
>   linkedin?: {
>     classic?: {
>       inmail?: boolean,
>       company_topic?: SERVICE_REQUEST | REQUEST_A_DEMO | SUPPORT | CAREERS | OTHER,
>       relation_request_id?: string,
>       applicant?: {
>         id: string,
>         messaging_token: string
>       },
>       shared_content?: {
>         type: POST | JOB_POSTING,
>         id: string
>       }
>     },
>     sales_navigator?: {
>       subject: string
>     },
>     recruiter?: {
>       subject: string,
>       signature: string,
>       visibility?: PUBLIC | PRIVATE | PROJECT,
>       intent?: HIRE_FOR_CLIENT | HIRE_FOR_OWN_COMPANY,
>       send_as?: INMAIL | EMAIL,
>       email?: string,
>       channel_type?: CAREER_SITE | MANUAL_IMPORT | INTERNAL_CANDIDATES | RECRUITER_SEARCH | REFERRAL | JOB_POSTING_RECOMMENDED_MATCHES | AUTOMATED_SOURCING | JOB_POSTING,
>       follow_up?: {
>         subject: string,
>         text: string,
>         attachments?: {
>           content: any,
>           content_type: any,
>           filename: any,
>           metadata?: any,
>           send_mode?: any,
>           voice_note?: any
>         }[],
>         scheduled_for: {
>           days: any,
>           timezone?: any
>         } | {
>           weeks: any,
>           timezone?: any
>         }
>       }
>     }
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `chat_id` | `string` | Yes | The ID of the started chat. |
| `message_id` | `any` | Yes | The ID of the message sent. Some providers send attachments separately from the text content, which can result in multiple sent message IDs. |

***

## Linkedin

### endorseSkill

`linkedin.endorseSkill`

Endorse a skill of a 1st-degree connection (skill\_id from users.getProfile with linkedin\_skills). The member is notified and it shows on their profile

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.linkedin.endorseSkill({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `member_id` | `string` | Yes | The ID of the member for which to endorse the skill. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `skill_id` | `string` | Yes | The endorsement ID for the selected skill. Use Get a User Profile with `linkedin_skills` in param `with_sections` to retrieve the skills you can endorse for the given member. |

**Output**

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

***

### getCompany

`linkedin.getCompany`

Get a LinkedIn company page by numeric ID or URL slug: description, industry, size, locations, website. LinkedIn advises at most 80 a day (150 with Premium), so this is not retried after a timeout or 5xx

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.linkedin.getCompany({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `company_id` | `string` | Yes | The ID of the company to retrieve the profile of. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The ID of the Company for the provider. |
| `name` | `string` | Yes | The name of the Company. |
| `profile_url` | `string` | No | The public profile URL of the Company. |
| `public_picture_url` | `string` | No | The public picture URL of the Company. |
| `public_identifier` | `string` | No | The public identifier of the Company. |
| `followers_count` | `number` | No | The number of followers of the Company. |
| `is_following` | `boolean` | No | Whether the current user is following the Company. |
| `object` | `string` | Yes | — |
| `description` | `string` | No | The description of the Company. |
| `tagline` | `string` | No | The tagline of the Company. |
| `is_school` | `boolean` | Yes | Whether the Company is a school. |
| `is_active` | `boolean` | Yes | Whether the Company is currently in activity. |
| `is_archived` | `boolean` | Yes | Whether the Company has been archived. |
| `is_employee` | `boolean` | Yes | Whether the current user is an employee of the Company. |
| `is_verified` | `boolean` | Yes | Whether the Company has been verified. |
| `is_claimable` | `boolean` | Yes | Whether the Company can be claimed. |
| `is_claimable_by_viewer` | `boolean` | Yes | Whether the Company can be claimed by the current user. |
| `verified_at` | `string` | No | The date on which the Company was verified. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `mailbox` | `object` | Yes | The mailbox informations of the Company. |
| `viewer_roles` | `object[]` | Yes | The list of roles the current user may have in the Company. |
| `locations` | `object[]` | Yes | The list of locations related to the Company. |
| `industry` | `string[]` | Yes | A list of industries associated with the the Company. |
| `activities` | `string[]` | No | The list of activities of the Company. |
| `website` | `string` | No | The website URL of the Company. |
| `establishment_year` | `number` | No | The year the Company was established. |
| `phone` | `string` | No | The phone number of the Company. |
| `fields_of_expertise` | `string[]` | No | The list of fields of expertise of the Company. |
| `acquired_by` | `object` | No | The acquirer company. |
| `insights` | `object` | Yes | Insights about the company. |
| `funding` | `object` | No | Company funding information. |
| `hashtags` | `string[]` | Yes | The list of hashtags related to the Company. |

> **mailbox full type**
>
> ```ts theme={null}
> {
>   id: string,
>   enabled: boolean
> }
> ```

> **viewer\_roles full type**
>
> ```ts theme={null}
> {
>   type: string,
>   description: string
> }[]
> ```

> **locations full type**
>
> ```ts theme={null}
> {
>   is_headquarter: boolean,
>   country_code: string,
>   city?: string | null,
>   area?: string | null,
>   postal_code?: string | null,
>   street?: string | null,
>   description?: string | null
> }[]
> ```

> **acquired\_by full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   name: string,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   public_identifier?: string | null,
>   followers_count?: number | null,
>   is_following?: boolean | null
> }
> ```

> **insights full type**
>
> ```ts theme={null}
> {
>   headcount?: number | null,
>   headcount_range?: {
>     from?: number | null,
>     to?: number | null
>   } | null,
>   heacount_growth?: any[] | null,
>   growth_periods?: any[] | null,
>   average_tenure?: number | null
> }
> ```

> **funding full type**
>
> ```ts theme={null}
> {
>   crunchbase?: {
>     rounds_url: string,
>     rounds_count: number,
>     company_url: string,
>     last_round: {
>     }
>   } | null
> }
> ```

***

### getCompanyFollowCredits

`linkedin.getCompanyFollowCredits`

Get a company page's remaining follow-invitation credits and when they reset

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.linkedin.getCompanyFollowCredits({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `company_id` | `string` | Yes | The numeric LinkedIn company ID. The owner of the account must be an administrator of the page. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `remaining_credit` | `number` | Yes | The remaining credit for inviting members to follow the company page. |
| `credit_grant` | `number` | Yes | The credit that is granted to you on each reset. |
| `resets_on` | `string` | Yes | The next reset date of the credits. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |

***

### getInmailCredits

`linkedin.getInmailCredits`

Get how many InMail credits the LinkedIn account has left (classic, sales\_navigator or recruiter; all when omitted). Check before an InMail with inboxes.startChat

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.linkedin.getInmailCredits({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `service` | `classic \| recruiter \| sales_navigator` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `credits` | `object` | Yes | — |

> **credits full type**
>
> ```ts theme={null}
> {
>   classic?: number | null,
>   recruiter?: number | null,
>   sales_navigator?: number | null
> }
> ```

***

### getSearchParameters

`linkedin.getSearchParameters`

Look up the IDs LinkedIn searches need (type LOCATION, COMPANY, INDUSTRY, SCHOOL, JOB\_TITLE, SKILL… plus keywords; up to 100). Searches, profile views and profile updates take these IDs, not text

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.linkedin.getSearchParameters({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `type` | `LOCATION \| COMPANY \| RELATION \| PEOPLE \| SCHOOL \| INDUSTRY \| SERVICE \| JOB_FUNCTION \| JOB_TITLE \| EMPLOYMENT_TYPE \| SKILL` | Yes | — |
| `keywords` | `string` | Yes | — |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   name: string,
>   metadata?: {
>   } | null
> }[]
> ```

***

### inviteToFollowCompany

`linkedin.inviteToFollowCompany`

Invite 1st-degree connections (ACo… IDs) to follow a company page the account administers. Spends the page's monthly credits; success can be partial (invitations\_count), so never resend the whole batch

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.linkedin.inviteToFollowCompany({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `company_id` | `string` | Yes | The numeric LinkedIn company ID. The owner of the account must be an administrator of the page. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `member_ids` | `string[]` | Yes | A list of member profile IDs (ACo...) identifying the members to invite to follow the company page. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `result` | `object` | Yes | — |

> **result full type**
>
> ```ts theme={null}
> {
>   invitations_ids: string[],
>   invitations_count: {
>     success: number,
>     failed: number
>   }
> }
> ```

***

### listContracts

`linkedin.listContracts`

List the Sales Navigator or Recruiter contracts (seats) the account can use (403 unless that product was activated when the account was linked)

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.linkedin.listContracts({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `contracts` | `object[]` | Yes | — |

> **contracts full type**
>
> ```ts theme={null}
> {
>   object: string,
>   product: string,
>   selected: boolean,
>   id: string,
>   name: string,
>   description?: string | null
> }[]
> ```

***

### listManagedCompanyPages

`linkedin.listManagedCompanyPages`

List the LinkedIn company pages the account administers; their IDs work as post\_as, comment\_as, react\_as and for follow invitations

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.linkedin.listManagedCompanyPages({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   mailbox_id: string,
>   name: string,
>   messaging_enabled?: boolean | null
> }[]
> ```

***

### listProfileViews

`linkedin.listProfileViews`

List who viewed the account's LinkedIn profile, with offset paging and filters (date range, industry, company, location). Without Premium the data is limited and filters are ignored

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.linkedin.listProfileViews({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `sort_by` | `DATE \| RELEVANCE` | No | — |
| `date_range` | `number` | No | — |
| `industry` | `string[]` | No | — |
| `company` | `string[]` | No | — |
| `location` | `string[]` | No | — |
| `details_sections` | `COMPANIES \| INDUSTRIES \| LOCATIONS[]` | No | — |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `entities` | `object[]` | Yes | A collection of profile view entities. |
| `analytics` | `object` | No | Profile views analytics will only be present in the first request of a series of paginated requests. |

> **entities full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id?: string | null,
>   public_identifier: string,
>   name: string,
>   picture_url?: string | null,
>   network_distance?: string | null,
>   premium?: boolean | null,
>   verified?: boolean | null,
>   last_visited?: {
>   } | null
> }[]
> ```

> **analytics full type**
>
> ```ts theme={null}
> {
>   object: string,
>   views_count: number,
>   highlights?: {
>     top_location?: string | null,
>     top_company?: string | null,
>     top_industry?: string | null
>   } | null,
>   details?: {
>     locations?: {
>     } | null,
>     companies?: {
>     } | null,
>     industries?: {
>     } | null
>   } | null
> }
> ```

***

### request

`linkedin.request`

Advanced: send a raw request to any LinkedIn endpoint through the account's session and get LinkedIn's response as is. Can read or change anything the account can; prefer the typed operations. Never retried after a timeout or 5xx

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.linkedin.request({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `url` | `string` | Yes | The specific LinkedIn public API endpoint you need to call. Path variables can be declared with the `:VARIABLE_NAME` syntax. |
| `method` | `GET \| POST \| PUT \| PATCH \| DELETE` | Yes | The HTTP method to use when performing the request. |
| `body` | `object` | No | A body object to send in the request. |
| `binary_body` | `string` | No | Binary content in base64 to be sent with POST/PUT/PATCH requests. Overrides `body` param. |
| `headers` | `object` | No | A headers object to include in the request. Null value may be used in order to remove a specific header from the default set. |
| `path_variables` | `object` | No | The Path variables that have been declared in the URL. Each variable must have a corresponding VARIABLE\_NAME key to be injected in the URL. |
| `query_params` | `object` | No | Query parameters to include in the request URL. |
| `bypass_url_encoding` | `boolean` | No | Whether to bypass URL encoding for query parameters or form-urlencoded body, so you can handle encoding yourself. |

> **body full type**
>
> ```ts theme={null}
> {
> }
> ```

> **headers full type**
>
> ```ts theme={null}
> {
> }
> ```

> **path\_variables full type**
>
> ```ts theme={null}
> {
> }
> ```

> **query\_params full type**
>
> ```ts theme={null}
> {
> }
> ```

**Output:** `any`

***

### searchCompanies

`linkedin.searchCompanies`

Search LinkedIn companies by keywords, location, industry and headcount (IDs from linkedin.getSearchParameters); cursor paging. Counts toward LinkedIn's daily search limit

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.linkedin.searchCompanies({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `cursor` | `string` | No | — |
| `keywords` | `string` | No | A keyword or group of keywords. |
| `location` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `LOCATION` type to find out the possible values. Native filter : Locations |
| `industry` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `INDUSTRY` type to find out the possible values. Native filter : Industry |
| `headcount` | `object[]` | No | A list of company headcount ranges. |
| `has_job_postings` | `boolean` | No | Whether the companies should have active job postings on LinkedIn. Native filter : Job listings on LinkedIn |
| `is_employing_relations` | `boolean` | No | Whether the companies should have first degree relations among employees. Native filter : Relations |

> **headcount full type**
>
> ```ts theme={null}
> {
>   min?: number,
>   max?: number
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   display_name: string,
>   public_identifier?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   public_picture_url_large?: string | null,
>   location?: string | null,
>   industry?: string | null,
>   summary?: string | null,
>   relations_count?: number | null,
>   product: string,
>   job_postings_count?: number | null,
>   followers_count?: number | null
> }[]
> ```

***

### searchFromUrl

`linkedin.searchFromUrl`

Run a LinkedIn search from a linkedin.com/search/results/people, /companies or /content URL; page with next\_cursor and the same URL. Counts toward LinkedIn's daily search limit (about 1,000 profiles)

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.linkedin.searchFromUrl({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |
| `cursor` | `string` | No | — |
| `url` | `string` | Yes | The URL to perform the search from. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | No | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   member_id?: string | null,
>   display_name: string,
>   public_identifier?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   public_picture_url_large?: string | null,
>   relations_count?: number | null,
>   location?: string | null,
>   headline?: string | null,
>   network_distance: string,
>   can_send_inmail?: boolean | null,
>   product: string,
>   followers_count?: number | null,
>   industry?: string | null,
>   is_verified?: boolean | null,
>   keywords_match?: string | null,
>   is_premium?: boolean | null,
>   is_open_profile?: boolean | null,
>   shared_relations_count?: number | null,
>   website_url?: string | null,
>   portfolio_url?: string | null,
>   services_page_url?: string | null
> }[]
> ```

***

### searchJobs

`linkedin.searchJobs`

Search LinkedIn job postings by keywords, company, location, function and title (IDs from linkedin.getSearchParameters); offset paging, up to 100 per page

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.linkedin.searchJobs({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |
| `keywords` | `string` | No | A keyword or group of keywords. |
| `sort_by` | `RELEVANCE \| DATE` | No | The sort method. Native filter : Sort by |
| `date_posted` | `PAST_DAY \| PAST_WEEK \| PAST_MONTH` | No | The time period when the jobs should have been published. Native filter : Date posted |
| `workplace_type` | `ON_SITE \| REMOTE \| HYBRID[]` | No | A list of workplace types. Native filter : Remote |
| `seniority` | `INTERNSHIP \| ENTRY_LEVEL \| ASSOCIATE \| MID_SENIOR_LEVEL \| DIRECTOR \| EXECUTIVE[]` | No | A list of experience levels required by the jobs. Native filter : Experience level |
| `employment_status` | `FULL_TIME \| PART_TIME \| CONTRACT \| TEMPORARY \| VOLUNTEER \| INTERNSHIP \| OTHER[]` | No | A list of employment statuses. Native filter : Job type |
| `company` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `COMPANY` type to find out the possible values. Native filter : Company |
| `primary_location` | `string` | No | A parameter ID. Use List Search Parameters with `LOCATION` type to find out the possible values. Native filter : Primary location |
| `location` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `LOCATION` type to find out the possible values. Native filter : Location |
| `location_radius` | `number` | No | The distance radius around the location in kilometers. Native filter : Distance |
| `industry` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `INDUSTRY` type to find out the possible values. Native filter : Industry |
| `function` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `JOB_FUNCTION` type to find out the possible values. Native filter : Job function |
| `job_title` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `JOB_TITLE` type to find out the possible values. Native filter : Job title |
| `easy_apply` | `boolean` | No | Whether the application can me made directly on LinkedIn. Native filter : Easy apply |
| `has_verifications` | `boolean` | No | Whether the jobs have a verification badge. Native filter : Has verifications |
| `under_10_applicants` | `boolean` | No | Whether the jobs didn't receive more than 10 applications. Native filter : Under 10 applicants |
| `in_your_network` | `boolean` | No | Whether the jobs have been published by relations of you. Native filter : In your network |
| `fair_chance_employer` | `boolean` | No | Whether the jobs accept applicants with criminal records. Native filter : Fair chance employer |
| `salary` | `object` | No | The minimum salary. Native filter : Salary |
| `benefits` | `MEDICAL_INSURANCE \| VISION_INSURANCE \| DENTAL_INSURANCE \| DISABILITY_INSURANCE \| 401(K) \| PENSION_PLAN \| PAID_MATERNITY_LEAVE \| PAID_PATERNITY_LEAVE \| COMMUTER_BENEFITS \| STUDENT_LOAN_ASSISTANCE \| TUITION_ASSISTANCE[]` | No | A list of benefits. |
| `commitments` | `CAREER_GROWTH_AND_LEARNING \| DIVERSITY_EQUITY_AND_INCLUSION \| ENVIRONMENTAL_SUSTAINABILITY \| SOCIAL_IMPACT \| WORK_LIFE_BALANCE[]` | No | A list of commitments. |

> **salary full type**
>
> ```ts theme={null}
> {
>   currency: USD,
>   starting_from: number
> } | {
>   currency: AUD,
>   starting_from: number
> } | {
>   currency: GBP,
>   starting_from: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   title: string,
>   location?: string | null,
>   listed_at?: string | null,
>   workplace_type?: string | null,
>   url: string,
>   is_repost: boolean,
>   is_promoted: boolean,
>   easy_apply: boolean,
>   few_applicants: boolean,
>   company: {
>   },
>   insights: string[]
> }[]
> ```

***

### searchPeople

`linkedin.searchPeople`

Search LinkedIn people by keywords, location, company, school, industry and network distance (IDs from linkedin.getSearchParameters); 10 per page, cursor paging. LinkedIn advises at most 1,000 profiles a day

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.linkedin.searchPeople({ account_id: 'acc_9f2c1d7e', keywords: 'head of engineering', network_distance: [2] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `cursor` | `string` | No | — |
| `keywords` | `string` | No | A keyword or group of keywords. |
| `network_distance` | `number[]` | No | A list of connection degrees (1 for First, 2 for Second and 3 for Third+). Native filter : Connections |
| `location` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `LOCATION` type to find out the possible values. Native filter : Locations |
| `current_company` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `COMPANY` type to find out the possible values. Native filter : Current company |
| `past_company` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `COMPANY` type to find out the possible values. Native filter : Past company |
| `school` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `SCHOOL` type to find out the possible values. Native filter : School |
| `connections_of` | `string` | No | A parameter ID. Use List Search Parameters with `RELATION` type to find out the possible values. Native filter : Connections of |
| `followers_of` | `string` | No | A parameter ID. Use List Search Parameters with `PEOPLE` type to find out the possible values. Native filter : Followers of |
| `industry` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `INDUSTRY` type to find out the possible values. Native filter : Industry |
| `service` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `SERVICE` type to find out the possible values. Native filter : Service categories |
| `profile_language` | `string[]` | No | A list of ISO 639-1 language codes. Native filter : Profile language |
| `open_to_volunteering` | `boolean` | No | Whether the users should be open to volunteering. Native filter : Open to Volunteering |
| `advanced_keywords` | `object` | No | A set of advanced keywords based filters. Native filter : Keywords |

> **advanced\_keywords full type**
>
> ```ts theme={null}
> {
>   first_name?: string,
>   last_name?: string,
>   title?: string,
>   company?: string,
>   school?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   member_id?: string | null,
>   display_name: string,
>   public_identifier?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   public_picture_url_large?: string | null,
>   relations_count?: number | null,
>   location?: string | null,
>   headline?: string | null,
>   network_distance: string,
>   can_send_inmail?: boolean | null,
>   product: string,
>   followers_count?: number | null,
>   industry?: string | null,
>   is_verified?: boolean | null,
>   keywords_match?: string | null,
>   is_premium?: boolean | null,
>   is_open_profile?: boolean | null,
>   shared_relations_count?: number | null,
>   website_url?: string | null,
>   portfolio_url?: string | null,
>   services_page_url?: string | null
> }[]
> ```

***

### searchPosts

`linkedin.searchPosts`

Search LinkedIn posts by keywords, author or mention (IDs from linkedin.getSearchParameters), to find people engaging with a topic; cursor paging, up to 49 per page. Counts toward the daily search limit

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.linkedin.searchPosts({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |
| `keywords` | `string` | No | A keyword or group of keywords. |
| `sort_by` | `RELEVANCE \| DATE` | No | The sort method. Native filter : Sort by |
| `date_posted` | `PAST_DAY \| PAST_WEEK \| PAST_MONTH` | No | The time period when the posts should have been published. Native filter : Date posted |
| `content_type` | `VIDEOS \| IMAGES \| JOB_POSTS \| LIVE_VIDEOS \| DOCUMENTS \| COLLABORATIVE_ARTICLES` | No | Any media or non text-only resource that should be included in the posts. Native filter : Content type |
| `posted_by` | `object` | No | The users/companies who published the posts. |
| `mentioning` | `object` | No | The users/companies mentionned in the posts. |
| `author` | `object` | No | Advanced filters on post authors. |

> **posted\_by full type**
>
> ```ts theme={null}
> {
>   member?: string[],
>   company?: string[],
>   me?: boolean,
>   relations?: boolean,
>   people_you_follow?: boolean
> }
> ```

> **mentioning full type**
>
> ```ts theme={null}
> {
>   member?: string[],
>   company?: string[]
> }
> ```

> **author full type**
>
> ```ts theme={null}
> {
>   keywords?: string,
>   company?: string[],
>   industry?: string[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   share_url: string,
>   created_at: string,
>   title?: string | null,
>   text: string,
>   author: {
>   },
>   user_reacted: boolean | string,
>   permissions: {
>   },
>   reactions_counter?: any[] | null,
>   comments_counter?: number | null,
>   reposts_counter?: number | null,
>   poll?: {
>   } | null,
>   event?: {
>   } | null,
>   attachments: any[],
>   analytics?: {
>   } | null,
>   specifics?: any | null,
>   is_repost: boolean,
>   reposted_by?: {
>   } | null,
>   quoted_post?: {
>   } | null
> }[]
> ```

***

### selectContract

`linkedin.selectContract`

Switch to another Sales Navigator or Recruiter contract; later calls and webhooks for that product use it

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.linkedin.selectContract({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contract_id` | `string` | Yes | The ID of the contract to be activated on the account. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `contract` | `object` | Yes | — |

> **contract full type**
>
> ```ts theme={null}
> {
>   object: string,
>   product: string,
>   selected: boolean,
>   id: string,
>   name: string,
>   description?: string | null
> }
> ```

***

## Messages

### addReaction

`messages.addReaction`

React to a message with an emoji; the other participants see it. WhatsApp, Telegram and Instagram keep one reaction per person (a new one replaces it); some providers allow only a fixed set

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.messages.addReaction({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | The ID of the Chat where the message is. |
| `message_id` | `string` | Yes | The ID of the Message to add the reaction to. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `reaction` | `string` | Yes | The emoji unicode. |

**Output**

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

***

### delete

`messages.delete`

Delete a message the account sent. WhatsApp and Telegram delete it for everyone; some providers leave a 'deleted' placeholder, and WhatsApp can report success outside its time limit without deleting

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

```ts theme={null}
await corsair.unipile.api.messages.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | The ID of the Chat where the message is. |
| `message_id` | `string` | Yes | The ID of the Message to delete. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### edit

`messages.edit`

Edit the text of a message the account sent. Instagram allows it for 15 minutes; WhatsApp can report success outside its limits without editing

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.messages.edit({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | The ID of the Chat where the message is. |
| `message_id` | `string` | Yes | The ID of the Message to modify. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `text` | `string` | Yes | The new textual content of the message. It's recommended not to use HTML or Markdown. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `id` | `string` | No | The unique identifier of the message for the provider. |
| `text` | `string` | No | The text content of the message. |
| `sender_id` | `string` | No | The ID of the user who sent the message. |
| `chat_id` | `string` | No | The ID of the chat where the message was sent. |
| `timestamp` | `string` | No | The timestamp of the message. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `is_sender` | `boolean` | No | Is the current user the sender of the message. |
| `is_hidden` | `boolean` | No | Is the message hidden. Hidden messages are usually not displayed in the chat but can be as last message is chats list. |
| `is_seen` | `boolean` | No | Is the message seen by other participants. |
| `is_delivered` | `boolean` | No | Is the message delivered to the other participants. |
| `is_deleted` | `boolean` | No | Is the message deleted. Some providers show the message as deleted in the chat. |
| `is_edited` | `boolean` | No | Is the message edited. Some providers adds an "edited" mark on the message in the chat. |
| `is_pinned` | `boolean` | No | Is the message pinned. Pinned messages are usually displayed at the top of the chat. |
| `is_event` | `boolean` | No | Is the message an event. Events are special messages that are not displayed in the chat but can be used to trigger actions. |
| `is_mentionned` | `boolean` | No | Is the message mentionning the current user. Usually to notify. |
| `view_mode` | `string` | No | How the ephemeral content of this message may be viewed: `once` for a single opening, `replayable` when the sender allowed it to be opened again. |
| `event_type` | `number` | No | The type of message event. 0 : Unknown (Not implemented) 1 : Chat name update 2 : Chat description update 3 : New participant added to the chat group 4 : Partic… |
| `event_metadata` | `object` | No | — |
| `content_relation` | `object` | No | — |
| `reactions_counter` | `object[]` | No | A list of reactions to the element. |
| `sender` | `object` | No | The user who sent the message. |
| `provider` | `string` | No | The provider's of the Account. - `mock` is mock. - `whatsapp` is WhatsApp. - `linkedin` is LinkedIn. - `instagram` is Instagram. - `google` is Google. |
| `attachments` | `object[]` | No | List of message attachments. |
| `hyperlinks` | `object[]` | No | List of message hyperlinks. |
| `quoted` | `object` | No | The quoted message. |
| `forwarded` | `object` | No | Contains the original message if this message was forwarded from another chat, depending on provider support. |
| `specifics` | `any` | No | — |

> **event\_metadata full type**
>
> ```ts theme={null}
> {
>   user_id?: string | null,
>   user_name?: string | null,
>   reason?: string | null,
>   title?: string | null,
>   description?: string | null,
>   call_id?: string | null,
>   is_video?: boolean | null,
>   link?: string | null,
>   start?: string | null,
>   end?: string | null,
>   duration?: number | null,
>   message_id?: string | null,
>   is_pin?: boolean | null,
>   subject?: string | null,
>   reaction?: string | null
> }
> ```

> **content\_relation full type**
>
> ```ts theme={null}
> {
>   type: string,
>   attachment_id?: string | null
> }
> ```

> **reactions\_counter full type**
>
> ```ts theme={null}
> {
>   reaction: string,
>   count: number
> }[]
> ```

> **sender full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: any | null
> }
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   file_size?: number | null,
>   is_inline?: boolean | null,
>   content_id?: string | null,
>   is_unavailable?: boolean | null,
>   mimetype?: string | null,
>   url?: string | null,
>   url_expires_at?: string | null,
>   content?: string | null,
>   type?: string | null,
>   duration?: number | null,
>   voice_note?: boolean | null,
>   size?: {
>   } | null,
>   sticker?: boolean | null,
>   gif?: boolean | null,
>   filename?: string | null,
>   media_type?: string | null,
>   author?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   organization?: string | null,
>   phones?: any[] | null,
>   emails?: any[] | null
> }[]
> ```

> **hyperlinks full type**
>
> ```ts theme={null}
> {
>   url: string,
>   starts_at: number,
>   length: number
> }[]
> ```

> **quoted full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   text?: string | null,
>   specifics?: any | null,
>   attachments: any[],
>   sender?: {
>     id: string,
>     object: string,
>     type: string,
>     public_identifier?: string | null,
>     display_name: string,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     private_picture_download_url?: string | null,
>     description?: string | null,
>     specifics?: any | null
>   } | null
> }
> ```

> **forwarded full type**
>
> ```ts theme={null}
> {
>   text?: string | null,
>   specifics?: any | null,
>   attachments: any[],
>   sender?: {
>     id: string,
>     object: string,
>     type: string,
>     public_identifier?: string | null,
>     display_name: string,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     private_picture_download_url?: string | null,
>     description?: string | null,
>     specifics?: any | null
>   } | null,
>   object: string
> }
> ```

***

### forward

`messages.forward`

Forward a message to another chat (to\_chat\_id). WhatsApp and Telegram ignore the extra text; not on LinkedIn Sales Navigator or Recruiter. Sends immediately and is never retried after a timeout or 5xx

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.messages.forward({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | The ID of the Chat where the message is. |
| `message_id` | `string` | Yes | The ID of the Message to forward. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `to_chat_id` | `string` | Yes | The ID of the Chat to forward the message to. |
| `text` | `string` | No | Text to be attached to the forwarded message. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `message_id` | `string` | Yes | The ID of the message created in the destination chat. |
| `chat_id` | `string` | Yes | The ID of the Chat where the message was forwarded to. |

***

### get

`messages.get`

Get one message: text, sender, attachments, reactions, and read and delivery state. Not on LinkedIn Sales Navigator or Recruiter

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.messages.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | The ID of the Chat where the message is. |
| `message_id` | `string` | Yes | The ID of the Message to retrieve. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The unique identifier of the message for the provider. |
| `text` | `string` | No | The text content of the message. |
| `sender_id` | `string` | Yes | The ID of the user who sent the message. |
| `chat_id` | `string` | Yes | The ID of the chat where the message was sent. |
| `timestamp` | `string` | Yes | The timestamp of the message. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `is_sender` | `boolean` | Yes | Is the current user the sender of the message. |
| `is_hidden` | `boolean` | Yes | Is the message hidden. Hidden messages are usually not displayed in the chat but can be as last message is chats list. |
| `is_seen` | `boolean` | Yes | Is the message seen by other participants. |
| `is_delivered` | `boolean` | Yes | Is the message delivered to the other participants. |
| `is_deleted` | `boolean` | Yes | Is the message deleted. Some providers show the message as deleted in the chat. |
| `is_edited` | `boolean` | Yes | Is the message edited. Some providers adds an "edited" mark on the message in the chat. |
| `is_pinned` | `boolean` | Yes | Is the message pinned. Pinned messages are usually displayed at the top of the chat. |
| `is_event` | `boolean` | Yes | Is the message an event. Events are special messages that are not displayed in the chat but can be used to trigger actions. |
| `is_mentionned` | `boolean` | Yes | Is the message mentionning the current user. Usually to notify. |
| `view_mode` | `string` | No | How the ephemeral content of this message may be viewed: `once` for a single opening, `replayable` when the sender allowed it to be opened again. |
| `event_type` | `number` | No | The type of message event. 0 : Unknown (Not implemented) 1 : Chat name update 2 : Chat description update 3 : New participant added to the chat group 4 : Partic… |
| `event_metadata` | `object` | No | — |
| `content_relation` | `object` | No | — |
| `reactions_counter` | `object[]` | Yes | A list of reactions to the element. |
| `provider` | `string` | Yes | The provider's of the Account. - `mock` is mock. - `whatsapp` is WhatsApp. - `linkedin` is LinkedIn. - `instagram` is Instagram. - `google` is Google. |
| `attachments` | `object[]` | Yes | List of message attachments. |
| `hyperlinks` | `object[]` | Yes | List of message hyperlinks. |
| `specifics` | `object` | No | Object containing provider-specific message data. |
| `sender` | `object` | No | The user who sent the message. |
| `quoted` | `object` | No | The quoted message. |
| `forwarded` | `object` | No | Contains the original message if this message was forwarded from another chat, depending on provider support. |

> **event\_metadata full type**
>
> ```ts theme={null}
> {
>   user_id?: string | null,
>   user_name?: string | null,
>   reason?: string | null,
>   title?: string | null,
>   description?: string | null,
>   call_id?: string | null,
>   is_video?: boolean | null,
>   link?: string | null,
>   start?: string | null,
>   end?: string | null,
>   duration?: number | null,
>   message_id?: string | null,
>   is_pin?: boolean | null,
>   subject?: string | null,
>   reaction?: string | null
> }
> ```

> **content\_relation full type**
>
> ```ts theme={null}
> {
>   type: string,
>   attachment_id?: string | null
> }
> ```

> **reactions\_counter full type**
>
> ```ts theme={null}
> {
>   reaction: string,
>   count: number
> }[]
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   file_size?: number | null,
>   is_inline?: boolean | null,
>   content_id?: string | null,
>   is_unavailable?: boolean | null,
>   mimetype?: string | null,
>   url?: string | null,
>   url_expires_at?: string | null,
>   content?: string | null,
>   type?: string | null,
>   duration?: number | null,
>   voice_note?: boolean | null,
>   size?: {
>   } | null,
>   sticker?: boolean | null,
>   gif?: boolean | null,
>   filename?: string | null,
>   media_type?: string | null,
>   author?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   organization?: string | null,
>   phones?: any[] | null,
>   emails?: any[] | null
> }[]
> ```

> **hyperlinks full type**
>
> ```ts theme={null}
> {
>   url: string,
>   starts_at: number,
>   length: number
> }[]
> ```

> **specifics full type**
>
> ```ts theme={null}
> {
>   type?: string | null,
>   subject?: string | null,
>   interactive?: {
>     type: string,
>     title?: string | null,
>     footer?: string | null,
>     buttons: any[],
>     selected_button?: {
>     } | null
>   } | null
> }
> ```

> **sender full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: {
>     contact_name?: string | null,
>     messaging_identifier?: string | null,
>     location?: string | null,
>     network_distance?: string | null,
>     industry?: string | null,
>     is_following?: boolean | null,
>     followers_count?: number | null,
>     relations_count?: number | null,
>     shared_relations_count?: number | null,
>     website_url?: string | null,
>     portfolio_url?: string | null,
>     services_page_url?: string | null,
>     is_premium?: boolean | null,
>     is_verified?: boolean | null
>   } | null
> }
> ```

> **quoted full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   text?: string | null,
>   attachments: any[],
>   sender?: {
>     id: string,
>     object: string,
>     type: string,
>     public_identifier?: string | null,
>     display_name: string,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     private_picture_download_url?: string | null,
>     description?: string | null,
>     specifics?: {
>     } | null
>   } | null,
>   specifics?: {
>     interactive?: {
>     } | null
>   } | null
> }
> ```

> **forwarded full type**
>
> ```ts theme={null}
> {
>   text?: string | null,
>   attachments: any[],
>   object: string,
>   sender?: {
>     id: string,
>     object: string,
>     type: string,
>     public_identifier?: string | null,
>     display_name: string,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     private_picture_download_url?: string | null,
>     description?: string | null,
>     specifics?: {
>     } | null
>   } | null,
>   specifics?: {
>     interactive?: {
>     } | null
>   } | null
> }
> ```

***

### getAttachment

`messages.getAttachment`

Download a message attachment. Returns the type and size only, unless include\_content is set (then base64, up to max\_bytes). Attachments marked is\_unavailable cannot be downloaded

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.messages.getAttachment({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `include_content` | `boolean` | No | Return the file itself as base64 in content\_base64. Off by default: only the type and size come back |
| `max_bytes` | `number` | No | Largest file to return with include\_content (default 5 MB); bigger files come back without content |
| `chat_id` | `string` | Yes | — |
| `message_id` | `string` | Yes | — |
| `attachment_id` | `string` | Yes | — |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `content_type` | `string` | Yes | MIME type Unipile sent |
| `size_bytes` | `number` | Yes | Size of the file in bytes |
| `filename` | `string` | No | File name from Content-Disposition, when sent |
| `content_base64` | `string` | No | The file as base64, only with include\_content |
| `content_omitted` | `string` | No | Why content\_base64 is missing although include\_content was set |

***

### list

`messages.list`

List the messages in a chat on any provider, newest first, with sender, read and delivery state

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.messages.list({ account_id: 'acc_9f2c1d7e', chat_id: 'chat_5a6b7c' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `chat_id` | `string` | Yes | — |
| `before` | `string` | No | — |
| `after` | `string` | No | — |
| `user_id` | `string` | No | Only messages from this sender |
| `offset` | `number` | No | Offset pagination: add the previous limit to get the next page. Use `cursor` instead when the previous page returned next\_cursor |
| `cursor` | `string` | No | next\_cursor from the previous page. Send it alone, without offset |
| `limit` | `number` | No | Page size. Leave unset to use the provider's own page size, which Unipile recommends |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | — |
| `next_cursor` | `string` | No | Pass as cursor to get the next page; absent on the last page |

> **data full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id: string,
>   chat_id: string,
>   sender_id: string,
>   text?: string | null,
>   timestamp: string,
>   is_sender?: boolean | null,
>   is_seen?: boolean | null,
>   is_delivered?: boolean | null,
>   is_deleted?: boolean | null,
>   is_edited?: boolean | null,
>   is_event?: boolean | null,
>   provider?: string | null,
>   attachments?: any[] | null,
>   sender?: {
>     id: string,
>     object?: string | null,
>     type?: string | null,
>     public_identifier?: string | null,
>     display_name?: string | null,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     description?: string | null,
>     specifics?: {
>       location?: string | null,
>       network_distance?: string | null,
>       industry?: string | null,
>       is_following?: boolean | null,
>       followers_count?: number | null,
>       relations_count?: number | null,
>       shared_relations_count?: number | null,
>       is_premium?: boolean | null,
>       is_verified?: boolean | null
>     } | null
>   } | null,
>   quoted?: {
>   } | null
> }[]
> ```

***

### listReactions

`messages.listReactions`

List who reacted to a message with what. LinkedIn Classic, WhatsApp, Telegram and Instagram (counts are already on the message)

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.messages.listReactions({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | The ID of the Chat where the message is. |
| `message_id` | `string` | Yes | The ID of the Message to retrieve reactions from. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   value: string,
>   is_sender: boolean,
>   sender: {
>   }
> }[]
> ```

***

### markRead

`messages.markRead`

Mark someone else's message as read (the sender may see a read receipt). Does not change the chat's read state; not on LinkedIn Sales Navigator or Recruiter

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.messages.markRead({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | The ID of the Chat where the message is. |
| `message_id` | `string` | Yes | The ID of the Message to mark as read. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

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

***

### pin

`messages.pin`

Pin or unpin a message (pin\_status false unpins). WhatsApp, Telegram and Instagram; WhatsApp pins expire after 24 hours, 7 or 30 days

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.messages.pin({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | The ID of the Chat where the message is. |
| `message_id` | `string` | Yes | The ID of the Message to pin or unpin. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `pin_status` | `boolean` | Yes | Set to `true` to pin the message in the chat, or `false` to unpin it. |
| `specifics` | `object` | No | Object containing provider-specific pin data. |

> **specifics full type**
>
> ```ts theme={null}
> {
>   whatsapp?: {
>     pin_duration?: 24_hours | 7_days | 30_days
>   }
> }
> ```

**Output**

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

***

### removeReaction

`messages.removeReaction`

Remove the account's own reaction from a message (pass the same emoji)

**Risk:** `destructive`

```ts theme={null}
await corsair.unipile.api.messages.removeReaction({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chat_id` | `string` | Yes | The ID of the Chat where the message is. |
| `message_id` | `string` | Yes | The ID of the Message where the reaction is. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `reaction` | `string` | Yes | The emoji unicode to be removed. |

**Output**

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

***

### send

`messages.send`

Send a message in an existing chat on any provider, optionally with attachments or as a reply (quote\_id). WhatsApp sends one attachment per message; LinkedIn caps attachments at 20 MB. Never retried after a timeout or 5xx

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.messages.send({ account_id: 'acc_9f2c1d7e', chat_id: 'chat_5a6b7c', text: 'Does Tuesday at 10 work?' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `chat_id` | `string` | Yes | — |
| `text` | `string` | Yes | Message text. Plain text; Unipile advises against HTML |
| `quote_id` | `string` | No | ID of a message to reply to |
| `attachments` | `object[]` | No | — |

> **attachments full type**
>
> ```ts theme={null}
> {
>   filename: string,
>   content: string,
>   content_type: string,
>   send_mode?: file | native
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `message_id` | `string \| string[]` | No | — |

***

## Posts

### addComment

`posts.addComment`

Comment on a post, optionally as a managed LinkedIn company page. The comment is public; LinkedIn advises 80-100 a day. Never retried after a timeout or 5xx

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.posts.addComment({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The ID of the Post to add the comment to. Use IDs from *Get a Post*, *Create a Post* or *List all User's Posts* methods responses only. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `text` | `string` | Yes | Textual content of the comment. User mentions can be added by inserting an @ followed by the `id` or `public_identifier` of the user (example: @JohnDoe). |
| `comment_as` | `string` | No | The ID of the User on whose behalf the comment should be published (if supported by the provider). |
| `attachments` | `object[]` | No | Attachment associated with the comment |

> **attachments full type**
>
> ```ts theme={null}
> {
>   content: string,
>   content_type: string,
>   filename: string,
>   metadata?: {
>     duration?: number
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the comment. |
| `thread_id` | `string` | No | The ID of the thread if this is a reply to another comment. |
| `author` | `object` | Yes | The author of the comment. |
| `created_at` | `string` | Yes | The creation date of the comment. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `text` | `string` | Yes | The text content of the comment. |
| `attachments` | `object[]` | Yes | List of comment attachments. |
| `is_sender` | `boolean` | Yes | Is the current user the sender of the comment. |
| `can_reply` | `boolean` | Yes | Whether the current user can reply to the comment or not. |
| `can_react` | `boolean` | Yes | Whether the current user can react to the comment or not. |
| `reply_counter` | `number` | Yes | The number of replies to the comment. |
| `impressions_counter` | `number` | No | The number of impressions of the comment. |
| `reactions_counter` | `object[]` | Yes | A list of reactions to the element. |

> **author full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: any | null
> }
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   file_size?: number | null,
>   is_inline?: boolean | null,
>   content_id?: string | null,
>   is_unavailable?: boolean | null,
>   mimetype?: string | null,
>   url?: string | null,
>   url_expires_at?: string | null,
>   content?: string | null,
>   type?: string | null,
>   duration?: number | null,
>   voice_note?: boolean | null,
>   size?: {
>   } | null,
>   sticker?: boolean | null,
>   gif?: boolean | null,
>   filename?: string | null,
>   media_type?: string | null,
>   author?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   organization?: string | null,
>   phones?: any[] | null,
>   emails?: any[] | null
> }[]
> ```

> **reactions\_counter full type**
>
> ```ts theme={null}
> {
>   reaction: string,
>   count: number
> }[]
> ```

***

### addCommentReaction

`posts.addCommentReaction`

React to a comment, optionally as a managed company page. The reaction is public

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.posts.addCommentReaction({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The ID of the Post where the comment is. Use IDs from *Get a Post*, *Create a Post* or *List all User's Posts* methods responses only. |
| `comment_id` | `string` | Yes | The ID of the Comment to add the reaction to. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `reaction` | `string \| linkedin_like \| linkedin_celebrate \| linkedin_support \| linkedin_love \| linkedin_insightful \| linkedin_funny \| instagram_like` | Yes | — |
| `react_as` | `string` | No | The ID of the User on whose behalf the reaction should be published (if supported by the provider). |

**Output**

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

***

### addReaction

`posts.addReaction`

React to a post (LinkedIn: like, celebrate, support, love, insightful, funny; Instagram: like). The reaction is public; LinkedIn advises 80-100 reactions and comments a day

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.posts.addReaction({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The ID of the Post to add the reaction to. Use IDs from *Get a Post*, *Create a Post* or *List all User's Posts* methods responses only. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `reaction` | `string \| linkedin_like \| linkedin_celebrate \| linkedin_support \| linkedin_love \| linkedin_insightful \| linkedin_funny \| instagram_like` | Yes | — |
| `react_as` | `string` | No | The ID of the User on whose behalf the reaction should be published (if supported by the provider). |

**Output**

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

***

### create

`posts.create`

Publish a post on LinkedIn or Instagram. It goes live publicly right away (Instagram needs media). LinkedIn supports mentions, audience and posting as a managed company page. Never retried after a timeout or 5xx

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.posts.create({ account_id: 'acc_9f2c1d7e', text: 'We just shipped our field data toolkit.' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `text` | `string` | Yes | Textual content of the post. User mentions can be added by inserting an @ followed by the ID or public identifier of the user (example: @JohnDoe). |
| `attachments` | `object[]` | No | The list of files to appear in the post. |
| `can_read` | `anyone \| relations_only` | No | The visibility level for the new post (if supported by the provider). - `anyone` is visible to anyone. - `relations_only` is visible only to the user's relations. |
| `can_comment` | `anyone \| relations_only \| no_one` | No | The comment control level for the new post (if supported by the provider). - `anyone` anyone can comment. - `relations_only` only to the user's relations can comment. - `no_one` no one can comment. |
| `quoted_post_id` | `string` | No | The ID of a Post to be quoted. For a simple repost without commentary, leave `text` as an empty string. |
| `post_as` | `string` | No | The ID of the User on whose behalf the post should be published (if supported by the provider). |
| `specifics` | `object` | No | — |

> **attachments full type**
>
> ```ts theme={null}
> {
>   content: string,
>   content_type: string,
>   filename: string,
>   metadata?: {
>     duration?: number
>   }
> }[]
> ```

> **specifics full type**
>
> ```ts theme={null}
> {
>   instagram?: {
>     location_id?: string
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the post for the provider. |
| `share_url` | `string` | Yes | The URL to share the post. |
| `created_at` | `string` | Yes | The creation date of the post. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `title` | `string` | No | The title of the post. |
| `text` | `string` | Yes | The text content of the post. |
| `author` | `object` | Yes | The author of the post. |
| `user_reacted` | `boolean \| string` | Yes | If the account owner has reacted to this post, the value of the reaction (emoji unicode or reaction type), `true` if no details on the reaction, else `false`. |
| `permissions` | `object` | Yes | The permissions for the account owner on the post. |
| `reactions_counter` | `object[]` | No | The counter of reactions to the post. `null` if counter is hidden. |
| `comments_counter` | `number` | No | The number of comments to the post. `null` if counter is hidden. |
| `reposts_counter` | `number` | No | The number of reposts of the post. `null` if counter is hidden. |
| `poll` | `object` | No | Data about the poll if the post is a poll. |
| `event` | `object` | No | Data about the event if the post is an event. |
| `attachments` | `object[]` | Yes | List of post attachments. |
| `analytics` | `object` | No | Analytics data of the post. |
| `specifics` | `any` | No | Object containing provider-specific post data. |
| `is_repost` | `boolean` | Yes | `true` if this post is reposted by someone without quote. Quoted post does not qualify as a repost. |
| `reposted_by` | `object` | No | The user who reposted the post if `is_repost` is `true`. |
| `quoted_post` | `object` | No | The post that is quoted in this post. |

> **author full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: any | null
> }
> ```

> **permissions full type**
>
> ```ts theme={null}
> {
>   can_share: boolean,
>   can_react: boolean,
>   can_post_comments: boolean
> }
> ```

> **reactions\_counter full type**
>
> ```ts theme={null}
> {
>   reaction: string,
>   count: number
> }[]
> ```

> **poll full type**
>
> ```ts theme={null}
> {
>   id: string,
>   total_votes_count: number,
>   question: string,
>   is_open: boolean,
>   options: any[]
> }
> ```

> **event full type**
>
> ```ts theme={null}
> {
>   id: string,
>   name: string,
>   url?: string | null,
>   online: boolean,
>   location?: string | null,
>   description?: string | null,
>   public_picture_url?: string | null,
>   starts_on?: string | null,
>   ends_on?: string | null
> }
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   file_size?: number | null,
>   is_inline?: boolean | null,
>   content_id?: string | null,
>   is_unavailable?: boolean | null,
>   mimetype?: string | null,
>   url?: string | null,
>   url_expires_at?: string | null,
>   content?: string | null,
>   type?: string | null,
>   duration?: number | null,
>   voice_note?: boolean | null,
>   size?: {
>   } | null,
>   sticker?: boolean | null,
>   gif?: boolean | null,
>   filename?: string | null,
>   media_type?: string | null,
>   author?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   organization?: string | null,
>   phones?: any[] | null,
>   emails?: any[] | null
> }[]
> ```

> **analytics full type**
>
> ```ts theme={null}
> {
>   impressions_counter?: number | null,
>   engagements_counter?: number | null,
>   engagement_rate?: number | null,
>   clicks_counter?: number | null,
>   clickthrough_rate?: number | null,
>   page_viewers_from_this_post_counter?: number | null,
>   followers_gained_from_this_post_counter?: number | null,
>   users_reached_counter?: number | null
> }
> ```

> **reposted\_by full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: any | null
> }
> ```

> **quoted\_post full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   share_url: string,
>   created_at: string,
>   title?: string | null,
>   text: string,
>   author: {
>     id: string,
>     object: string,
>     type: string,
>     public_identifier?: string | null,
>     display_name: string,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     private_picture_download_url?: string | null,
>     description?: string | null,
>     specifics?: any | null
>   },
>   user_reacted: boolean | string,
>   permissions: {
>     can_share: boolean,
>     can_react: boolean,
>     can_post_comments: boolean
>   },
>   reactions_counter?: any[] | null,
>   comments_counter?: number | null,
>   reposts_counter?: number | null,
>   poll?: {
>     id: string,
>     total_votes_count: number,
>     question: string,
>     is_open: boolean,
>     options: any[]
>   } | null,
>   event?: {
>     id: string,
>     name: string,
>     url?: string | null,
>     online: boolean,
>     location?: string | null,
>     description?: string | null,
>     public_picture_url?: string | null,
>     starts_on?: string | null,
>     ends_on?: string | null
>   } | null,
>   attachments: any[],
>   analytics?: {
>     impressions_counter?: number | null,
>     engagements_counter?: number | null,
>     engagement_rate?: number | null,
>     clicks_counter?: number | null,
>     clickthrough_rate?: number | null,
>     page_viewers_from_this_post_counter?: number | null,
>     followers_gained_from_this_post_counter?: number | null,
>     users_reached_counter?: number | null
>   } | null,
>   specifics?: any | null
> }
> ```

***

### createStory

`posts.createStory`

Publish an Instagram story with exactly one image or video. It goes live publicly right away

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.posts.createStory({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `attachment` | `object` | Yes | A file to be uploaded. |
| `text` | `string` | No | Optional caption for the story. User mentions can be added by inserting an @ followed by the ID or public identifier of the user (example: @JohnDoe), if supported by the provider. |
| `specifics` | `object` | No | — |

> **attachment full type**
>
> ```ts theme={null}
> {
>   content: string,
>   content_type: string,
>   filename: string,
>   metadata?: {
>     duration?: number
>   }
> }
> ```

> **specifics full type**
>
> ```ts theme={null}
> {
>   instagram?: {
>     location?: {
>       id: string,
>       name: string
>     }
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the story for the provider. |
| `provider_id` | `string` | Yes | The story's raw provider-native identifier. |
| `media_type` | `string` | Yes | The type of media attached to the story. |
| `created_at` | `string` | Yes | The creation date of the story. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `expires_at` | `string` | No | The expiration date of the story (\~24h after creation, if supported by the provider). Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |

***

### delete

`posts.delete`

Delete a post the account published (Unipile post ID)

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

```ts theme={null}
await corsair.unipile.api.posts.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The ID of the Post to delete. Use IDs from *Get a Post*, *Create a Post* or *List all User's Posts* methods responses only. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### deleteComment

`posts.deleteComment`

Delete a comment the account wrote

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

```ts theme={null}
await corsair.unipile.api.posts.deleteComment({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The ID of the Post where the comment is. Use IDs from *Get a Post*, *Create a Post* or *List all User's Posts* methods responses only. |
| `comment_id` | `string` | Yes | The ID of the Comment to delete. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### get

`posts.get`

Get one post by its Unipile ID or a native LinkedIn ID (activity:…, ugcPost:…). LinkedIn post reads count toward a daily limit (about 80-100), so this is not retried after a timeout or 5xx

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.posts.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The ID of the Post to retrieve. Use IDs from *Get a Post*, *Create a Post* or *List all User's Posts* methods responses only. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the post for the provider. |
| `share_url` | `string` | Yes | The URL to share the post. |
| `created_at` | `string` | Yes | The creation date of the post. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `title` | `string` | No | The title of the post. |
| `text` | `string` | Yes | The text content of the post. |
| `user_reacted` | `boolean \| string` | Yes | If the account owner has reacted to this post, the value of the reaction (emoji unicode or reaction type), `true` if no details on the reaction, else `false`. |
| `permissions` | `object` | Yes | The permissions for the account owner on the post. |
| `reactions_counter` | `object[]` | No | The counter of reactions to the post. `null` if counter is hidden. |
| `comments_counter` | `number` | No | The number of comments to the post. `null` if counter is hidden. |
| `reposts_counter` | `number` | No | The number of reposts of the post. `null` if counter is hidden. |
| `poll` | `object` | No | Data about the poll if the post is a poll. |
| `event` | `object` | No | Data about the event if the post is an event. |
| `attachments` | `object[]` | Yes | List of post attachments. |
| `analytics` | `object` | No | Analytics data of the post. |
| `is_repost` | `boolean` | Yes | `true` if this post is reposted by someone without quote. Quoted post does not qualify as a repost. |
| `author` | `object` | Yes | The author of the post. |
| `reposted_by` | `object` | No | The user who reposted the post if `is_repost` is `true`. |
| `quoted_post` | `object` | No | The post that is quoted in this post. |
| `specifics` | `object` | No | Object containing provider-specific post data. |

> **permissions full type**
>
> ```ts theme={null}
> {
>   can_share: boolean,
>   can_react: boolean,
>   can_post_comments: boolean
> }
> ```

> **reactions\_counter full type**
>
> ```ts theme={null}
> {
>   reaction: string,
>   count: number
> }[]
> ```

> **poll full type**
>
> ```ts theme={null}
> {
>   id: string,
>   total_votes_count: number,
>   question: string,
>   is_open: boolean,
>   options: any[]
> }
> ```

> **event full type**
>
> ```ts theme={null}
> {
>   id: string,
>   name: string,
>   url?: string | null,
>   online: boolean,
>   location?: string | null,
>   description?: string | null,
>   public_picture_url?: string | null,
>   starts_on?: string | null,
>   ends_on?: string | null
> }
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   file_size?: number | null,
>   is_inline?: boolean | null,
>   content_id?: string | null,
>   is_unavailable?: boolean | null,
>   mimetype?: string | null,
>   url?: string | null,
>   url_expires_at?: string | null,
>   content?: string | null,
>   type?: string | null,
>   duration?: number | null,
>   voice_note?: boolean | null,
>   size?: {
>   } | null,
>   sticker?: boolean | null,
>   gif?: boolean | null,
>   filename?: string | null,
>   media_type?: string | null,
>   author?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   organization?: string | null,
>   phones?: any[] | null,
>   emails?: any[] | null
> }[]
> ```

> **analytics full type**
>
> ```ts theme={null}
> {
>   impressions_counter?: number | null,
>   engagements_counter?: number | null,
>   engagement_rate?: number | null,
>   clicks_counter?: number | null,
>   clickthrough_rate?: number | null,
>   page_viewers_from_this_post_counter?: number | null,
>   followers_gained_from_this_post_counter?: number | null,
>   users_reached_counter?: number | null
> }
> ```

> **author full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: {
>     contact_name?: string | null,
>     messaging_identifier?: string | null,
>     location?: string | null,
>     network_distance?: string | null,
>     industry?: string | null,
>     is_following?: boolean | null,
>     followers_count?: number | null,
>     relations_count?: number | null,
>     shared_relations_count?: number | null,
>     website_url?: string | null,
>     portfolio_url?: string | null,
>     services_page_url?: string | null,
>     is_premium?: boolean | null,
>     is_verified?: boolean | null
>   } | null
> }
> ```

> **reposted\_by full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: {
>     contact_name?: string | null,
>     messaging_identifier?: string | null,
>     location?: string | null,
>     network_distance?: string | null,
>     industry?: string | null,
>     is_following?: boolean | null,
>     followers_count?: number | null,
>     relations_count?: number | null,
>     shared_relations_count?: number | null,
>     website_url?: string | null,
>     portfolio_url?: string | null,
>     services_page_url?: string | null,
>     is_premium?: boolean | null,
>     is_verified?: boolean | null
>   } | null
> }
> ```

> **quoted\_post full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   share_url: string,
>   created_at: string,
>   title?: string | null,
>   text: string,
>   user_reacted: boolean | string,
>   permissions: {
>     can_share: boolean,
>     can_react: boolean,
>     can_post_comments: boolean
>   },
>   reactions_counter?: any[] | null,
>   comments_counter?: number | null,
>   reposts_counter?: number | null,
>   poll?: {
>     id: string,
>     total_votes_count: number,
>     question: string,
>     is_open: boolean,
>     options: any[]
>   } | null,
>   event?: {
>     id: string,
>     name: string,
>     url?: string | null,
>     online: boolean,
>     location?: string | null,
>     description?: string | null,
>     public_picture_url?: string | null,
>     starts_on?: string | null,
>     ends_on?: string | null
>   } | null,
>   attachments: any[],
>   analytics?: {
>     impressions_counter?: number | null,
>     engagements_counter?: number | null,
>     engagement_rate?: number | null,
>     clicks_counter?: number | null,
>     clickthrough_rate?: number | null,
>     page_viewers_from_this_post_counter?: number | null,
>     followers_gained_from_this_post_counter?: number | null,
>     users_reached_counter?: number | null
>   } | null,
>   author: {
>     id: string,
>     object: string,
>     type: string,
>     public_identifier?: string | null,
>     display_name: string,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     private_picture_download_url?: string | null,
>     description?: string | null,
>     specifics?: {
>     } | null
>   },
>   specifics?: {
>     mentions?: any[] | null,
>     job_posting?: {
>     } | null,
>     article?: {
>     } | null
>   } | null
> }
> ```

> **specifics full type**
>
> ```ts theme={null}
> {
>   mentions?: any[] | null,
>   job_posting?: {
>     id?: string | null,
>     title: string,
>     location: string,
>     company: {
>     }
>   } | null,
>   article?: {
>     id?: string | null,
>     title: string,
>     author?: string | null,
>     url?: string | null,
>     published_at?: string | null,
>     excerpt?: string | null,
>     picture_url?: string | null
>   } | null
> }
> ```

***

### list

`posts.list`

List a user's posts (LinkedIn or Instagram) with reaction, comment and repost counts. LinkedIn post reads count toward a daily limit (about 80-100), so this is not retried after a timeout or 5xx

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.posts.list({ account_id: 'acc_9f2c1d7e', user_id: 'williamhgates' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `user_id` | `string` | Yes | Provider user ID. For LinkedIn, the member ID (ACo…) or public identifier from a profile URL; `me` is the account owner |
| `offset` | `number` | No | Offset pagination: add the previous limit to get the next page. Use `cursor` instead when the previous page returned next\_cursor |
| `cursor` | `string` | No | next\_cursor from the previous page. Send it alone, without offset |
| `limit` | `number` | No | Page size. Leave unset to use the provider's own page size, which Unipile recommends |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | — |
| `next_cursor` | `string` | No | Pass as cursor to get the next page; absent on the last page |

> **data full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id: string,
>   share_url?: string | null,
>   created_at?: string | null,
>   title?: string | null,
>   text?: string | null,
>   author?: {
>     id: string,
>     object?: string | null,
>     type?: string | null,
>     public_identifier?: string | null,
>     display_name?: string | null,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     description?: string | null,
>     specifics?: {
>       location?: string | null,
>       network_distance?: string | null,
>       industry?: string | null,
>       is_following?: boolean | null,
>       followers_count?: number | null,
>       relations_count?: number | null,
>       shared_relations_count?: number | null,
>       is_premium?: boolean | null,
>       is_verified?: boolean | null
>     } | null
>   } | null,
>   is_repost?: boolean | null,
>   comments_counter?: number | null,
>   reposts_counter?: number | null,
>   reactions_counter?: {
>     reaction: string,
>     count: number
>   }[] | null,
>   attachments?: any[] | null
> }[]
> ```

***

### listCommentReactions

`posts.listCommentReactions`

List who reacted to a comment with what (LinkedIn pages by offset)

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.posts.listCommentReactions({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The ID of the Post where the comment is. Use IDs from *Get a Post*, *Create a Post* or *List all User's Posts* methods responses only. |
| `comment_id` | `string` | Yes | The ID of the Comment to retrieve reactions from. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   value: string,
>   is_sender: boolean,
>   sender: {
>   }
> }[]
> ```

***

### listCommentReplies

`posts.listCommentReplies`

List the replies to a comment, newest first (LinkedIn pages by offset)

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.posts.listCommentReplies({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The ID of the Post where the comment is. Use IDs from *Get a Post*, *Create a Post* or *List all User's Posts* methods responses only. |
| `comment_id` | `string` | Yes | The ID of the Comment to retrieve replies from. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   thread_id?: string | null,
>   created_at: string,
>   text: string,
>   attachments: any[],
>   is_sender: boolean,
>   can_reply: boolean,
>   can_react: boolean,
>   reply_counter: number,
>   impressions_counter?: number | null,
>   reactions_counter: any[],
>   author: {
>   }
> }[]
> ```

***

### listComments

`posts.listComments`

List the comments on a post with each author, newest or most relevant first

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.posts.listComments({ account_id: 'acc_9f2c1d7e', post_id: 'urn:li:activity:7250000000000000000', sort_by: 'MOST_RECENT' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `post_id` | `string` | Yes | Post ID from posts.list (Unipile post IDs, not share URLs) |
| `sort_by` | `MOST_RECENT \| MOST_RELEVANT` | No | — |
| `offset` | `number` | No | Offset pagination: add the previous limit to get the next page. Use `cursor` instead when the previous page returned next\_cursor |
| `cursor` | `string` | No | next\_cursor from the previous page. Send it alone, without offset |
| `limit` | `number` | No | Page size. Leave unset to use the provider's own page size, which Unipile recommends |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | — |
| `next_cursor` | `string` | No | Pass as cursor to get the next page; absent on the last page |

> **data full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id: string,
>   thread_id?: string | null,
>   created_at?: string | null,
>   text?: string | null,
>   is_sender?: boolean | null,
>   reply_counter?: number | null,
>   author?: {
>     id: string,
>     object?: string | null,
>     type?: string | null,
>     public_identifier?: string | null,
>     display_name?: string | null,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     description?: string | null,
>     specifics?: {
>       location?: string | null,
>       network_distance?: string | null,
>       industry?: string | null,
>       is_following?: boolean | null,
>       followers_count?: number | null,
>       relations_count?: number | null,
>       shared_relations_count?: number | null,
>       is_premium?: boolean | null,
>       is_verified?: boolean | null
>     } | null
>   } | null
> }[]
> ```

***

### listReactions

`posts.listReactions`

List the people who reacted to a post, with their profile summary, to find engaged leads

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.posts.listReactions({ account_id: 'acc_9f2c1d7e', post_id: 'urn:li:activity:7250000000000000000' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `post_id` | `string` | Yes | Post ID from posts.list (Unipile post IDs, not share URLs) |
| `offset` | `number` | No | Offset pagination: add the previous limit to get the next page. Use `cursor` instead when the previous page returned next\_cursor |
| `cursor` | `string` | No | next\_cursor from the previous page. Send it alone, without offset |
| `limit` | `number` | No | Page size. Leave unset to use the provider's own page size, which Unipile recommends |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | — |
| `next_cursor` | `string` | No | Pass as cursor to get the next page; absent on the last page |

> **data full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   value: string,
>   is_sender?: boolean | null,
>   sender: {
>     id: string,
>     object?: string | null,
>     type?: string | null,
>     public_identifier?: string | null,
>     display_name?: string | null,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     description?: string | null,
>     specifics?: {
>       location?: string | null,
>       network_distance?: string | null,
>       industry?: string | null,
>       is_following?: boolean | null,
>       followers_count?: number | null,
>       relations_count?: number | null,
>       shared_relations_count?: number | null,
>       is_premium?: boolean | null,
>       is_verified?: boolean | null
>     } | null
>   }
> }[]
> ```

***

### removeCommentReaction

`posts.removeCommentReaction`

Remove the account's reaction from a comment (pass the same reaction)

**Risk:** `destructive`

```ts theme={null}
await corsair.unipile.api.posts.removeCommentReaction({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The ID of the Post where the comment is. Use IDs from *Get a Post*, *Create a Post* or *List all User's Posts* methods responses only. |
| `comment_id` | `string` | Yes | The ID of the Comment where the reaction is. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `reaction` | `string \| linkedin_like \| linkedin_celebrate \| linkedin_support \| linkedin_love \| linkedin_insightful \| linkedin_funny \| instagram_like` | Yes | — |

**Output**

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

***

### removeReaction

`posts.removeReaction`

Remove the account's reaction from a post (pass the same reaction)

**Risk:** `destructive`

```ts theme={null}
await corsair.unipile.api.posts.removeReaction({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The ID of the Post where the reaction is. Use IDs from *Get a Post*, *Create a Post* or *List all User's Posts* methods responses only. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `reaction` | `string \| linkedin_like \| linkedin_celebrate \| linkedin_support \| linkedin_love \| linkedin_insightful \| linkedin_funny \| instagram_like` | Yes | — |

**Output**

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

***

### replyToComment

`posts.replyToComment`

Reply to a comment, optionally as a managed LinkedIn company page. The reply is public. Never retried after a timeout or 5xx

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.posts.replyToComment({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The ID of the Post to add the comment to. Use IDs from *Get a Post*, *Create a Post* or *List all User's Posts* methods responses only. |
| `comment_id` | `string` | Yes | The ID of the Comment to reply to. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `text` | `string` | Yes | Textual content of the comment. User mentions can be added by inserting an @ followed by the `id` or `public_identifier` of the user (example: @JohnDoe). |
| `comment_as` | `string` | No | The ID of the User on whose behalf the comment should be published (if supported by the provider). |
| `attachments` | `object[]` | No | Attachment associated with the comment |

> **attachments full type**
>
> ```ts theme={null}
> {
>   content: string,
>   content_type: string,
>   filename: string,
>   metadata?: {
>     duration?: number
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the comment. |
| `thread_id` | `string` | No | The ID of the thread if this is a reply to another comment. |
| `author` | `object` | Yes | The author of the comment. |
| `created_at` | `string` | Yes | The creation date of the comment. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `text` | `string` | Yes | The text content of the comment. |
| `attachments` | `object[]` | Yes | List of comment attachments. |
| `is_sender` | `boolean` | Yes | Is the current user the sender of the comment. |
| `can_reply` | `boolean` | Yes | Whether the current user can reply to the comment or not. |
| `can_react` | `boolean` | Yes | Whether the current user can react to the comment or not. |
| `reply_counter` | `number` | Yes | The number of replies to the comment. |
| `impressions_counter` | `number` | No | The number of impressions of the comment. |
| `reactions_counter` | `object[]` | Yes | A list of reactions to the element. |

> **author full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: any | null
> }
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   file_size?: number | null,
>   is_inline?: boolean | null,
>   content_id?: string | null,
>   is_unavailable?: boolean | null,
>   mimetype?: string | null,
>   url?: string | null,
>   url_expires_at?: string | null,
>   content?: string | null,
>   type?: string | null,
>   duration?: number | null,
>   voice_note?: boolean | null,
>   size?: {
>   } | null,
>   sticker?: boolean | null,
>   gif?: boolean | null,
>   filename?: string | null,
>   media_type?: string | null,
>   author?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   organization?: string | null,
>   phones?: any[] | null,
>   emails?: any[] | null
> }[]
> ```

> **reactions\_counter full type**
>
> ```ts theme={null}
> {
>   reaction: string,
>   count: number
> }[]
> ```

***

### update

`posts.update`

Edit a post the account published (Unipile post ID). The change is public

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.posts.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The ID of the Post to update. Use IDs from *Get a Post*, *Create a Post* or *List all User's Posts* methods responses only. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `text` | `string` | No | Textual content of the post. User mentions can be added by inserting an @ followed by the ID or public identifier of the user (example: @JohnDoe). |
| `can_comment` | `anyone \| relations_only \| no_one` | No | The comment control level for the new post (if supported by the provider). - `anyone` is visible to anyone. - `relations_only` is visible only to the user's relations. - `no_one` is visible to no one. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the post for the provider. |
| `share_url` | `string` | Yes | The URL to share the post. |
| `created_at` | `string` | Yes | The creation date of the post. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `title` | `string` | No | The title of the post. |
| `text` | `string` | Yes | The text content of the post. |
| `author` | `object` | Yes | The author of the post. |
| `user_reacted` | `boolean \| string` | Yes | If the account owner has reacted to this post, the value of the reaction (emoji unicode or reaction type), `true` if no details on the reaction, else `false`. |
| `permissions` | `object` | Yes | The permissions for the account owner on the post. |
| `reactions_counter` | `object[]` | No | The counter of reactions to the post. `null` if counter is hidden. |
| `comments_counter` | `number` | No | The number of comments to the post. `null` if counter is hidden. |
| `reposts_counter` | `number` | No | The number of reposts of the post. `null` if counter is hidden. |
| `poll` | `object` | No | Data about the poll if the post is a poll. |
| `event` | `object` | No | Data about the event if the post is an event. |
| `attachments` | `object[]` | Yes | List of post attachments. |
| `analytics` | `object` | No | Analytics data of the post. |
| `specifics` | `any` | No | Object containing provider-specific post data. |
| `is_repost` | `boolean` | Yes | `true` if this post is reposted by someone without quote. Quoted post does not qualify as a repost. |
| `reposted_by` | `object` | No | The user who reposted the post if `is_repost` is `true`. |
| `quoted_post` | `object` | No | The post that is quoted in this post. |

> **author full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: any | null
> }
> ```

> **permissions full type**
>
> ```ts theme={null}
> {
>   can_share: boolean,
>   can_react: boolean,
>   can_post_comments: boolean
> }
> ```

> **reactions\_counter full type**
>
> ```ts theme={null}
> {
>   reaction: string,
>   count: number
> }[]
> ```

> **poll full type**
>
> ```ts theme={null}
> {
>   id: string,
>   total_votes_count: number,
>   question: string,
>   is_open: boolean,
>   options: any[]
> }
> ```

> **event full type**
>
> ```ts theme={null}
> {
>   id: string,
>   name: string,
>   url?: string | null,
>   online: boolean,
>   location?: string | null,
>   description?: string | null,
>   public_picture_url?: string | null,
>   starts_on?: string | null,
>   ends_on?: string | null
> }
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   file_size?: number | null,
>   is_inline?: boolean | null,
>   content_id?: string | null,
>   is_unavailable?: boolean | null,
>   mimetype?: string | null,
>   url?: string | null,
>   url_expires_at?: string | null,
>   content?: string | null,
>   type?: string | null,
>   duration?: number | null,
>   voice_note?: boolean | null,
>   size?: {
>   } | null,
>   sticker?: boolean | null,
>   gif?: boolean | null,
>   filename?: string | null,
>   media_type?: string | null,
>   author?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   organization?: string | null,
>   phones?: any[] | null,
>   emails?: any[] | null
> }[]
> ```

> **analytics full type**
>
> ```ts theme={null}
> {
>   impressions_counter?: number | null,
>   engagements_counter?: number | null,
>   engagement_rate?: number | null,
>   clicks_counter?: number | null,
>   clickthrough_rate?: number | null,
>   page_viewers_from_this_post_counter?: number | null,
>   followers_gained_from_this_post_counter?: number | null,
>   users_reached_counter?: number | null
> }
> ```

> **reposted\_by full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: any | null
> }
> ```

> **quoted\_post full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   share_url: string,
>   created_at: string,
>   title?: string | null,
>   text: string,
>   author: {
>     id: string,
>     object: string,
>     type: string,
>     public_identifier?: string | null,
>     display_name: string,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     private_picture_download_url?: string | null,
>     description?: string | null,
>     specifics?: any | null
>   },
>   user_reacted: boolean | string,
>   permissions: {
>     can_share: boolean,
>     can_react: boolean,
>     can_post_comments: boolean
>   },
>   reactions_counter?: any[] | null,
>   comments_counter?: number | null,
>   reposts_counter?: number | null,
>   poll?: {
>     id: string,
>     total_votes_count: number,
>     question: string,
>     is_open: boolean,
>     options: any[]
>   } | null,
>   event?: {
>     id: string,
>     name: string,
>     url?: string | null,
>     online: boolean,
>     location?: string | null,
>     description?: string | null,
>     public_picture_url?: string | null,
>     starts_on?: string | null,
>     ends_on?: string | null
>   } | null,
>   attachments: any[],
>   analytics?: {
>     impressions_counter?: number | null,
>     engagements_counter?: number | null,
>     engagement_rate?: number | null,
>     clicks_counter?: number | null,
>     clickthrough_rate?: number | null,
>     page_viewers_from_this_post_counter?: number | null,
>     followers_gained_from_this_post_counter?: number | null,
>     users_reached_counter?: number | null
>   } | null,
>   specifics?: any | null
> }
> ```

***

### updateComment

`posts.updateComment`

Edit a comment the account wrote (LinkedIn only). The change is public

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.posts.updateComment({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `post_id` | `string` | Yes | The ID of the Post where the comment is. Use IDs from *Get a Post*, *Create a Post* or *List all User's Posts* methods responses only. |
| `comment_id` | `string` | Yes | The ID of the Comment to update. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `text` | `string` | Yes | Updated textual content of the comment. User mentions can be added by inserting an @ followed by the `id` or `public_identifier` of the user (example: @JohnDoe). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `id` | `string` | Yes | The ID of the comment. |
| `thread_id` | `string` | No | The ID of the thread if this is a reply to another comment. |
| `author` | `object` | Yes | The author of the comment. |
| `created_at` | `string` | Yes | The creation date of the comment. Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `text` | `string` | Yes | The text content of the comment. |
| `attachments` | `object[]` | Yes | List of comment attachments. |
| `is_sender` | `boolean` | Yes | Is the current user the sender of the comment. |
| `can_reply` | `boolean` | Yes | Whether the current user can reply to the comment or not. |
| `can_react` | `boolean` | Yes | Whether the current user can react to the comment or not. |
| `reply_counter` | `number` | Yes | The number of replies to the comment. |
| `impressions_counter` | `number` | No | The number of impressions of the comment. |
| `reactions_counter` | `object[]` | Yes | A list of reactions to the element. |

> **author full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: any | null
> }
> ```

> **attachments full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id?: string | null,
>   file_size?: number | null,
>   is_inline?: boolean | null,
>   content_id?: string | null,
>   is_unavailable?: boolean | null,
>   mimetype?: string | null,
>   url?: string | null,
>   url_expires_at?: string | null,
>   content?: string | null,
>   type?: string | null,
>   duration?: number | null,
>   voice_note?: boolean | null,
>   size?: {
>   } | null,
>   sticker?: boolean | null,
>   gif?: boolean | null,
>   filename?: string | null,
>   media_type?: string | null,
>   author?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   organization?: string | null,
>   phones?: any[] | null,
>   emails?: any[] | null
> }[]
> ```

> **reactions\_counter full type**
>
> ```ts theme={null}
> {
>   reaction: string,
>   count: number
> }[]
> ```

***

## Relation Requests

### accept

`relationRequests.accept`

Accept a LinkedIn invitation the account received

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.relationRequests.accept({ account_id: 'acc_9f2c1d7e', request_id: 'inv_7d8e9f' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `request_id` | `string` | Yes | Relation request ID from relationRequests.list |

**Output**

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

***

### cancel

`relationRequests.cancel`

Withdraw a sent LinkedIn invitation or decline a received one. LinkedIn may block re-inviting the same person for weeks

**Risk:** `destructive`

```ts theme={null}
await corsair.unipile.api.relationRequests.cancel({ account_id: 'acc_9f2c1d7e', request_id: 'inv_7d8e9f' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `request_id` | `string` | Yes | Relation request ID from relationRequests.list |

**Output**

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

***

### create

`relationRequests.create`

Send a LinkedIn connection invitation to a member ID (ACo…), with an optional note. LinkedIn allows roughly 100-200 a week; pace sends and never retry a failed one blindly

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.relationRequests.create({ account_id: 'acc_9f2c1d7e', user_id: 'ACoAAB1cDeFgHiJkLmNoPqRsTuVwXyZ0123456', message: 'Hi Maya, I enjoyed your post on field data.' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `user_id` | `string` | Yes | LinkedIn member ID (ACo…) of the person to invite |
| `message` | `string` | No | Invitation note. LinkedIn caps it at 300 characters (200 on free accounts) and allows few notes a month on free accounts |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `id` | `string` | Yes | — |
| `type` | `string` | Yes | sent or received |
| `created_at` | `string` | No | — |
| `message` | `string` | No | — |
| `user` | `object` | No | — |

> **user full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object?: string | null,
>   type?: string | null,
>   public_identifier?: string | null,
>   display_name?: string | null,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   description?: string | null,
>   specifics?: {
>     location?: string | null,
>     network_distance?: string | null,
>     industry?: string | null,
>     is_following?: boolean | null,
>     followers_count?: number | null,
>     relations_count?: number | null,
>     shared_relations_count?: number | null,
>     is_premium?: boolean | null,
>     is_verified?: boolean | null
>   } | null
> }
> ```

***

### list

`relationRequests.list`

List pending LinkedIn invitations the account sent or received, with the other person and any note

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.relationRequests.list({ account_id: 'acc_9f2c1d7e', type: 'received' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `type` | `sent \| received` | Yes | sent: invitations you sent; received: invitations to you |
| `offset` | `number` | No | Offset pagination: add the previous limit to get the next page. Use `cursor` instead when the previous page returned next\_cursor |
| `cursor` | `string` | No | next\_cursor from the previous page. Send it alone, without offset |
| `limit` | `number` | No | Page size. Leave unset to use the provider's own page size, which Unipile recommends |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | — |
| `next_cursor` | `string` | No | Pass as cursor to get the next page; absent on the last page |

> **data full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id: string,
>   type: string,
>   created_at?: string | null,
>   message?: string | null,
>   user?: {
>     id: string,
>     object?: string | null,
>     type?: string | null,
>     public_identifier?: string | null,
>     display_name?: string | null,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     description?: string | null,
>     specifics?: {
>       location?: string | null,
>       network_distance?: string | null,
>       industry?: string | null,
>       is_following?: boolean | null,
>       followers_count?: number | null,
>       relations_count?: number | null,
>       shared_relations_count?: number | null,
>       is_premium?: boolean | null,
>       is_verified?: boolean | null
>     } | null
>   } | null
> }[]
> ```

***

## Sales Navigator

### browseAccountList

`salesNavigator.browseAccountList`

List the companies in a Sales Navigator account list, with filters; offset paging

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.salesNavigator.browseAccountList({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `list_id` | `string` | Yes | The ID of the list to be browsed. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |
| `persona` | `string` | No | A parameter ID. Use List Search Parameters with `PERSONA` type to find out the possible values. Native filter : Persona |
| `filter` | `STARRED \| GROWTH_ALERTS \| RISK_ALERTS` | No | Native filter : Filter companies |
| `sort_by` | `DATE_ADDED \| NAME` | No | The sort method. |
| `sort_order` | `ASCENDING \| DESCENDING` | No | The sort order. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   id: string,
>   display_name: string,
>   public_identifier?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   public_picture_url_large?: string | null,
>   location?: string | null,
>   industry?: string | null,
>   summary?: string | null,
>   relations_count?: number | null,
>   type?: string | null,
>   headcount?: number | null,
>   specialties?: string[] | null,
>   is_hiring_on_linkedin?: boolean | null,
>   lists_count: number,
>   notes_count: number,
>   website?: string | null,
>   founded_on?: number | null,
>   is_starred: boolean,
>   object: string,
>   recommended_lead?: {
>   } | null
> }[]
> ```

***

### browseLeadList

`salesNavigator.browseLeadList`

List the leads in a Sales Navigator lead list, with filters; offset paging

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.salesNavigator.browseLeadList({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `list_id` | `string` | Yes | The ID of the list to be browsed. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |
| `spotlight` | `RECENT_POSITION_CHANGE \| RECENTLY_POSTED_ON_LINKEDIN \| FOLLOW_YOUR_COMPANY \| SHARE_EXPERIENCE` | No | Smart filter to help you prioritize leads. |
| `sort_by` | `DATE_ADDED \| ACCOUNT \| NAME \| OUTREACH_ACTIVITY` | No | The sort method. |
| `sort_order` | `ASCENDING \| DESCENDING` | No | The sort order. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   id: string,
>   member_id?: string | null,
>   display_name: string,
>   public_identifier?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   public_picture_url_large?: string | null,
>   relations_count?: number | null,
>   location?: string | null,
>   headline?: string | null,
>   network_distance: string,
>   can_send_inmail?: boolean | null,
>   shared_relations_count?: number | null,
>   summary?: string | null,
>   has_posted_recently: boolean,
>   has_viewed_your_profile: boolean,
>   was_hired_recently: boolean,
>   was_promoted_recently: boolean,
>   follows_your_company: boolean,
>   is_premium: boolean,
>   is_past_colleague: boolean,
>   is_open_profile: boolean,
>   websites?: string[] | null,
>   addresses?: string[] | null,
>   contact_info: {
>   },
>   latest_contact?: {
>   } | null,
>   lists_count: number,
>   notes_count: number,
>   social_handles?: {
>   } | null,
>   industry?: string | null,
>   education: any[],
>   skills: any[],
>   work_experience: any[],
>   languages: any[],
>   volunteering: any[],
>   object: string,
>   saved_at: string,
>   associated_account?: {
>   } | null
> }[]
> ```

***

### getSearchParameters

`salesNavigator.getSearchParameters`

Look up the IDs Sales Navigator filters need (type COMPANY, LOCATION, INDUSTRY, JOB\_TITLE, PERSONA, LEAD\_LIST, saved and recent searches…; up to 100). Needs Sales Navigator

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.salesNavigator.getSearchParameters({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `keywords` | `string` | No | — |
| `type` | `COMPANY \| ACCOUNT_LIST \| LEAD_LIST \| LOCATION \| POSTAL_CODE \| JOB_FUNCTION \| JOB_TITLE \| INDUSTRY \| GROUP \| SCHOOL \| RELATION \| PERSONA \| SAVED_PEOPLE_SEARCH \| SAVED_COMPANY_SEARCH \| RECENT_SEARCH \| PROFILE_LANGUAGE` | Yes | — |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   name: string,
>   metadata?: {
>   } | null
> }[]
> ```

***

### listAccountLists

`salesNavigator.listAccountLists`

List the account's Sales Navigator account (company) lists; offset paging

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.salesNavigator.listAccountLists({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   type: string,
>   id: string,
>   name: string,
>   description?: string | null,
>   items_count: number,
>   last_modified_at: string,
>   last_viewed_at?: string | null
> }[]
> ```

***

### listLeadLists

`salesNavigator.listLeadLists`

List the account's Sales Navigator lead lists (with several contracts, run linkedin.selectContract first); offset paging

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.salesNavigator.listLeadLists({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   type: string,
>   id: string,
>   name: string,
>   description?: string | null,
>   items_count: number,
>   last_modified_at: string,
>   last_viewed_at?: string | null
> }[]
> ```

***

### saveAccount

`salesNavigator.saveAccount`

Add a company (company\_id from a companies search) to an existing Sales Navigator account list. Lists cannot be created here

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.salesNavigator.saveAccount({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `list_id` | `string` | Yes | The ID of the List to save the Account to. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `company_id` | `string` | Yes | The ID of the Company to be saved as Account to the List. |

**Output**

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

***

### saveLead

`salesNavigator.saveLead`

Add a lead (user\_id from a people search) to an existing Sales Navigator lead list. Lists cannot be created here

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.salesNavigator.saveLead({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `list_id` | `string` | Yes | The ID of the List to save the Lead to. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `user_id` | `string` | Yes | The ID of the User to be saved as Lead to the List. |

**Output**

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

***

### searchCompanies

`salesNavigator.searchCompanies`

Search accounts (companies) in Sales Navigator with include/exclude filters, spotlights and headcount ranges; offset paging, up to 100 per page

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.salesNavigator.searchCompanies({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |
| `keywords` | `string` | No | A keyword or group of keywords. |
| `save_search` | `object` | No | Allows you to save the current search. |
| `load_saved_search` | `object` | No | Saved search to be loaded. Overrides all other filters. |
| `load_recent_search` | `object` | No | Recent search to be loaded. Overrides all other filters. |
| `annual_revenue` | `object` | No | Native filter : Company attributes / Annual revenue |
| `headcount` | `object[]` | No | A list of headcount ranges. |
| `headcount_growth` | `object` | No | Native filter : Company attributes / Company headcount growth |
| `location` | `object` | No | Native filter : Company attributes / Headquarters location / Region |
| `postal_code` | `object` | No | Native filter : Company attributes / Headquarters location / Postal code |
| `industry` | `object` | No | Native filter : Company attributes / Industry |
| `followers` | `object[]` | No | A list of followers ranges. |
| `department_headcount` | `object` | No | Native filter : Company attributes / Department headcount |
| `department_headcount_growth` | `object` | No | Native filter : Company attributes / Department headcount growth |
| `fortune` | `object[]` | No | A list of fortune ranges. |
| `spotlights` | `HIRING_ON_LINKEDIN \| RECENT_LEADERSHIP_CHANGE \| RECENT_FUNDING_EVENTS \| FIRST_DEGREE_CONNECTIONS[]` | No | A list of spotlights. |
| `saved_accounts` | `boolean` | No | Whether to include all your saved accounts in the results. Native filter : Workflow / Saved accounts / All my saved accounts |
| `account_list` | `object` | No | Native filter : Workflow / Account lists |

> **save\_search full type**
>
> ```ts theme={null}
> {
>   name: string
> }
> ```

> **load\_saved\_search full type**
>
> ```ts theme={null}
> {
>   id: string,
>   last_viewed_at?: number
> }
> ```

> **load\_recent\_search full type**
>
> ```ts theme={null}
> {
>   id: string
> }
> ```

> **annual\_revenue full type**
>
> ```ts theme={null}
> {
>   min?: number,
>   max?: number,
>   currency: string
> }
> ```

> **headcount full type**
>
> ```ts theme={null}
> {
>   min?: number,
>   max?: number
> }[]
> ```

> **headcount\_growth full type**
>
> ```ts theme={null}
> {
>   min: number,
>   max: number
> }
> ```

> **location full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **postal\_code full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **industry full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **followers full type**
>
> ```ts theme={null}
> {
>   min?: number,
>   max?: number
> }[]
> ```

> **department\_headcount full type**
>
> ```ts theme={null}
> {
>   min: number,
>   max: number,
>   department: string
> }
> ```

> **department\_headcount\_growth full type**
>
> ```ts theme={null}
> {
>   min: number,
>   max: number,
>   department: string
> }
> ```

> **fortune full type**
>
> ```ts theme={null}
> {
>   min?: number,
>   max?: number
> }[]
> ```

> **account\_list full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   display_name: string,
>   public_identifier?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   public_picture_url_large?: string | null,
>   location?: string | null,
>   industry?: string | null,
>   summary?: string | null,
>   relations_count?: number | null,
>   product: string,
>   type?: string | null,
>   headcount?: number | null,
>   specialties?: string[] | null,
>   is_hiring_on_linkedin?: boolean | null,
>   lists_count: number,
>   notes_count: number,
>   website?: string | null,
>   founded_on?: number | null,
>   has_been_saved: boolean,
>   is_starred: boolean
> }[]
> ```

***

### searchFromUrl

`salesNavigator.searchFromUrl`

Run a Sales Navigator search from a linkedin.com/sales/search/people or /company URL; offset paging, up to 50 per page. Needs Sales Navigator; LinkedIn advises at most 2,500 profiles a day

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.salesNavigator.searchFromUrl({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |
| `url` | `string` | Yes | The URL to perform the search from. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | No | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   member_id?: string | null,
>   display_name: string,
>   public_identifier?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   public_picture_url_large?: string | null,
>   relations_count?: number | null,
>   location?: string | null,
>   headline?: string | null,
>   network_distance: string,
>   can_send_inmail?: boolean | null,
>   product: string,
>   shared_relations_count?: number | null,
>   summary?: string | null,
>   has_been_viewed: boolean,
>   has_been_saved: boolean,
>   has_posted_recently: boolean,
>   has_viewed_your_profile: boolean,
>   was_hired_recently: boolean,
>   was_promoted_recently: boolean,
>   follows_your_company: boolean,
>   is_premium: boolean,
>   is_past_colleague: boolean,
>   is_open_profile: boolean,
>   websites?: string[] | null,
>   addresses?: string[] | null,
>   contact_info: {
>   },
>   latest_contact?: {
>   } | null,
>   lists_count: number,
>   notes_count: number,
>   social_handles?: {
>   } | null,
>   industry?: string | null,
>   education: any[],
>   skills: any[],
>   work_experience: any[],
>   languages: any[],
>   volunteering: any[]
> }[]
> ```

***

### searchPeople

`salesNavigator.searchPeople`

Search leads in Sales Navigator with include/exclude filters (IDs from salesNavigator.getSearchParameters) or a saved search; offset paging, up to 100 per page. LinkedIn advises at most 2,500 profiles a day

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.salesNavigator.searchPeople({ account_id: 'acc_9f2c1d7e', keywords: 'platform engineering', limit: 25 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |
| `keywords` | `string` | No | A keyword or group of keywords. |
| `save_search` | `object` | No | Allows you to save the current search. |
| `load_saved_search` | `object` | No | Saved search to be loaded. Overrides all other filters. |
| `load_recent_search` | `object` | No | Recent search to be loaded. Overrides all other filters. |
| `current_company` | `object` | No | You can also use company names in plain text format. Native filter : Company / Current company |
| `past_company` | `object` | No | You can also use company names in plain text format. Native filter : Company / Past company |
| `company_headcount` | `object[]` | No | A list of headcount ranges. |
| `company_type` | `PUBLIC_COMPANY \| PRIVATELY_HELD \| NON_PROFIT \| EDUCATIONAL_INSTITUTION \| PARTNERSHIP \| SELF_EMPLOYED \| SELF_OWNED \| GOVERNMENT_AGENCY[]` | No | A list of company types. |
| `company_location` | `object` | No | Native filter : Company / Company headquarters location |
| `function` | `object` | No | Native filter : Role / Function |
| `current_job_title` | `object` | No | You can also use job titles in plain text format. Native filter : Role / Current job title |
| `past_job_title` | `object` | No | You can also use job titles in plain text format. Native filter : Role / Past job title |
| `seniority` | `object` | No | Native filter : Role / Seniority level |
| `years_in_company` | `object[]` | No | A list of years ranges. |
| `years_in_position` | `object[]` | No | A list of years ranges. |
| `location` | `object` | No | Native filter : Personal / Geography / Region |
| `postal_code` | `object` | No | Native filter : Personal / Geography / Postal code |
| `industry` | `object` | No | Native filter : Personal / Industry |
| `first_name` | `string[]` | No | A list of names. |
| `last_name` | `string[]` | No | A list of names. |
| `profile_language` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `PROFILE_LANGUAGE` type to find out the possible values. Native filter : Personal / Profile language |
| `years_of_experience` | `object[]` | No | A list of years ranges. |
| `group` | `object` | No | Native filter : Personal / Groups |
| `school` | `object` | No | Native filter : Personal / School |
| `following_your_company` | `boolean` | No | Whether the users are following your company. Native filter : Buyer intent / Following your company |
| `viewed_your_profile_recently` | `boolean` | No | Whether the users visited your profile recently. Native filter : Buyer intent / Viewed your profile recently |
| `network_distance` | `(number \| GROUP)[]` | No | A list of connection degrees (1 for First, 2 for Second, 3 for Third+ and GROUP for Common group members). Native filter : Best path in / Connection |
| `connections_of` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `RELATION` type to find out the possible values. Native filter : Best path in / Connections of |
| `past_colleague` | `boolean` | No | Whether the users are past colleagues of yours. Native filter : Best path in / Past colleague |
| `shared_experiences` | `boolean` | No | Whether the users share professionnal experiences with you. Native filter : Buyer intent / Shared experiences |
| `changed_jobs` | `boolean` | No | Whether the users recently changed jobs. Native filter : Recent updates / Changed jobs |
| `posted_on_linkedin` | `boolean` | No | Whether the users recently published posts on LinkedIn. Native filter : Recent updates / Posted on Linkedin |
| `persona` | `string[]` | No | A list of parameter IDs. Use List Search Parameters with `PERSONA` type to find out the possible values. Native filter : Workflow / Persona |
| `account_list` | `object` | No | Native filter : Workflow / Account lists |
| `lead_list` | `object` | No | Native filter : Workflow / Lead lists |
| `recent_interaction` | `object` | No | Native filter : Workflow / People you interacted with |
| `saved_resources` | `object` | No | Native filter : Workflow / Saved leads and accounts |

> **save\_search full type**
>
> ```ts theme={null}
> {
>   name: string
> }
> ```

> **load\_saved\_search full type**
>
> ```ts theme={null}
> {
>   id: string,
>   last_viewed_at?: number
> }
> ```

> **load\_recent\_search full type**
>
> ```ts theme={null}
> {
>   id: string
> }
> ```

> **current\_company full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **past\_company full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **company\_headcount full type**
>
> ```ts theme={null}
> {
>   min?: number,
>   max?: number
> }[]
> ```

> **company\_location full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **function full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **current\_job\_title full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **past\_job\_title full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **seniority full type**
>
> ```ts theme={null}
> {
>   include?: OWNER/PARTNER | CXO | VICE_PRESIDENT | DIRECTOR | EXPERIENCED_MANAGER | ENTRY_LEVEL_MANAGER | STRATEGIC | SENIOR | ENTRY_LEVEL | IN_TRAINING[],
>   exclude?: OWNER/PARTNER | CXO | VICE_PRESIDENT | DIRECTOR | EXPERIENCED_MANAGER | ENTRY_LEVEL_MANAGER | STRATEGIC | SENIOR | ENTRY_LEVEL | IN_TRAINING[]
> }
> ```

> **years\_in\_company full type**
>
> ```ts theme={null}
> {
>   min?: number,
>   max?: number
> }[]
> ```

> **years\_in\_position full type**
>
> ```ts theme={null}
> {
>   min?: number,
>   max?: number
> }[]
> ```

> **location full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **postal\_code full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[],
>   radius?: number
> }
> ```

> **industry full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **years\_of\_experience full type**
>
> ```ts theme={null}
> {
>   min?: number,
>   max?: number
> }[]
> ```

> **group full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **school full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **account\_list full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **lead\_list full type**
>
> ```ts theme={null}
> {
>   include?: string[],
>   exclude?: string[]
> }
> ```

> **recent\_interaction full type**
>
> ```ts theme={null}
> {
>   viewed_profile?: boolean,
>   messaged?: boolean
> }
> ```

> **saved\_resources full type**
>
> ```ts theme={null}
> {
>   saved_leads?: boolean,
>   saved_accounts?: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   member_id?: string | null,
>   display_name: string,
>   public_identifier?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   public_picture_url_large?: string | null,
>   relations_count?: number | null,
>   location?: string | null,
>   headline?: string | null,
>   network_distance: string,
>   can_send_inmail?: boolean | null,
>   product: string,
>   shared_relations_count?: number | null,
>   summary?: string | null,
>   has_been_viewed: boolean,
>   has_been_saved: boolean,
>   has_posted_recently: boolean,
>   has_viewed_your_profile: boolean,
>   was_hired_recently: boolean,
>   was_promoted_recently: boolean,
>   follows_your_company: boolean,
>   is_premium: boolean,
>   is_past_colleague: boolean,
>   is_open_profile: boolean,
>   websites?: string[] | null,
>   addresses?: string[] | null,
>   contact_info: {
>   },
>   latest_contact?: {
>   } | null,
>   lists_count: number,
>   notes_count: number,
>   social_handles?: {
>   } | null,
>   industry?: string | null,
>   education: any[],
>   skills: any[],
>   work_experience: any[],
>   languages: any[],
>   volunteering: any[]
> }[]
> ```

***

## Scopes

### create

`scopes.create`

Create a Scope to group one customer's accounts. Needs a Service API Key

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.scopes.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | An internal name used to identify the Scope. |
| `reference` | `string` | No | Optional metadata used to map the Scope to an external resource. Must be unique in the Application. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | The type of the returned object. |
| `id` | `string` | Yes | The unique public ID of the Scope. |
| `application_id` | `string` | Yes | The ID of the Application that owns the Scope. |
| `name` | `string` | Yes | The internal name of the Scope. |
| `reference` | `string` | No | External metadata used to map the Scope to another resource, or `null` when none is defined. |
| `status` | `string` | Yes | The status of the Scope. A disabled scope blocks its scoped API keys and authentication flows until it is enabled again. |
| `created_at` | `string` | Yes | The date and time when the Scope was created. |
| `accounts_count` | `number` | Yes | The number of Accounts permanently assigned to the Scope. |
| `api_keys_count` | `number` | Yes | The number of API Keys assigned to the Scope. |

***

### delete

`scopes.delete`

Delete a Scope. Needs a Service API Key

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

```ts theme={null}
await corsair.unipile.api.scopes.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `scope_id` | `string` | Yes | The ID of the Scope to delete. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | Indicates that the Scope was successfully deleted. |

***

### get

`scopes.get`

Get one Scope. Needs a Service API Key

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.scopes.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `scope_id` | `string` | Yes | The ID of the Scope to retrieve. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | The type of the returned object. |
| `id` | `string` | Yes | The unique public ID of the Scope. |
| `application_id` | `string` | Yes | The ID of the Application that owns the Scope. |
| `name` | `string` | Yes | The internal name of the Scope. |
| `reference` | `string` | No | External metadata used to map the Scope to another resource, or `null` when none is defined. |
| `status` | `string` | Yes | The status of the Scope. A disabled scope blocks its scoped API keys and authentication flows until it is enabled again. |
| `created_at` | `string` | Yes | The date and time when the Scope was created. |
| `accounts_count` | `number` | Yes | The number of Accounts permanently assigned to the Scope. |
| `api_keys_count` | `number` | Yes | The number of API Keys assigned to the Scope. |

***

### list

`scopes.list`

List the Scopes (customer or workspace boundaries) in the application. Needs a Service API Key

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.scopes.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |
| `status` | `active \| disabled` | No | — |
| `search` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | The type of the returned collection. |
| `data` | `object[]` | Yes | The scopes in the current page. |
| `has_more` | `boolean` | Yes | Whether more scopes are available after the current page. |

> **data full type**
>
> ```ts theme={null}
> {
>   object: string,
>   id: string,
>   application_id: string,
>   name: string,
>   reference?: string | null,
>   status: string,
>   created_at: string,
>   accounts_count: number,
>   api_keys_count: number
> }[]
> ```

***

### update

`scopes.update`

Rename, enable or disable a Scope. Needs a Service API Key

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.scopes.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `scope_id` | `string` | Yes | The ID of the Scope to update. |
| `name` | `string` | No | The new internal name of the Scope. |
| `reference` | `string` | No | The new external reference of the Scope. Must be unique in the Application. Set to `null` to remove it. |
| `status` | `active \| disabled` | No | The status of the Scope. A disabled scope blocks its scoped API keys and authentication flows until it is enabled again. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | The type of the returned object. |
| `id` | `string` | Yes | The unique public ID of the Scope. |
| `application_id` | `string` | Yes | The ID of the Application that owns the Scope. |
| `name` | `string` | Yes | The internal name of the Scope. |
| `reference` | `string` | No | External metadata used to map the Scope to another resource, or `null` when none is defined. |
| `status` | `string` | Yes | The status of the Scope. A disabled scope blocks its scoped API keys and authentication flows until it is enabled again. |
| `created_at` | `string` | Yes | The date and time when the Scope was created. |
| `accounts_count` | `number` | Yes | The number of Accounts permanently assigned to the Scope. |
| `api_keys_count` | `number` | Yes | The number of API Keys assigned to the Scope. |

***

## Users

### follow

`users.follow`

Follow a user on LinkedIn or Instagram (a private profile gets a follow request). Does not create a LinkedIn connection; fails if already followed

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.users.follow({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `user_id` | `string` | Yes | The ID of the User to follow. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `type` | `string` | No | Type of the relation / follow request. - `sent` if the current user has asked another one to be in his relations. |
| `id` | `string` | No | The unique identifier of the invitation for the provider. |
| `created_at` | `string` | No | Uses ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). |
| `message` | `string` | No | Any message that comes with the invitation. |
| `user` | `object` | No | The user who is the target of the relation / follow request. |

> **user full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: {
>     contact_name?: string | null,
>     messaging_identifier?: string | null,
>     location?: string | null,
>     network_distance?: string | null,
>     industry?: string | null,
>     is_following?: boolean | null,
>     followers_count?: number | null,
>     relations_count?: number | null,
>     shared_relations_count?: number | null,
>     website_url?: string | null,
>     portfolio_url?: string | null,
>     services_page_url?: string | null,
>     is_premium?: boolean | null,
>     is_verified?: boolean | null
>   } | null
> }
> ```

***

### getChat

`users.getChat`

Find the existing chats with a user by their provider ID, on any provider, to send into instead of starting a new one. Can return several chats across inboxes

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.users.getChat({ account_id: 'acc_9f2c1d7e', user_id: 'ACoAAB1cDeFgHiJkLmNoPqRsTuVwXyZ0123456' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `user_id` | `string` | Yes | Provider user ID. For LinkedIn, the member ID (ACo…) or public identifier from a profile URL; `me` is the account owner |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `data` | `object[]` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   chat_id: string,
>   inbox_id?: string | null,
>   has_history?: boolean | null
> }[]
> ```

***

### getPicture

`users.getPicture`

Download a user's profile picture (Telegram only; me for the owner). Returns the type and size only, unless include\_content is set

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.users.getPicture({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `include_content` | `boolean` | No | Return the file itself as base64 in content\_base64. Off by default: only the type and size come back |
| `max_bytes` | `number` | No | Largest file to return with include\_content (default 5 MB); bigger files come back without content |
| `user_id` | `string` | Yes | — |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `content_type` | `string` | Yes | MIME type Unipile sent |
| `size_bytes` | `number` | Yes | Size of the file in bytes |
| `filename` | `string` | No | File name from Content-Disposition, when sent |
| `content_base64` | `string` | No | The file as base64, only with include\_content |
| `content_omitted` | `string` | No | Why content\_base64 is missing although include\_content was set |

***

### getPresence

`users.getPresence`

Get whether a user is online and when they were last seen (Instagram, LinkedIn, Telegram, WhatsApp). unknown means not shared, not offline

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.users.getPresence({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `user_id` | `string` | Yes | The ID of the User whose presence must be retrieved, as returned by the provider. Use `me` to specify the owner of the connected account, although providers do not always report the presence of the ac… |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `user_id` | `string` | Yes | The ID of the User this presence belongs to. |
| `presence` | `string` | Yes | Whether the user is currently connected to the provider. - `online` if the user is connected right now. - `offline` if the user is not connected. |
| `last_online_at` | `string` | No | Date and time when the user was last online. Only set when the user is offline and the provider exposes the exact date. |
| `provider` | `string` | Yes | The provider's of the Account. - `mock` is mock. - `whatsapp` is WhatsApp. - `linkedin` is LinkedIn. - `instagram` is Instagram. - `google` is Google. |

***

### getProfile

`users.getProfile`

Get a LinkedIn profile by member ID or public identifier: headline, location, network distance, invitation status, and optional experience, education and skills. Each call counts toward LinkedIn's profile-view limit (about 80-100 a day), so it is not retried after a timeout or 5xx, only after Unipile's own rate limit

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.users.getProfile({ account_id: 'acc_9f2c1d7e', user_id: 'williamhgates', with_sections: ['linkedin_experience'] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `user_id` | `string` | Yes | Provider user ID. For LinkedIn, the member ID (ACo…) or public identifier from a profile URL; `me` is the account owner |
| `with_sections` | `linkedin_* \| linkedin_experience \| linkedin_education \| linkedin_languages \| linkedin_skills \| linkedin_certifications \| linkedin_volunteer_experience \| linkedin_projects \| linkedin_recommendations \| linkedin_recruiting_activity \| linkedin_interests \| linkedin_*_preview \| linkedin_experience_preview \| linkedin_education_preview \| linkedin_languages_preview \| linkedin_skills_preview \| linkedin_certifications_preview \| linkedin_volunteer_experience_preview \| linkedin_projects_preview \| linkedin_recommendations_preview \| linkedin_recruiting_activity_preview \| linkedin_interests_preview[]` | No | Extra LinkedIn sections to load, e.g. linkedin\_experience. Each one is another request to LinkedIn |
| `variant` | `linkedin_classic \| linkedin_recruiter \| linkedin_sales_navigator` | No | Which LinkedIn product to read the profile through |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `id` | `string` | Yes | — |
| `provider` | `string` | No | — |
| `type` | `string` | No | — |
| `public_identifier` | `string` | No | — |
| `display_name` | `string` | No | — |
| `first_name` | `string` | No | — |
| `last_name` | `string` | No | — |
| `profile_url` | `string` | No | — |
| `public_picture_url` | `string` | No | — |
| `description` | `string` | No | Headline on LinkedIn |
| `bio` | `string` | No | — |
| `location` | `string` | No | — |
| `followers_count` | `number` | No | — |
| `relations_count` | `number` | No | — |
| `shared_relations_count` | `number` | No | — |
| `is_premium` | `boolean` | No | — |
| `is_blocked` | `boolean` | No | — |
| `emails` | `string[]` | No | — |
| `phone_numbers` | `string[]` | No | — |
| `websites` | `string[]` | No | — |
| `specifics` | `object` | No | — |

> **specifics full type**
>
> ```ts theme={null}
> {
>   member_id?: string | null,
>   industry?: string | null,
>   network_distance?: string | null,
>   relation_request_status?: string | null,
>   can_send_inmail?: boolean | null,
>   is_open_profile?: boolean | null,
>   is_premium?: boolean | null,
>   is_open_to_work?: boolean | null,
>   is_hiring?: boolean | null,
>   notify_visit_token?: string | null,
>   experience?: any[] | null,
>   education?: any[] | null,
>   skills?: any[] | null
> }
> ```

***

### listComments

`users.listComments`

List a user's comments on posts (the account owner's by default), with each post

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.users.listComments({ account_id: 'acc_9f2c1d7e', user_id: 'ACoAAB1cDeFgHiJkLmNoPqRsTuVwXyZ0123456' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `user_id` | `string` | Yes | Provider user ID. For LinkedIn, the member ID (ACo…) or public identifier from a profile URL; `me` is the account owner |
| `offset` | `number` | No | Offset pagination: add the previous limit to get the next page. Use `cursor` instead when the previous page returned next\_cursor |
| `cursor` | `string` | No | next\_cursor from the previous page. Send it alone, without offset |
| `limit` | `number` | No | Page size. Leave unset to use the provider's own page size, which Unipile recommends |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | — |
| `next_cursor` | `string` | No | Pass as cursor to get the next page; absent on the last page |

> **data full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id: string,
>   thread_id?: string | null,
>   created_at?: string | null,
>   text?: string | null,
>   is_sender?: boolean | null,
>   reply_counter?: number | null,
>   author?: {
>     id: string,
>     object?: string | null,
>     type?: string | null,
>     public_identifier?: string | null,
>     display_name?: string | null,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     description?: string | null,
>     specifics?: {
>       location?: string | null,
>       network_distance?: string | null,
>       industry?: string | null,
>       is_following?: boolean | null,
>       followers_count?: number | null,
>       relations_count?: number | null,
>       shared_relations_count?: number | null,
>       is_premium?: boolean | null,
>       is_verified?: boolean | null
>     } | null
>   } | null,
>   parent_post?: {
>     object?: string | null,
>     id: string,
>     share_url?: string | null,
>     created_at?: string | null,
>     title?: string | null,
>     text?: string | null,
>     author?: {
>       id: string,
>       object?: string | null,
>       type?: string | null,
>       public_identifier?: string | null,
>       display_name?: string | null,
>       first_name?: string | null,
>       last_name?: string | null,
>       profile_url?: string | null,
>       public_picture_url?: string | null,
>       description?: string | null,
>       specifics?: {
>         location?: string | null,
>         network_distance?: string | null,
>         industry?: string | null,
>         is_following?: boolean | null,
>         followers_count?: number | null,
>         relations_count?: number | null,
>         shared_relations_count?: number | null,
>         is_premium?: boolean | null,
>         is_verified?: boolean | null
>       } | null
>     } | null,
>     is_repost?: boolean | null,
>     comments_counter?: number | null,
>     reposts_counter?: number | null,
>     reactions_counter?: {
>       reaction: string,
>       count: number
>     }[] | null,
>     attachments?: any[] | null
>   } | null
> }[]
> ```

***

### listFollowers

`users.listFollowers`

List a user's followers on LinkedIn or Instagram (me for the owner); LinkedIn pages by offset

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.users.listFollowers({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `user_id` | `string` | Yes | The ID of the User to get the followers from. Use `me` to get the followers of the account owner. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: {
>   } | null
> }[]
> ```

***

### listFollowing

`users.listFollowing`

List the accounts a user follows on LinkedIn or Instagram. LinkedIn accepts only user\_id me; pages by offset

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.users.listFollowing({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `user_id` | `string` | Yes | The ID of the User to get the followed users from. Use `me` to get the followed users of the account owner. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `offset` | `number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | Total number of results if supported by the provider. |
| `next_cursor` | `string` | No | Cursor to get the next page of results if supported. Else use `offset`. |

> **data full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object: string,
>   type: string,
>   public_identifier?: string | null,
>   display_name: string,
>   first_name?: string | null,
>   last_name?: string | null,
>   profile_url?: string | null,
>   public_picture_url?: string | null,
>   private_picture_download_url?: string | null,
>   description?: string | null,
>   specifics?: {
>   } | null
> }[]
> ```

***

### listReactions

`users.listReactions`

List the posts a user reacted to (the account owner's by default), with each post

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.users.listReactions({ account_id: 'acc_9f2c1d7e', user_id: 'ACoAAB1cDeFgHiJkLmNoPqRsTuVwXyZ0123456' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `user_id` | `string` | Yes | Provider user ID. For LinkedIn, the member ID (ACo…) or public identifier from a profile URL; `me` is the account owner |
| `offset` | `number` | No | Offset pagination: add the previous limit to get the next page. Use `cursor` instead when the previous page returned next\_cursor |
| `cursor` | `string` | No | next\_cursor from the previous page. Send it alone, without offset |
| `limit` | `number` | No | Page size. Leave unset to use the provider's own page size, which Unipile recommends |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | — |
| `next_cursor` | `string` | No | Pass as cursor to get the next page; absent on the last page |

> **data full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   value: string,
>   is_sender?: boolean | null,
>   sender: {
>     id: string,
>     object?: string | null,
>     type?: string | null,
>     public_identifier?: string | null,
>     display_name?: string | null,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     description?: string | null,
>     specifics?: {
>       location?: string | null,
>       network_distance?: string | null,
>       industry?: string | null,
>       is_following?: boolean | null,
>       followers_count?: number | null,
>       relations_count?: number | null,
>       shared_relations_count?: number | null,
>       is_premium?: boolean | null,
>       is_verified?: boolean | null
>     } | null
>   },
>   parent_post?: {
>     object?: string | null,
>     id: string,
>     share_url?: string | null,
>     created_at?: string | null,
>     title?: string | null,
>     text?: string | null,
>     author?: {
>       id: string,
>       object?: string | null,
>       type?: string | null,
>       public_identifier?: string | null,
>       display_name?: string | null,
>       first_name?: string | null,
>       last_name?: string | null,
>       profile_url?: string | null,
>       public_picture_url?: string | null,
>       description?: string | null,
>       specifics?: {
>         location?: string | null,
>         network_distance?: string | null,
>         industry?: string | null,
>         is_following?: boolean | null,
>         followers_count?: number | null,
>         relations_count?: number | null,
>         shared_relations_count?: number | null,
>         is_premium?: boolean | null,
>         is_verified?: boolean | null
>       } | null
>     } | null,
>     is_repost?: boolean | null,
>     comments_counter?: number | null,
>     reposts_counter?: number | null,
>     reactions_counter?: {
>       reaction: string,
>       count: number
>     }[] | null,
>     attachments?: any[] | null
>   } | null
> }[]
> ```

***

### listRelations

`users.listRelations`

List a user's 1st-degree connections (the account owner's by default), with optional name search and paging

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.users.listRelations({ account_id: 'acc_9f2c1d7e', search: 'Maya' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `user_id` | `string` | Yes | Provider user ID. For LinkedIn, the member ID (ACo…) or public identifier from a profile URL; `me` is the account owner |
| `search` | `string` | No | Filter relations by name |
| `offset` | `number` | No | Offset pagination: add the previous limit to get the next page. Use `cursor` instead when the previous page returned next\_cursor |
| `cursor` | `string` | No | next\_cursor from the previous page. Send it alone, without offset |
| `limit` | `number` | No | Page size. Leave unset to use the provider's own page size, which Unipile recommends |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `total_count` | `number` | No | — |
| `next_cursor` | `string` | No | Pass as cursor to get the next page; absent on the last page |

> **data full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id: string,
>   created_at?: string | null,
>   user: {
>     id: string,
>     object?: string | null,
>     type?: string | null,
>     public_identifier?: string | null,
>     display_name?: string | null,
>     first_name?: string | null,
>     last_name?: string | null,
>     profile_url?: string | null,
>     public_picture_url?: string | null,
>     description?: string | null,
>     specifics?: {
>       location?: string | null,
>       network_distance?: string | null,
>       industry?: string | null,
>       is_following?: boolean | null,
>       followers_count?: number | null,
>       relations_count?: number | null,
>       shared_relations_count?: number | null,
>       is_premium?: boolean | null,
>       is_verified?: boolean | null
>     } | null
>   }
> }[]
> ```

***

### removeRelation

`users.removeRelation`

Remove a LinkedIn connection (1st-degree relation). Use users.unfollow for one-way follows; reconnecting needs a new invitation

**Risk:** `destructive`

```ts theme={null}
await corsair.unipile.api.users.removeRelation({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `user_id` | `string` | Yes | The ID of the User to delete the relation with. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### setPresence

`users.setPresence`

Set the account's own presence: online, offline, away or restricted\_online. LinkedIn Classic, WhatsApp, Telegram and Instagram

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.users.setPresence({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `presence` | `online \| restricted_online \| offline \| away` | Yes | The presence of the user. - `online` if the user is online / available. \_ `restricted_online` if the user is online to a restricted set of contacts. - `offline` if the user is offline / unavailable. - `away` if the user is away / busy. |

**Output**

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

***

### unfollow

`users.unfollow`

Stop following a user on LinkedIn or Instagram; fails if not followed

**Risk:** `destructive`

```ts theme={null}
await corsair.unipile.api.users.unfollow({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `user_id` | `string` | Yes | The ID of the User to unfollow. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |

**Output**

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

***

### updateProfile

`users.updateProfile`

Update the account owner's own LinkedIn or Instagram profile (user\_id me): headline, about, location, skills and similar. Changes are public, and notify\_network announces them

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.users.updateProfile({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `user_id` | `string` | Yes | The ID of the User to update. Use `me` to update the account owner profile. |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `first_name` | `string` | No | The first name of the User. Updating this field is not supported by LinkedIn and Instagram. |
| `last_name` | `string` | No | The last name of the User. Updating this field is not supported by LinkedIn and Instagram. |
| `description` | `string` | No | Description of the User. Updating this field is not supported by LinkedIn and Instagram. |
| `location` | `string` | No | Location of the User. Omit it to leave it unchanged. Updating this field is not supported by Instagram. |
| `bio` | `string` | No | Bio / About section. Omit it to leave it unchanged or use an empty string to clear it. |
| `picture` | `object` | No | A file to be uploaded. |
| `background_picture` | `object` | No | A file to be uploaded. |
| `specifics` | `object` | No | — |

> **picture full type**
>
> ```ts theme={null}
> {
>   content: string,
>   content_type: string,
>   filename: string,
>   metadata?: {
>     duration?: number
>   }
> }
> ```

> **background\_picture full type**
>
> ```ts theme={null}
> {
>   content: string,
>   content_type: string,
>   filename: string,
>   metadata?: {
>     duration?: number
>   }
> }
> ```

> **specifics full type**
>
> ```ts theme={null}
> {
>   linkedin?: {
>     skills?: {
>       name: string,
>       id?: string
>     }[],
>     skills_follow?: boolean,
>     postal_code?: string,
>     headline?: string,
>     experience?: {
>       notify_network?: boolean,
>       job_title: {
>         name: string,
>         id?: string
>       },
>       employment_type?: string,
>       company: {
>         name: string,
>         id?: string
>       },
>       location?: {
>         name: string,
>         id?: string
>       },
>       workplace_type?: ON_SITE | HYBRID | REMOTE,
>       start_date: {
>         month: number,
>         year: number
>       },
>       end_date?: {
>         month: number,
>         year: number
>       },
>       description?: string,
>       source_of_hire?: INDEED | LINKEDIN | COMPANY_WEBSITE | OTHER_JOB_SITES | REFERRAL | CONTACTED_BY_RECRUITER | STAFFING_AGENCY | OTHER,
>       skills?: {
>         name: any,
>         id?: any
>       }[],
>       media?: {
>         title?: any,
>         description?: any,
>         type: any,
>         attachment: any
>       } | {
>         title?: any,
>         description?: any,
>         type: any,
>         url: any,
>         thumbnail?: any
>       },
>       operation: create
>     } | {
>       notify_network?: boolean,
>       job_title?: {
>         name: string,
>         id?: string
>       },
>       employment_type?: string,
>       company?: {
>         name: string,
>         id?: string
>       },
>       location?: {
>         name: string,
>         id?: string
>       },
>       workplace_type?: ON_SITE | HYBRID | REMOTE,
>       start_date?: {
>         month: number,
>         year: number
>       },
>       end_date?: {
>         month: number,
>         year: number
>       },
>       description?: string,
>       source_of_hire?: INDEED | LINKEDIN | COMPANY_WEBSITE | OTHER_JOB_SITES | REFERRAL | CONTACTED_BY_RECRUITER | STAFFING_AGENCY | OTHER,
>       skills?: {
>         name: any,
>         id?: any
>       }[],
>       media?: {
>         title?: any,
>         description?: any,
>         type: any,
>         attachment: any
>       } | {
>         title?: any,
>         description?: any,
>         type: any,
>         url: any,
>         thumbnail?: any
>       },
>       operation: edit,
>       id: string
>     } | {
>       operation: delete,
>       id: string
>     },
>     education?: {
>       notify_network?: boolean,
>       school: {
>         name: string,
>         id?: string
>       },
>       degree?: {
>         name: string,
>         id?: string
>       },
>       field_of_study?: {
>         name: string,
>         id?: string
>       },
>       start_date: {
>         month: number,
>         year: number
>       },
>       end_date?: {
>         month: number,
>         year: number
>       },
>       grade?: string,
>       activities?: string,
>       description?: string,
>       skills?: {
>         name: any,
>         id?: any
>       }[],
>       media?: {
>         title?: any,
>         description?: any,
>         type: any,
>         attachment: any
>       } | {
>         title?: any,
>         description?: any,
>         type: any,
>         url: any,
>         thumbnail?: any
>       },
>       operation: create
>     } | {
>       notify_network?: boolean,
>       school?: {
>         name: string,
>         id?: string
>       },
>       degree?: {
>         name: string,
>         id?: string
>       },
>       field_of_study?: {
>         name: string,
>         id?: string
>       },
>       start_date?: {
>         month: number,
>         year: number
>       },
>       end_date?: {
>         month: number,
>         year: number
>       },
>       grade?: string,
>       activities?: string,
>       description?: string,
>       skills?: {
>         name: any,
>         id?: any
>       }[],
>       media?: {
>         title?: any,
>         description?: any,
>         type: any,
>         attachment: any
>       } | {
>         title?: any,
>         description?: any,
>         type: any,
>         url: any,
>         thumbnail?: any
>       },
>       operation: edit,
>       id: string
>     } | {
>       operation: delete,
>       id: string
>     },
>     picture_options?: {
>       filter?: original | studio | spotlight | prime | classic | edge | luminate,
>       layout?: {
>         bottom_left?: {
>           x: number,
>           y: number
>         },
>         bottom_right?: {
>           x: number,
>           y: number
>         },
>         top_left?: {
>           x: number,
>           y: number
>         },
>         top_right?: {
>           x: number,
>           y: number
>         }
>       },
>       contrast?: number,
>       vignette?: number,
>       saturation?: number,
>       brightness?: number
>     },
>     background_picture_options?: {
>       filter?: original | studio | spotlight | prime | classic | edge | luminate,
>       layout?: {
>         bottom_left?: {
>           x: number,
>           y: number
>         },
>         bottom_right?: {
>           x: number,
>           y: number
>         },
>         top_left?: {
>           x: number,
>           y: number
>         },
>         top_right?: {
>           x: number,
>           y: number
>         }
>       },
>       contrast?: number,
>       vignette?: number,
>       saturation?: number,
>       brightness?: number
>     },
>     custom_link?: {
>       type: STORE | WEBSITE | PORTFOLIO | BLOG | NEWSLETTER,
>       url: string,
>       display_on?: PROFILE_ONLY | EVERYWHERE
>     } | null,
>     open_to_work?: {
>       job_title: {
>         title: string,
>         id: string
>       }[],
>       workplace: {
>         type: ON_SITE | HYBRID | REMOTE,
>         location: any[]
>       }[],
>       start_date?: IMMEDIATELY | FLEXIBLE,
>       employment_type?: FULL_TIME | PART_TIME | CONTRACT | INTERNSHIP | TEMPORARY[],
>       visibility: ALL | RECRUITERS_ONLY
>     } | null
>   }
> }
> ```

**Output**

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

***

### visitProfile

`users.visitProfile`

Report a profile visit to LinkedIn so the member sees you in 'Who viewed your profile', using the notify\_visit\_token from users.getProfile. Counts toward LinkedIn's profile-view limit and is not retried after a timeout or 5xx

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.users.visitProfile({ account_id: 'acc_9f2c1d7e', token: 'notify-visit-token-from-getProfile' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account_id` | `string` | Yes | Unipile account ID (acc\_…) of the connected account to act as, from accounts.list |
| `token` | `string` | Yes | specifics.notify\_visit\_token from users.getProfile |

**Output**

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

***

## Webhook Endpoints

### create

`webhookEndpoints.create`

Register a URL to receive Unipile events such as relation.new and message.new. Returns the signing secret once, and only here: store it as the plugin webhookSecret right away. Needs a Service API Key

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.webhookEndpoints.create({ url: 'https://your-app.example.com/api/webhook', trigger_events: ['relation.new', 'message.new', 'account.status.disconnected'] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string` | Yes | HTTPS URL that receives event POSTs |
| `trigger_events` | `account.status.disconnected \| account.status.running \| account.status.errored \| account.status.degraded \| account.status.partial \| account.locked \| account.unlocked \| account.add \| account.reconnect \| account.remove \| account.initial_sync.running \| account.initial_sync.failed \| account.initial_sync.completed \| message.new \| message.update \| message.delete \| message.receipt.read \| message.receipt.delivery \| message.reaction.new \| message.reaction.delete \| chat.delete \| chat.update \| email.new \| email.new.bounce \| email.delete \| email.draft.new \| email.draft.delete \| email.folder.create \| email.folder.update \| email.folder.delete \| calendar.create \| calendar.update \| calendar.delete \| calendar.event.new \| calendar.event.update \| calendar.event.delete \| tracking.open \| tracking.click \| relation.new \| follower.new[]` | Yes | Events to send, e.g. relation.new, message.new |
| `account_ids` | `string[]` | No | Only send events from these accounts. Omit for all accounts |
| `description` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `id` | `string` | Yes | — |
| `url` | `string` | Yes | — |
| `enabled` | `boolean` | No | — |
| `description` | `string` | No | — |
| `trigger_events` | `string[]` | Yes | — |
| `application_id` | `string` | No | — |
| `account_ids` | `string[]` | No | — |
| `account_targets` | `any[]` | No | — |
| `secret` | `string` | No | Signing secret for the unipile-signature header. Shown only once, here: store it now as the plugin webhookSecret (or the stored webhook signature). list, get and update never return it |

***

### delete

`webhookEndpoints.delete`

Delete a Unipile webhook endpoint; its events stop. Needs a Service API Key

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

```ts theme={null}
await corsair.unipile.api.webhookEndpoints.delete({ id: 'whe_42' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Webhook endpoint ID |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### get

`webhookEndpoints.get`

Get one Unipile webhook endpoint: URL, events, accounts and whether it has a signing secret (the secret is never returned). Needs a Service API Key

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.webhookEndpoints.get({ id: 'whe_42' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Webhook endpoint ID |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `id` | `string` | Yes | — |
| `url` | `string` | Yes | — |
| `enabled` | `boolean` | No | — |
| `description` | `string` | No | — |
| `trigger_events` | `string[]` | Yes | — |
| `application_id` | `string` | No | — |
| `account_ids` | `string[]` | No | — |
| `account_targets` | `any[]` | No | — |
| `secret_set` | `boolean` | Yes | Whether the endpoint has a signing secret. Only webhookEndpoints.create returns the secret itself |

***

### list

`webhookEndpoints.list`

List the Unipile webhook endpoints, their URLs, events and accounts (signing secrets are never returned). Needs a Service API Key

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.webhookEndpoints.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `offset` | `number` | No | Number of items to skip |
| `limit` | `number` | No | Number of items to return |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `data` | `object[]` | Yes | — |
| `has_more` | `boolean` | No | — |

> **data full type**
>
> ```ts theme={null}
> {
>   object?: string | null,
>   id: string,
>   url: string,
>   enabled?: boolean | null,
>   description?: string | null,
>   trigger_events: string[],
>   application_id?: string | null,
>   account_ids?: string[] | null,
>   account_targets?: any[] | null,
>   secret_set: boolean
> }[]
> ```

***

### update

`webhookEndpoints.update`

Change a webhook endpoint's URL, events, accounts or description, or enable or disable it. Keeps the signing secret, which is not returned. Needs a Service API Key

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.webhookEndpoints.update({ id: 'whe_42', enabled: false });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Webhook endpoint ID |
| `url` | `string` | No | — |
| `trigger_events` | `account.status.disconnected \| account.status.running \| account.status.errored \| account.status.degraded \| account.status.partial \| account.locked \| account.unlocked \| account.add \| account.reconnect \| account.remove \| account.initial_sync.running \| account.initial_sync.failed \| account.initial_sync.completed \| message.new \| message.update \| message.delete \| message.receipt.read \| message.receipt.delivery \| message.reaction.new \| message.reaction.delete \| chat.delete \| chat.update \| email.new \| email.new.bounce \| email.delete \| email.draft.new \| email.draft.delete \| email.folder.create \| email.folder.update \| email.folder.delete \| calendar.create \| calendar.update \| calendar.delete \| calendar.event.new \| calendar.event.update \| calendar.event.delete \| tracking.open \| tracking.click \| relation.new \| follower.new[]` | No | — |
| `account_ids` | `string[]` | No | — |
| `description` | `string` | No | — |
| `enabled` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `id` | `string` | Yes | — |
| `url` | `string` | Yes | — |
| `enabled` | `boolean` | No | — |
| `description` | `string` | No | — |
| `trigger_events` | `string[]` | Yes | — |
| `application_id` | `string` | No | — |
| `account_ids` | `string[]` | No | — |
| `account_targets` | `any[]` | No | — |
| `secret_set` | `boolean` | Yes | Whether the endpoint has a signing secret. Only webhookEndpoints.create returns the secret itself |

***

## Webhook Events

### listDeliveries

`webhookEvents.listDeliveries`

List webhook delivery attempts (event, endpoint, status, response) from the last seven days, to debug missing events. Needs a Service API Key

**Risk:** `read`

```ts theme={null}
await corsair.unipile.api.webhookEvents.listDeliveries({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `endpoint_id` | `string` | Yes | — |
| `event_id` | `string` | No | — |
| `account_id` | `string` | No | — |
| `event_type` | `account.status.disconnected \| account.status.running \| account.status.errored \| account.status.degraded \| account.status.partial \| account.locked \| account.unlocked \| account.add \| account.reconnect \| account.remove \| account.initial_sync.running \| account.initial_sync.failed \| account.initial_sync.completed \| message.new \| message.update \| message.delete \| message.receipt.read \| message.receipt.delivery \| message.reaction.new \| message.reaction.delete \| chat.delete \| chat.update \| email.new \| email.new.bounce \| email.delete \| email.draft.new \| email.draft.delete \| email.folder.create \| email.folder.update \| email.folder.delete \| calendar.create \| calendar.update \| calendar.delete \| calendar.event.new \| calendar.event.update \| calendar.event.delete \| tracking.open \| tracking.click \| relation.new \| follower.new` | No | — |
| `status` | `success \| failed` | No | — |
| `created_after` | `string` | No | — |
| `created_before` | `string` | No | — |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `data` | `object[]` | Yes | — |
| `has_more` | `boolean` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   first_attempt: boolean,
>   event_type: string,
>   created_at: string,
>   http_status?: number | null,
>   endpoint_url: string,
>   response_body?: string | null,
>   latency_ms?: number | null,
>   response_time_ms?: number | null,
>   object: string,
>   id: string,
>   endpoint_id: string,
>   event_id: string
> }[]
> ```

***

### replay

`webhookEvents.replay`

Queue another delivery of a stored event (evt\_…) to every enabled endpoint that matches it, even if it was delivered before. Receivers must handle the duplicate. Needs a Service API Key

**Risk:** `write`

```ts theme={null}
await corsair.unipile.api.webhookEvents.replay({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | Yes | — |
| `event_id` | `string` | Yes | — |
| `endpoint_ids` | `string[]` | Yes | — |

***


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