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

# SiteSpeakAI API reference

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

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

## Agency

### clients.addTopupCredits

`agency.clients.addTopupCredits`

Add top-up message credits to a client workspace (the credits cannot be taken back and never expire)

**Risk:** `destructive`

```ts theme={null}
await corsair.sitespeakai.api.agency.clients.addTopupCredits({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `client_id` | `string` | Yes | — |
| `amount` | `number` | Yes | — |
| `idempotency_key` | `string` | Yes | Sent as the Idempotency-Key header. Retrying with the same key (and body) returns the original response instead of repeating the action. |

**Output**

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

> [accordion] client full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   external_reference?: string | null,
>   status?: string | null,
>   pause_mode?: string | null,
>   paused_at?: string | null,
>   byok_enabled?: boolean | null,
>   enabled_integrations?: string[] | null,
>   enabled_features?: string[] | null,
>   limits?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null,
>     response_tokens?: number | null
>   } | null,
>   usage?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null
>   } | null,
>   messages_remaining?: number | null,
>   topup_credits_remaining?: number | null,
>   credits_exhausted_at?: string | null,
>   credits_reset_at?: string | null,
>   created_at?: string | null
> }
> ```

***

### clients.create

`agency.clients.create`

Create a client workspace with optional agent and portal invitation

**Risk:** `write`

```ts theme={null}
await corsair.sitespeakai.api.agency.clients.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |
| `external_reference` | `string` | No | — |
| `message_limit` | `number \| null` | No | — |
| `source_limit` | `number \| null` | No | — |
| `chatbot_limit` | `number \| null` | No | — |
| `response_token_limit` | `number \| null` | No | — |
| `byok_enabled` | `boolean` | No | — |
| `enabled_integrations` | `(whatsapp \| hubspot \| slack \| google_chat \| telegram \| discord \| actions)[] \| null` | No | — |
| `enabled_features` | `(auto_sitemaps \| remove_powered_by \| voice \| inbox_translation \| inbox_email_drafts \| custom_domain \| pii_redaction \| audit_log \| api_access \| advanced_xai_models)[] \| null` | No | — |
| `chatbot` | `object` | No | — |
| `invite_email` | `string` | No | — |
| `invite_role` | `admin \| editor \| member` | No | — |
| `idempotency_key` | `string` | Yes | Sent as the Idempotency-Key header. Retrying with the same key (and body) returns the original response instead of repeating the action. |

> [accordion] chatbot full type
>
> ```ts theme={null}
> {
>   name: string,
>   website_url?: string,
>   accent_color?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `client` | `object` | Yes | — |
| `chatbot` | `object \| null` | No | — |
| `invitation` | `object \| null` | No | — |

> [accordion] client full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   external_reference?: string | null,
>   status?: string | null,
>   pause_mode?: string | null,
>   paused_at?: string | null,
>   byok_enabled?: boolean | null,
>   enabled_integrations?: string[] | null,
>   enabled_features?: string[] | null,
>   limits?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null,
>     response_tokens?: number | null
>   } | null,
>   usage?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null
>   } | null,
>   messages_remaining?: number | null,
>   topup_credits_remaining?: number | null,
>   credits_exhausted_at?: string | null,
>   credits_reset_at?: string | null,
>   created_at?: string | null
> }
> ```

> [accordion] chatbot full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   enabled?: boolean | null,
>   accent_color?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   messages_remaining?: number | null,
>   team_id?: string | null,
>   type?: string | null,
>   header_icon?: string | null,
>   launcher_icon?: string | null,
>   open_count?: number | null,
>   unread_count?: number | null
> } | null
> ```

> [accordion] invitation full type
>
> ```ts theme={null}
> {
>   accept_url?: string | null,
>   email?: string | null,
>   role?: string | null
> } | null
> ```

***

### clients.createChatbot

`agency.clients.createChatbot`

Create an AI agent in a client workspace

**Risk:** `write`

