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

# Gleap API reference

> API reference for the Gleap plugin in Corsair: every `gleap.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).

## Boards

### create

`boards.create`

Create a new ticket board with custom lanes

**Risk:** `write`

```ts theme={null}
await corsair.gleap.api.boards.create({ name: 'Bug Tracker' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |
| `restrictedToUsers` | `string[]` | No | — |
| `restrictedToTeams` | `string[]` | No | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `path` | `string \| null` | No | — |
| `restrictedToUsers` | `string[] \| null` | No | — |

***

### delete

`boards.delete`

Delete an empty ticket board

**Risk:** `destructive`

```ts theme={null}
await corsair.gleap.api.boards.delete({ type: 'BUG' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `type` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output**

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

***

### list

`boards.list`

List all ticket boards (ticket types) for a project

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.boards.list({});
```

**Input**

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

**Output:** `object[]`

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

***

### update

`boards.update`

Update a board configuration

**Risk:** `write`

```ts theme={null}
await corsair.gleap.api.boards.update({ type: 'BUG', name: 'Software Bugs' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `type` | `string` | Yes | — |
| `name` | `string` | No | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `path` | `string \| null` | No | — |
| `restrictedToUsers` | `string[] \| null` | No | — |

***

## Companies

### createOrUpdate

`companies.createOrUpdate`

Create or update a customer company record

**Risk:** `write`

```ts theme={null}
await corsair.gleap.api.companies.createOrUpdate({ companyId: 'comp_123', name: 'Acme Corp' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `companyId` | `string` | Yes | — |
| `name` | `string` | No | — |
| `domain` | `string` | No | — |
| `plan` | `string` | No | — |
| `value` | `number` | No | — |
| `customData` | `Record<string, any>` | No | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `companyId` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `plan` | `string \| null` | No | — |
| `value` | `number \| null` | No | — |

***

### delete

`companies.delete`

Delete a customer company record

**Risk:** `destructive`

```ts theme={null}
await corsair.gleap.api.companies.delete({ companyId: 'comp_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `companyId` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output**

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

***

### get

`companies.get`

Get company details by company ID

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.companies.get({ companyId: 'comp_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `companyId` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `companyId` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `plan` | `string \| null` | No | — |
| `value` | `number \| null` | No | — |

***

### list

`companies.list`

List tracked customer companies in a project

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.companies.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `skip` | `number` | No | — |
| `limit` | `number` | No | — |
| `search` | `string` | No | — |
| `project` | `string` | No | — |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   _id?: string | null,
>   companyId?: string | null,
>   name?: string | null,
>   domain?: string | null,
>   plan?: string | null,
>   value?: number | null
> }[] | {
>   companies: {
>     id?: string | null,
>     _id?: string | null,
>     companyId?: string | null,
>     name?: string | null,
>     domain?: string | null,
>     plan?: string | null,
>     value?: number | null
>   }[]
> }
> ```

***

## Feedback

### rateConversation

`feedback.rateConversation`

Rate a Conversations API conversation as the customer (CSAT, integer 0 to 10)

**Risk:** `write`

```ts theme={null}
await corsair.gleap.api.feedback.rateConversation({ conversationId: 'conv_123', rating: 10 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversationId` | `string` | Yes | — |
| `rating` | `number` | Yes | — |

**Output**

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

***

### rateMessage

`feedback.rateMessage`

Rate a message as the customer: positive or negative (thumbs up or down)

**Risk:** `write`

```ts theme={null}
await corsair.gleap.api.feedback.rateMessage({ messageId: 'msg_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `messageId` | `string` | Yes | — |
| `rating` | `positive \| negative` | Yes | — |

**Output**

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

***

### surveysGet

`feedback.surveysGet`

Get details and schema of an engagement survey

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.feedback.surveysGet({ surveyId: 'survey_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `surveyId` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `title` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |

***

### surveysList

`feedback.surveysList`

Get all engagement surveys for a project

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.feedback.surveysList({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `skip` | `number` | No | — |
| `limit` | `number` | No | — |
| `sort` | `string` | No | — |
| `project` | `string` | No | — |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   _id?: string | null,
>   name?: string | null,
>   title?: string | null,
>   status?: string | null,
>   createdAt?: string | null
> }[] | {
>   items: {
>     id?: string | null,
>     _id?: string | null,
>     name?: string | null,
>     title?: string | null,
>     status?: string | null,
>     createdAt?: string | null
>   }[]
> }
> ```

***

### surveysResponses

`feedback.surveysResponses`

Get submitted responses for a survey

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.feedback.surveysResponses({ surveyId: 'survey_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `surveyId` | `string` | Yes | — |
| `skip` | `number` | No | — |
| `limit` | `number` | No | — |
| `project` | `string` | No | — |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string,
>   answers?: any
> }[] | {
>   items: any[]
> }
> ```

***

### surveysStats

`feedback.surveysStats`

Get aggregate survey result statistics and daily counters

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.feedback.surveysStats({ surveyId: 'survey_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `surveyId` | `string` | Yes | — |
| `from` | `string` | No | — |
| `to` | `string` | No | — |
| `version` | `string` | No | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `version` | `string` | No | — |
| `totals` | `object` | No | — |

> [accordion] totals full type
>
> ```ts theme={null}
> {
>   shown?: number,
>   started?: number,
>   completed?: number
> }
> ```

***

## Messages

### create

`messages.create`

Create a new message or internal note in a ticket

**Risk:** `destructive`

```ts theme={null}
await corsair.gleap.api.messages.create({ ticket: 'ticket_123', markdownComment: 'Hello from support' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `ticket` | `string` | Yes | — |
| `comment` | `string` | No | — |
| `markdownComment` | `string` | No | — |
| `type` | `string` | No | — |
| `isNote` | `boolean` | No | — |
| `replyTo` | `string` | No | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `ticket` | `any` | No | — |
| `user` | `any` | No | — |
| `session` | `any` | No | — |
| `comment` | `any` | No | — |
| `markdownComment` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `isNote` | `boolean \| null` | No | — |
| `bot` | `boolean \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `attachments` | `object[]` | No | — |

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

***

### createThread

`messages.createThread`

Reply inside a message thread (internal: visible to teammates, never to the customer)

**Risk:** `destructive`

```ts theme={null}
await corsair.gleap.api.messages.createThread({ messageId: 'msg_123', comment: 'Follow-up reply' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `messageId` | `string` | Yes | — |
| `comment` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `ticket` | `any` | No | — |
| `user` | `any` | No | — |
| `session` | `any` | No | — |
| `comment` | `any` | No | — |
| `markdownComment` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `isNote` | `boolean \| null` | No | — |
| `bot` | `boolean \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `attachments` | `object[]` | No | — |

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

***

### delete

`messages.delete`

Delete a message from a ticket

**Risk:** `destructive`

```ts theme={null}
await corsair.gleap.api.messages.delete({ messageId: 'msg_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `messageId` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output**

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

***

### getThread

`messages.getThread`

Get thread messages for a specific parent message

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.messages.getThread({ messageId: 'msg_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `messageId` | `string` | Yes | — |
| `before` | `string` | No | — |
| `limit` | `number` | No | — |
| `project` | `string` | No | — |

**Output:** `object \| object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   items: {
>     id?: string | null,
>     _id?: string | null,
>     ticket?: any,
>     user?: any,
>     session?: any,
>     comment?: any,
>     markdownComment?: string | null,
>     type?: string | null,
>     isNote?: boolean | null,
>     bot?: boolean | null,
>     createdAt?: string | null,
>     updatedAt?: string | null,
>     attachments?: {
>       name?: string | null,
>       url?: string | null,
>       type?: string | null
>     }[]
>   }[],
>   hasMore?: boolean | null,
>   nextBefore?: string | null
> } | {
>   id?: string | null,
>   _id?: string | null,
>   ticket?: any,
>   user?: any,
>   session?: any,
>   comment?: any,
>   markdownComment?: string | null,
>   type?: string | null,
>   isNote?: boolean | null,
>   bot?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   attachments?: {
>     name?: string | null,
>     url?: string | null,
>     type?: string | null
>   }[]
> }[] | {
>   messages: {
>     id?: string | null,
>     _id?: string | null,
>     ticket?: any,
>     user?: any,
>     session?: any,
>     comment?: any,
>     markdownComment?: string | null,
>     type?: string | null,
>     isNote?: boolean | null,
>     bot?: boolean | null,
>     createdAt?: string | null,
>     updatedAt?: string | null,
>     attachments?: {
>       name?: string | null,
>       url?: string | null,
>       type?: string | null
>     }[]
>   }[]
> }
> ```

***

### list

`messages.list`

Find messages in a ticket with filtering and pagination

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.messages.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `ticket` | `string` | No | — |
| `paginated` | `boolean` | No | — |
| `before` | `string` | No | — |
| `limit` | `number` | No | — |
| `skip` | `number` | No | — |
| `project` | `string` | No | — |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   _id?: string | null,
>   ticket?: any,
>   user?: any,
>   session?: any,
>   comment?: any,
>   markdownComment?: string | null,
>   type?: string | null,
>   isNote?: boolean | null,
>   bot?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   attachments?: {
>     name?: string | null,
>     url?: string | null,
>     type?: string | null
>   }[]
> }[] | {
>   items: {
>     id?: string | null,
>     _id?: string | null,
>     ticket?: any,
>     user?: any,
>     session?: any,
>     comment?: any,
>     markdownComment?: string | null,
>     type?: string | null,
>     isNote?: boolean | null,
>     bot?: boolean | null,
>     createdAt?: string | null,
>     updatedAt?: string | null,
>     attachments?: {
>       name?: string | null,
>       url?: string | null,
>       type?: string | null
>     }[]
>   }[],
>   hasMore?: boolean | null,
>   nextBefore?: string | null
> }
> ```

***

### update

`messages.update`

Replace a message's text (Gleap overwrites the whole message body)

**Risk:** `write`

```ts theme={null}
await corsair.gleap.api.messages.update({ messageId: 'msg_123', comment: 'Updated message' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `messageId` | `string` | Yes | — |
| `comment` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `ticket` | `any` | No | — |
| `user` | `any` | No | — |
| `session` | `any` | No | — |
| `comment` | `any` | No | — |
| `markdownComment` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `isNote` | `boolean \| null` | No | — |
| `bot` | `boolean \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `attachments` | `object[]` | No | — |

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

***

## Sessions

### activities

`sessions.activities`

Get timeline activities and events for a session

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.sessions.activities({ sessionId: 'sess_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sessionId` | `string` | Yes | — |
| `limit` | `number` | No | Activities per page (Gleap default 50) |
| `skip` | `number` | No | Activities to skip, newest first (Gleap default 0) |
| `project` | `string` | No | — |

**Output:** `object[] \| object`

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

***

### create

`sessions.create`

Create a new contact session in a project

**Risk:** `write`

```ts theme={null}
await corsair.gleap.api.sessions.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `userId` | `string` | No | — |
| `name` | `string` | No | — |
| `email` | `string` | No | — |
| `phone` | `string` | No | — |
| `value` | `number` | No | — |
| `plan` | `string` | No | — |
| `customData` | `Record<string, any>` | No | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `userId` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `phone` | `string \| null` | No | — |
| `value` | `number \| null` | No | — |
| `plan` | `string \| null` | No | — |
| `customData` | `Record<string, any>` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### delete

`sessions.delete`

Delete a contact session and permanently delete every ticket attached to it

**Risk:** `destructive`

```ts theme={null}
await corsair.gleap.api.sessions.delete({ sessionId: 'sess_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sessionId` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output**

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

***

### get

`sessions.get`

Get contact session details by session ID

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.sessions.get({ sessionId: 'sess_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sessionId` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `userId` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `phone` | `string \| null` | No | — |
| `value` | `number \| null` | No | — |
| `plan` | `string \| null` | No | — |
| `customData` | `Record<string, any>` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### getByUserId

`sessions.getByUserId`

Get a contact session by end-user ID

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.sessions.getByUserId({ userId: 'usr_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `userId` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `userId` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `phone` | `string \| null` | No | — |
| `value` | `number \| null` | No | — |
| `plan` | `string \| null` | No | — |
| `customData` | `Record<string, any>` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### list

`sessions.list`

List contact sessions in a project

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.sessions.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `skip` | `number` | No | — |
| `limit` | `number` | No | — |
| `sort` | `string` | No | — |
| `project` | `string` | No | — |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   _id?: string | null,
>   userId?: string | null,
>   name?: string | null,
>   email?: string | null,
>   phone?: string | null,
>   value?: number | null,
>   plan?: string | null,
>   customData?: Record<string, any>,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | {
>   sessions: {
>     id?: string | null,
>     _id?: string | null,
>     userId?: string | null,
>     name?: string | null,
>     email?: string | null,
>     phone?: string | null,
>     value?: number | null,
>     plan?: string | null,
>     customData?: Record<string, any>,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   }[],
>   total?: number
> }
> ```

***

### search

`sessions.search`

Search for contact sessions by query attributes

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.sessions.search({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `searchTerm` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   _id?: string | null,
>   userId?: string | null,
>   name?: string | null,
>   email?: string | null,
>   phone?: string | null,
>   value?: number | null,
>   plan?: string | null,
>   customData?: Record<string, any>,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | {
>   results: {
>     id?: string | null,
>     _id?: string | null,
>     userId?: string | null,
>     name?: string | null,
>     email?: string | null,
>     phone?: string | null,
>     value?: number | null,
>     plan?: string | null,
>     customData?: Record<string, any>,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   }[]
> }
> ```

***

### update

`sessions.update`

Update a contact session

**Risk:** `write`

```ts theme={null}
await corsair.gleap.api.sessions.update({ sessionId: 'sess_123', name: 'Jane Doe' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sessionId` | `string` | Yes | — |
| `name` | `string` | No | — |
| `email` | `string` | No | — |
| `phone` | `string` | No | — |
| `value` | `number` | No | — |
| `plan` | `string` | No | — |
| `customData` | `Record<string, any>` | No | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `userId` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `phone` | `string \| null` | No | — |
| `value` | `number \| null` | No | — |
| `plan` | `string \| null` | No | — |
| `customData` | `Record<string, any>` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

## Teams

### create

`teams.create`

Create a new team in a project

**Risk:** `write`

```ts theme={null}
await corsair.gleap.api.teams.create({
	name: 'Support Tier 1',
	members: ['user_123'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |
| `assignmentMethod` | `random \| balanced \| manual \| circular` | Yes | — |
| `members` | `string[]` | Yes | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `assignmentMethod` | `string \| null` | No | — |
| `members` | `any[] \| null` | No | — |

***

### delete

`teams.delete`

Delete a team from a project

**Risk:** `destructive`

```ts theme={null}
await corsair.gleap.api.teams.delete({ teamId: 'team_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `teamId` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output**

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

***

### list

`teams.list`

Get all teams associated with a project

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.teams.list({});
```

**Input**

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

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   _id?: string | null,
>   name?: string | null,
>   assignmentMethod?: string | null,
>   members?: any[] | null
> }[]
> ```

***

### update

`teams.update`

Replace a team's name, assignment method and full member list

**Risk:** `destructive`

```ts theme={null}
await corsair.gleap.api.teams.update({
	teamId: 'team_123',
	name: 'Support Tier 2',
	members: ['user_123'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `teamId` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `assignmentMethod` | `random \| balanced \| manual \| circular` | Yes | — |
| `members` | `string[]` | Yes | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `assignmentMethod` | `string \| null` | No | — |
| `members` | `any[] \| null` | No | — |

***

## Tickets

### counts

`tickets.counts`

Get ticket counts grouped by board and status lane

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.tickets.counts({});
```

**Input**

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

**Output:** `object[] \| Record<string, number> \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   _id?: string | null,
>   count: number
> }[] | Record<string, number> | {
>   counts?: Record<string, number>
> }
> ```

***

### create

`tickets.create`

Create a new ticket in a project

**Risk:** `write`

```ts theme={null}
await corsair.gleap.api.tickets.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `title` | `string` | No | — |
| `description` | `string` | No | — |
| `type` | `string` | No | — |
| `status` | `string` | No | — |
| `priority` | `string` | No | — |
| `session` | `string` | No | — |
| `sourceTicketId` | `string` | No | — |
| `conversationClosed` | `boolean` | No | — |
| `customData` | `Record<string, any>` | No | — |
| `formData` | `Record<string, any>` | No | — |
| `attributes` | `Record<string, any>` | No | — |
| `linkedTickets` | `string[]` | No | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `ticketNumber` | `number \| string \| null` | No | — |
| `title` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `priority` | `string \| null` | No | — |
| `session` | `any` | No | — |
| `project` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `customData` | `Record<string, any>` | No | — |
| `formData` | `Record<string, any>` | No | — |
| `attributes` | `Record<string, any>` | No | — |
| `processingUser` | `any` | No | — |
| `processingTeam` | `any` | No | — |
| `slaBreached` | `boolean \| null` | No | — |
| `snoozed` | `boolean \| null` | No | — |
| `snoozedUntil` | `string \| null` | No | — |
| `mentions` | `any[] \| null` | No | — |
| `linkedTickets` | `any[] \| null` | No | — |

***

### delete

`tickets.delete`

Permanently delete a ticket and its associated data and replies

**Risk:** `destructive`

```ts theme={null}
await corsair.gleap.api.tickets.delete({ ticketId: 'ticket_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `ticketId` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output**

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

***

### get

`tickets.get`

Get a ticket in a project by its ID

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.tickets.get({ ticketId: 'ticket_123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `ticketId` | `string` | Yes | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `ticketNumber` | `number \| string \| null` | No | — |
| `title` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `priority` | `string \| null` | No | — |
| `session` | `any` | No | — |
| `project` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `customData` | `Record<string, any>` | No | — |
| `formData` | `Record<string, any>` | No | — |
| `attributes` | `Record<string, any>` | No | — |
| `processingUser` | `any` | No | — |
| `processingTeam` | `any` | No | — |
| `slaBreached` | `boolean \| null` | No | — |
| `snoozed` | `boolean \| null` | No | — |
| `snoozedUntil` | `string \| null` | No | — |
| `mentions` | `any[] \| null` | No | — |
| `linkedTickets` | `any[] \| null` | No | — |

***

### list

`tickets.list`

Get all tickets in a project with support for filtering, sorting, and pagination

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.tickets.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `type` | `string` | No | — |
| `status` | `string` | No | — |
| `priority` | `string` | No | — |
| `ignoreArchived` | `boolean` | No | — |
| `archived` | `boolean` | No | — |
| `isSpam` | `boolean` | No | — |
| `startDate` | `string` | No | — |
| `endDate` | `string` | No | — |
| `updatedAt` | `string` | No | — |
| `createdAt` | `string` | No | — |
| `sort` | `string` | No | — |
| `skip` | `number` | No | — |
| `limit` | `number` | No | — |
| `project` | `string` | No | — |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   _id?: string | null,
>   ticketNumber?: number | string | null,
>   title?: string | null,
>   description?: string | null,
>   type?: string | null,
>   status?: string | null,
>   priority?: string | null,
>   session?: any,
>   project?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   customData?: Record<string, any>,
>   formData?: Record<string, any>,
>   attributes?: Record<string, any>,
>   processingUser?: any,
>   processingTeam?: any,
>   slaBreached?: boolean | null,
>   snoozed?: boolean | null,
>   snoozedUntil?: string | null,
>   mentions?: any[] | null,
>   linkedTickets?: any[] | null
> }[] | {
>   tickets: {
>     id?: string | null,
>     _id?: string | null,
>     ticketNumber?: number | string | null,
>     title?: string | null,
>     description?: string | null,
>     type?: string | null,
>     status?: string | null,
>     priority?: string | null,
>     session?: any,
>     project?: string | null,
>     createdAt?: string | null,
>     updatedAt?: string | null,
>     customData?: Record<string, any>,
>     formData?: Record<string, any>,
>     attributes?: Record<string, any>,
>     processingUser?: any,
>     processingTeam?: any,
>     slaBreached?: boolean | null,
>     snoozed?: boolean | null,
>     snoozedUntil?: string | null,
>     mentions?: any[] | null,
>     linkedTickets?: any[] | null
>   }[],
>   count?: number | null
> } | {
>   items: {
>     id?: string | null,
>     _id?: string | null,
>     ticketNumber?: number | string | null,
>     title?: string | null,
>     description?: string | null,
>     type?: string | null,
>     status?: string | null,
>     priority?: string | null,
>     session?: any,
>     project?: string | null,
>     createdAt?: string | null,
>     updatedAt?: string | null,
>     customData?: Record<string, any>,
>     formData?: Record<string, any>,
>     attributes?: Record<string, any>,
>     processingUser?: any,
>     processingTeam?: any,
>     slaBreached?: boolean | null,
>     snoozed?: boolean | null,
>     snoozedUntil?: string | null,
>     mentions?: any[] | null,
>     linkedTickets?: any[] | null
>   }[],
>   total?: number | null
> }
> ```

***

### search

`tickets.search`

Full-text search over project tickets and comments

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.tickets.search({ searchTerm: 'checkout error' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `searchTerm` | `string` | Yes | — |
| `type` | `string` | No | — |
| `status` | `string` | No | — |
| `archived` | `boolean` | No | — |
| `addSession` | `boolean` | No | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `hits` | `object[]` | No | — |

> [accordion] hits full type
>
> ```ts theme={null}
> {
>   ticket?: {
>     id?: string | null,
>     _id?: string | null,
>     ticketNumber?: number | string | null,
>     title?: string | null,
>     description?: string | null,
>     type?: string | null,
>     status?: string | null,
>     priority?: string | null,
>     session?: any,
>     project?: string | null,
>     createdAt?: string | null,
>     updatedAt?: string | null,
>     customData?: Record<string, any>,
>     formData?: Record<string, any>,
>     attributes?: Record<string, any>,
>     processingUser?: any,
>     processingTeam?: any,
>     slaBreached?: boolean | null,
>     snoozed?: boolean | null,
>     snoozedUntil?: string | null,
>     mentions?: any[] | null,
>     linkedTickets?: any[] | null
>   },
>   score?: number
> }[]
> ```

***

### update

`tickets.update`

Update an existing ticket in a project

**Risk:** `write`

```ts theme={null}
await corsair.gleap.api.tickets.update({ ticketId: 'ticket_123', status: 'OPEN' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `ticketId` | `string` | Yes | — |
| `title` | `string` | No | — |
| `description` | `string` | No | — |
| `type` | `string` | No | — |
| `status` | `string` | No | — |
| `priority` | `string` | No | — |
| `processingUser` | `string \| null` | No | — |
| `processingTeam` | `string \| null` | No | — |
| `snoozed` | `boolean` | No | — |
| `snoozedUntil` | `string \| null` | No | — |
| `slaBreached` | `boolean` | No | — |
| `customData` | `Record<string, any>` | No | — |
| `project` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `ticketNumber` | `number \| string \| null` | No | — |
| `title` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `priority` | `string \| null` | No | — |
| `session` | `any` | No | — |
| `project` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `customData` | `Record<string, any>` | No | — |
| `formData` | `Record<string, any>` | No | — |
| `attributes` | `Record<string, any>` | No | — |
| `processingUser` | `any` | No | — |
| `processingTeam` | `any` | No | — |
| `slaBreached` | `boolean \| null` | No | — |
| `snoozed` | `boolean \| null` | No | — |
| `snoozedUntil` | `string \| null` | No | — |
| `mentions` | `any[] \| null` | No | — |
| `linkedTickets` | `any[] \| null` | No | — |

***

## Users

### getMe

`users.getMe`

Get the currently authenticated user profile

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.users.getMe({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |
| `imageUrl` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |

***

### list

`users.list`

Get all team members who can access the project

**Risk:** `read`

```ts theme={null}
await corsair.gleap.api.users.list({});
```

**Input**

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

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   _id?: string | null,
>   name?: string | null,
>   email?: string | null,
>   role?: string | null,
>   imageUrl?: string | null,
>   createdAt?: string | null
> }[]
> ```

***

### update

`users.update`

Update the API key owner's own profile (name, job title, availability); Gleap ignores the user id

**Risk:** `write`

```ts theme={null}
await corsair.gleap.api.users.update({ userId: 'user_123', firstName: 'Alex', lastName: 'Smith' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `userId` | `string` | Yes | — |
| `firstName` | `string` | No | — |
| `lastName` | `string` | No | — |
| `jobTitle` | `string` | No | — |
| `department` | `string` | No | — |
| `phone` | `string` | No | — |
| `available` | `boolean` | No | — |
| `awayUntil` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `_id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |
| `imageUrl` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |

***


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