```ts theme={null}
await corsair.sitespeakai.api.agency.clients.createChatbot({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `client_id` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `website_url` | `string` | No | — |
| `accent_color` | `string` | No | — |
| `idempotency_key` | `string` | Yes | Sent as the Idempotency-Key header. Retrying with the same key (and body) returns the original response instead of repeating the action. |

**Output**

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

> [accordion] chatbot full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   enabled?: boolean | null,
>   accent_color?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   messages_remaining?: number | null,
>   team_id?: string | null,
>   type?: string | null,
>   header_icon?: string | null,
>   launcher_icon?: string | null,
>   open_count?: number | null,
>   unread_count?: number | null
> }
> ```

***

### clients.get

`agency.clients.get`

Retrieve an agency client workspace and its current usage

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.agency.clients.get({});
```

**Input**

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

**Output**

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

> [accordion] client full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   external_reference?: string | null,
>   status?: string | null,
>   pause_mode?: string | null,
>   paused_at?: string | null,
>   byok_enabled?: boolean | null,
>   enabled_integrations?: string[] | null,
>   enabled_features?: string[] | null,
>   limits?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null,
>     response_tokens?: number | null
>   } | null,
>   usage?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null
>   } | null,
>   messages_remaining?: number | null,
>   topup_credits_remaining?: number | null,
>   credits_exhausted_at?: string | null,
>   credits_reset_at?: string | null,
>   created_at?: string | null
> }
> ```

***

### clients.list

`agency.clients.list`

List agency client workspaces, optionally filtered by external reference

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.agency.clients.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `external_reference` | `string` | No | — |

**Output**

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

> [accordion] clients full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   external_reference?: string | null,
>   status?: string | null,
>   pause_mode?: string | null,
>   paused_at?: string | null,
>   byok_enabled?: boolean | null,
>   enabled_integrations?: string[] | null,
>   enabled_features?: string[] | null,
>   limits?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null,
>     response_tokens?: number | null
>   } | null,
>   usage?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null
>   } | null,
>   messages_remaining?: number | null,
>   topup_credits_remaining?: number | null,
>   credits_exhausted_at?: string | null,
>   credits_reset_at?: string | null,
>   created_at?: string | null
> }[]
> ```

***

### clients.listChatbots

`agency.clients.listChatbots`

List AI agents in a client workspace

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.agency.clients.listChatbots({});
```

**Input**

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

**Output**

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

> [accordion] chatbots full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   enabled?: boolean | null,
>   accent_color?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   messages_remaining?: number | null,
>   team_id?: string | null,
>   type?: string | null,
>   header_icon?: string | null,
>   launcher_icon?: string | null,
>   open_count?: number | null,
>   unread_count?: number | null
> }[]
> ```

***

### clients.pause

`agency.clients.pause`

Pause a client workspace with a hard or soft stop

**Risk:** `write`

```ts theme={null}
await corsair.sitespeakai.api.agency.clients.pause({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `client_id` | `string` | Yes | — |
| `mode` | `soft \| hard` | Yes | — |
| `idempotency_key` | `string` | Yes | Sent as the Idempotency-Key header. Retrying with the same key (and body) returns the original response instead of repeating the action. |

**Output**

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

> [accordion] client full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   external_reference?: string | null,
>   status?: string | null,
>   pause_mode?: string | null,
>   paused_at?: string | null,
>   byok_enabled?: boolean | null,
>   enabled_integrations?: string[] | null,
>   enabled_features?: string[] | null,
>   limits?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null,
>     response_tokens?: number | null
>   } | null,
>   usage?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null
>   } | null,
>   messages_remaining?: number | null,
>   topup_credits_remaining?: number | null,
>   credits_exhausted_at?: string | null,
>   credits_reset_at?: string | null,
>   created_at?: string | null
> }
> ```

***

### clients.resume

`agency.clients.resume`

Resume a paused or suspended client workspace

**Risk:** `write`

```ts theme={null}
await corsair.sitespeakai.api.agency.clients.resume({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `client_id` | `string` | Yes | — |
| `idempotency_key` | `string` | Yes | Sent as the Idempotency-Key header. Retrying with the same key (and body) returns the original response instead of repeating the action. |

**Output**

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

> [accordion] client full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   external_reference?: string | null,
>   status?: string | null,
>   pause_mode?: string | null,
>   paused_at?: string | null,
>   byok_enabled?: boolean | null,
>   enabled_integrations?: string[] | null,
>   enabled_features?: string[] | null,
>   limits?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null,
>     response_tokens?: number | null
>   } | null,
>   usage?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null
>   } | null,
>   messages_remaining?: number | null,
>   topup_credits_remaining?: number | null,
>   credits_exhausted_at?: string | null,
>   credits_reset_at?: string | null,
>   created_at?: string | null
> }
> ```

***

### clients.suspend

`agency.clients.suspend`

Suspend a client workspace while retaining its data

**Risk:** `write`

```ts theme={null}
await corsair.sitespeakai.api.agency.clients.suspend({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `client_id` | `string` | Yes | — |
| `idempotency_key` | `string` | Yes | Sent as the Idempotency-Key header. Retrying with the same key (and body) returns the original response instead of repeating the action. |

**Output**

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

> [accordion] client full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   external_reference?: string | null,
>   status?: string | null,
>   pause_mode?: string | null,
>   paused_at?: string | null,
>   byok_enabled?: boolean | null,
>   enabled_integrations?: string[] | null,
>   enabled_features?: string[] | null,
>   limits?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null,
>     response_tokens?: number | null
>   } | null,
>   usage?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null
>   } | null,
>   messages_remaining?: number | null,
>   topup_credits_remaining?: number | null,
>   credits_exhausted_at?: string | null,
>   credits_reset_at?: string | null,
>   created_at?: string | null
> }
> ```

***

### clients.update

`agency.clients.update`

Update client workspace limits, access, or credit reset settings

**Risk:** `write`

```ts theme={null}
await corsair.sitespeakai.api.agency.clients.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `client_id` | `string` | Yes | — |
| `name` | `string` | No | — |
| `external_reference` | `string \| null` | No | — |
| `message_limit` | `number \| null` | No | — |
| `source_limit` | `number \| null` | No | — |
| `chatbot_limit` | `number \| null` | No | — |
| `response_token_limit` | `number \| null` | No | — |
| `byok_enabled` | `boolean` | No | — |
| `enabled_integrations` | `(whatsapp \| hubspot \| slack \| google_chat \| telegram \| discord \| actions)[] \| null` | No | — |
| `enabled_features` | `(auto_sitemaps \| remove_powered_by \| voice \| inbox_translation \| inbox_email_drafts \| custom_domain \| pii_redaction \| audit_log \| api_access \| advanced_xai_models)[] \| null` | No | — |
| `reset_credits` | `boolean` | No | — |
| `idempotency_key` | `string` | No | Sent as the Idempotency-Key header. Retrying with the same key (and body) returns the original response instead of repeating the action. |

**Output**

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

> [accordion] client full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   external_reference?: string | null,
>   status?: string | null,
>   pause_mode?: string | null,
>   paused_at?: string | null,
>   byok_enabled?: boolean | null,
>   enabled_integrations?: string[] | null,
>   enabled_features?: string[] | null,
>   limits?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null,
>     response_tokens?: number | null
>   } | null,
>   usage?: {
>     chatbots?: number | null,
>     sources?: number | null,
>     messages?: number | null
>   } | null,
>   messages_remaining?: number | null,
>   topup_credits_remaining?: number | null,
>   credits_exhausted_at?: string | null,
>   credits_reset_at?: string | null,
>   created_at?: string | null
> }
> ```

***

### webhooks.create

`agency.webhooks.create`

Create an outbound webhook endpoint and receive its signing secret

**Risk:** `write`

```ts theme={null}
await corsair.sitespeakai.api.agency.webhooks.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `url` | `string` | Yes | — |
| `events` | `string[] \| null` | No | Events to subscribe to. Omit or null to receive every event, including ones added later. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook` | `object` | Yes | — |
| `secret` | `string \| null` | No | — |

> [accordion] webhook full type
>
> ```ts theme={null}
> {
>   id: string,
>   team_id?: string | null,
>   url?: string | null,
>   events?: string[] | null,
>   active?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }
> ```

***

### webhooks.delete

`agency.webhooks.delete`

Delete an outbound webhook and its delivery history

**Risk:** `destructive`

```ts theme={null}
await corsair.sitespeakai.api.agency.webhooks.delete({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `message` | `string \| null` | No | — |

***

### webhooks.list

`agency.webhooks.list`

List configured outbound webhook endpoints and event types

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.agency.webhooks.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhooks` | `object[]` | Yes | — |
| `events` | `string[] \| null` | No | — |

> [accordion] webhooks full type
>
> ```ts theme={null}
> {
>   id: string,
>   team_id?: string | null,
>   url?: string | null,
>   events?: string[] | null,
>   active?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### webhooks.listDeliveries

`agency.webhooks.listDeliveries`

List paginated delivery attempts for a webhook endpoint

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.agency.webhooks.listDeliveries({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_id` | `string` | Yes | — |
| `page` | `number` | No | — |
| `per_page` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `current_page` | `number \| null` | No | — |
| `data` | `object[]` | Yes | — |
| `per_page` | `number \| null` | No | — |
| `total` | `number \| null` | No | — |
| `last_page` | `number \| null` | No | — |
| `next_page_url` | `string \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   agency_webhook_id?: string | null,
>   event?: string | null,
>   payload?: Record<string, any> | null,
>   response_status?: number | null,
>   attempts?: number | null,
>   last_error?: string | null,
>   delivered_at?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### webhooks.test

`agency.webhooks.test`

Send a signed ping event to test a webhook endpoint

**Risk:** `write`

```ts theme={null}
await corsair.sitespeakai.api.agency.webhooks.test({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `delivery_id` | `string \| null` | No | — |

***

### webhooks.update

`agency.webhooks.update`

Update an outbound webhook URL, events, or active state

**Risk:** `write`

```ts theme={null}
await corsair.sitespeakai.api.agency.webhooks.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_id` | `string` | Yes | — |
| `url` | `string` | No | — |
| `events` | `string[] \| null` | No | Events to subscribe to, or null for every event |
| `active` | `boolean` | No | — |
| `idempotency_key` | `string` | Yes | Sent as the Idempotency-Key header. Retrying with the same key (and body) returns the original response instead of repeating the action. |

**Output**

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

> [accordion] webhook full type
>
> ```ts theme={null}
> {
>   id: string,
>   team_id?: string | null,
>   url?: string | null,
>   events?: string[] | null,
>   active?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }
> ```

***

## Analytics

### get

`analytics.get`

Retrieve chatbot analytics for a date range

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.analytics.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chatbot_id` | `string` | Yes | The chatbot ID, shown on the chatbot settings page |
| `from` | `string` | No | Start date (YYYY-MM-DD). Defaults to 30 days ago. |
| `to` | `string` | No | End date (YYYY-MM-DD). Defaults to today; the range is capped at 366 days. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `fromDate` | `string \| null` | No | — |
| `toDate` | `string \| null` | No | — |
| `totalConversations` | `number \| null` | No | — |
| `averageConversationsPerDay` | `number \| null` | No | — |
| `answeredQuestionsPercentage` | `number \| null` | No | — |
| `negativeSentimentPercentage` | `number \| null` | No | — |
| `messagesPerConversation` | `number \| null` | No | — |
| `positiveFeedback` | `number \| null` | No | — |
| `negativeFeedback` | `number \| null` | No | — |
| `uniqueLinkClicks` | `number \| null` | No | — |
| `leads` | `number \| null` | No | — |
| `previousPeriodConversations` | `number \| null` | No | — |
| `previousPeriodAnsweredQuestionsPercentage` | `number \| null` | No | — |
| `previousPeriodNegativeSentimentPercentage` | `number \| null` | No | — |
| `previousPeriodMessagesPerConversation` | `number \| null` | No | — |
| `previousPeriodPositiveFeedback` | `number \| null` | No | — |
| `previousPeriodNegativeFeedback` | `number \| null` | No | — |
| `conversationsPerDay` | `Record<string, number \| null> \| null` | No | — |
| `popular` | `object \| null` | No | — |
| `insights` | `object \| null` | No | — |

> [accordion] popular full type
>
> ```ts theme={null}
> {
>   popularLinks?: {
>     id?: string | null,
>     url?: string | null,
>     title?: string | null,
>     conversations_count?: number | null
>   }[] | null,
>   popularCategories?: {
>     name?: string | null,
>     conversations_count?: number | null
>   }[] | null,
>   popularEvents?: {
>     value?: string | null,
>     click_count?: number | null
>   }[] | null,
>   topCountries?: {
>     country?: string | null,
>     country_code?: string | null,
>     visitors_count?: number | null
>   }[] | null
> } | null
> ```

> [accordion] insights full type
>
> ```ts theme={null}
> {
>   period_type?: string | null,
>   answered_questions?: {
>     insight_data?: {
>       summary_question?: string | null,
>       theme?: string | null,
>       frequency?: number | null,
>       examples?: string[] | null
>     }[] | null
>   } | null,
>   unanswered_questions?: any | null
> } | null
> ```

***

## Chatbot

### get

`chatbot.get`

Retrieve chatbot settings

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.chatbot.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chatbot_id` | `string` | Yes | The chatbot ID, shown on the chatbot settings page |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `user_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `welcome_message` | `string \| null` | No | — |
| `placeholder` | `string \| null` | No | — |
| `accent_color` | `string \| null` | No | — |
| `launcher_icon` | `string \| null` | No | — |
| `launcher_text` | `string \| null` | No | — |
| `header_icon` | `string \| null` | No | — |
| `share_icon` | `string \| null` | No | — |
| `font_size` | `string \| null` | No | — |
| `header_size` | `string \| null` | No | — |
| `height` | `number \| null` | No | — |
| `sources_label` | `string \| null` | No | — |
| `enable_sources` | `number \| boolean \| null` | No | — |
| `hide_powered_by` | `number \| boolean \| null` | No | — |
| `enable_hide_chatbot` | `number \| boolean \| null` | No | — |
| `position` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `domain_id` | `string \| null` | No | — |
| `domain_verified` | `number \| boolean \| null` | No | — |
| `goals_prompt` | `string \| null` | No | — |
| `system_prompt` | `string \| null` | No | — |
| `user_prompt` | `string \| null` | No | — |
| `default_answer` | `string \| null` | No | — |
| `default_language` | `string \| null` | No | — |
| `history_count` | `number \| null` | No | — |
| `gpt_model` | `string \| null` | No | — |
| `temperature` | `number \| null` | No | — |
| `topK` | `number \| null` | No | — |
| `enable_escalations` | `number \| boolean \| null` | No | — |
| `enable_escalations_notification` | `number \| boolean \| null` | No | — |
| `escalations_email` | `string \| null` | No | — |
| `escalate_message_threshold` | `number \| null` | No | — |
| `enable_chatgpt_fallback` | `number \| boolean \| null` | No | — |
| `fallback_excluded_topics` | `any \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |
| `deleted_at` | `string \| null` | No | — |

***

## Conversations

### list

`conversations.list`

Retrieve visitor conversation history for a chatbot

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.conversations.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chatbot_id` | `string` | Yes | The chatbot ID, shown on the chatbot settings page |
| `conversation_id` | `string` | No | Only return messages of this conversation (visitor) |
| `include_deleted` | `boolean` | No | — |
| `include_sources` | `boolean` | No | — |
| `limit` | `number` | No | Maximum entries to return. Defaults to 10. |
| `order` | `asc \| desc` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: string,
>   chatbot_id?: string | null,
>   visitor_id?: string | null,
>   thread_id?: string | null,
>   entry?: string | null,
>   speaker?: string | null,
>   avatar?: string | null,
>   status?: string | null,
>   feedback?: any | null,
>   category_id?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   deleted_at?: string | null,
>   sources?: any[] | null
> }[]
> ```

***

## Leads

### list

`leads.list`

List leads captured by a chatbot

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.leads.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chatbot_id` | `string` | Yes | The chatbot ID, shown on the chatbot settings page |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: string,
>   chatbot_id?: string | null,
>   visitor_id?: string | null,
>   name?: string | null,
>   email?: string | null,
>   phone?: string | null,
>   status?: string | null,
>   last_entry_at?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

## Prompts

### list

`prompts.list`

List suggested messages for a chatbot

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.prompts.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chatbot_id` | `string` | Yes | The chatbot ID, shown on the chatbot settings page |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: string,
>   chatbot_id?: string | null,
>   name?: string | null,
>   prompt?: string | null,
>   type?: string | null,
>   action?: any | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

## Query

### ask

`query.ask`

Ask a chatbot a question and return its answer and source URLs (uses one message credit and records a conversation)

**Risk:** `destructive`

```ts theme={null}
await corsair.sitespeakai.api.query.ask({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chatbot_id` | `string` | Yes | The chatbot ID, shown on the chatbot settings page |
| `prompt` | `string` | Yes | — |
| `conversation_id` | `string` | No | Groups questions and answers into one conversation |
| `format` | `html \| markdown` | No | Answer format. Defaults to markdown. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `text` | `string \| null` | No | — |
| `urls` | `string[] \| null` | No | — |

***

## Sources

### list

`sources.list`

List chatbot training sources and their statuses

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.sources.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chatbot_id` | `string` | Yes | The chatbot ID, shown on the chatbot settings page |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: string,
>   chatbot_id?: string | null,
>   type?: string | null,
>   indexer?: string | null,
>   indexer_id?: string | null,
>   url?: string | null,
>   path?: string | null,
>   title?: string | null,
>   status?: string | null,
>   sync_frequency?: string | null,
>   trained_at?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   deleted_at?: string | null
> }[]
> ```

***

## Updated Answers

### create

`updatedAnswers.create`

Create or update a custom answer for a chatbot

**Risk:** `write`

```ts theme={null}
await corsair.sitespeakai.api.updatedAnswers.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chatbot_id` | `string` | Yes | The chatbot ID, shown on the chatbot settings page |
| `question` | `string` | Yes | — |
| `suggested_answer` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `message` | `string \| null` | No | — |
| `finetune` | `object \| null` | No | — |

> [accordion] finetune full type
>
> ```ts theme={null}
> {
>   id: string,
>   chatbot_id?: string | null,
>   question?: string | null,
>   suggested_answer?: string | null,
>   vector_id?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> } | null
> ```

***

### delete

`updatedAnswers.delete`

Delete a custom answer from a chatbot

**Risk:** `destructive`

```ts theme={null}
await corsair.sitespeakai.api.updatedAnswers.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chatbot_id` | `string` | Yes | The chatbot ID, shown on the chatbot settings page |
| `finetune_id` | `string` | Yes | ID of the updated answer to delete |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `message` | `string \| null` | No | — |

***

### list

`updatedAnswers.list`

List custom updated answers for a chatbot

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.updatedAnswers.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `chatbot_id` | `string` | Yes | The chatbot ID, shown on the chatbot settings page |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: string,
>   chatbot_id?: string | null,
>   question?: string | null,
>   suggested_answer?: string | null,
>   vector_id?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

## User

### get

`user.get`

Retrieve the authenticated user account

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.user.get({});
```

**Input:** *empty object*

**Output**

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

> [accordion] user full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   email?: string | null,
>   social_id?: string | null,
>   social_type?: string | null,
>   current_team_id?: string | null,
>   profile_photo_path?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   avatar?: string | null,
>   profile_photo_url?: string | null
> }
> ```

***

### listChatbots

`user.listChatbots`

List chatbots in the authenticated account

**Risk:** `read`

```ts theme={null}
await corsair.sitespeakai.api.user.listChatbots({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   enabled?: boolean | null,
>   accent_color?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null,
>   messages_remaining?: number | null,
>   team_id?: string | null,
>   type?: string | null,
>   header_icon?: string | null,
>   launcher_icon?: string | null,
>   open_count?: number | null,
>   unread_count?: number | null
> }[]
> ```

***


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