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

# Convex API reference

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

## Custom Domains

### delete

`customDomains.delete`

Remove a custom domain from a Convex deployment

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

```ts theme={null}
await corsair.convex.api.customDomains.delete({ deployment_name: 'happy-otter-123', requestDestination: 'convexSite', domain: 'api.example.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `deployment_name` | `string` | Yes | — |
| `requestDestination` | `convexCloud \| convexSite` | Yes | — |
| `domain` | `string` | Yes | — |

**Output**

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

***

## Deploy Keys

### create

`deployKeys.create`

Create a deploy key for a Convex deployment

**Risk:** `write`

```ts theme={null}
await corsair.convex.api.deployKeys.create({
	deployment_name: 'happy-otter-123',
	name: 'ci',
	allowedActions: ['deployment:deploy'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `deployment_name` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `allowedActions` | `(deployment:deploy \| deployment:env:view \| deployment:env:write \| deployment:pause \| deployment:unpause \| deployment:logs:view \| deployment:metrics:view \| deployment:integrations:view \| deployment:integrations:write \| deployment:data:view \| deployment:data:write \| deployment:backups:view \| deployment:backups:create \| deployment:backups:download \| deployment:backups:delete \| deployment:backups:import \| deployment:functions:actAsUser \| deployment:functions:runInternalQueries \| deployment:functions:runInternalMutations \| deployment:functions:runInternalActions \| deployment:functions:runTestQuery \| deployment:auditLog:view \| deployment:usageLimits:view \| deployment:usageLimits:write \| deployment:usage:view \| deployment:aiGateway:use)[]` | No | — |
| `expiresAt` | `number \| null` | No | — |

**Output**

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

***

### list

`deployKeys.list`

List deploy keys for a Convex deployment

**Risk:** `read`

```ts theme={null}
await corsair.convex.api.deployKeys.list({ deployment_name: 'happy-otter-123' });
```

**Input**

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

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: number,
>   name: string,
>   creationTime: number,
>   lastUsedTime?: number | null,
>   expiresAt?: number | null,
>   creator?: number | null,
>   managedBy?: vercel | {
>     oauthApp: string
>   } | null,
>   allowedActions: string[]
> }[]
> ```

***

## Deployment

### executeQueryBatch

`deployment.executeQueryBatch`

Execute a batch of Convex queries against a deployment

**Risk:** `read`

```ts theme={null}
await corsair.convex.api.deployment.executeQueryBatch({
	subdomain: 'happy-otter-123',
	queries: [{
		path: 'messages:list',
		args: { channel: 'general' },
	}],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subdomain` | `string` | No | — |
| `deploymentUrl` | `string` | No | — |
| `deployKey` | `string` | No | — |
| `queries` | `object[]` | Yes | — |

> [accordion] queries full type
>
> ```ts theme={null}
> {
>   path: string,
>   args: Record<string, JsonValue>,
>   format?: string | null
> }[]
> ```

**Output**

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

> [accordion] results full type
>
> ```ts theme={null}
> (
>   {
>     status: success,
>     value: JsonValue,
>     logLines?: string[]
>   } | {
>     status: error,
>     errorMessage: string,
>     errorData?: JsonValue,
>     logLines?: string[]
>   }
> )[]
> ```

***

### getQueryTimestamp

`deployment.getQueryTimestamp`

Get the current query timestamp for a Convex deployment

**Risk:** `read`

```ts theme={null}
await corsair.convex.api.deployment.getQueryTimestamp({ subdomain: 'happy-otter-123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subdomain` | `string` | No | — |
| `deploymentUrl` | `string` | No | — |
| `deployKey` | `string` | No | — |

**Output**

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

***

### listLogStreams

`deployment.listLogStreams`

List log streams configured for a Convex deployment

**Risk:** `read`

```ts theme={null}
await corsair.convex.api.deployment.listLogStreams({ subdomain: 'happy-otter-123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `subdomain` | `string` | No | — |
| `deploymentUrl` | `string` | No | — |
| `deployKey` | `string` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: string,
>   logStreamType: datadog | webhook | axiom | sentry | postHogLogs | postHogErrorTracking | s3Export,
>   status: {
>     type: pending | restarting | failed | active | deleting,
>     reason?: string
>   },
>   topics?: string[] | null
> }[]
> ```

***

## Deployments

### create

`deployments.create`

Create a new deployment for a Convex project

**Risk:** `write`

```ts theme={null}
await corsair.convex.api.deployments.create({ project_id: '123', type: 'prod', region: 'aws-us-east-1' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `project_id` | `string` | Yes | — |
| `type` | `dev \| prod \| preview \| custom` | Yes | — |
| `class` | `string \| null` | No | — |
| `region` | `string \| null` | No | — |
| `reference` | `string \| null` | No | — |
| `isDefault` | `boolean \| null` | No | — |
| `expiresAt` | `number \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | No | — |
| `name` | `string` | Yes | — |
| `createTime` | `number` | Yes | — |
| `lastDeployTime` | `number \| null` | No | — |
| `deploymentType` | `dev \| prod \| preview \| custom` | Yes | — |
| `projectId` | `number` | Yes | — |
| `creator` | `number \| null` | No | — |
| `previewIdentifier` | `string \| null` | No | — |
| `region` | `string` | No | — |
| `isDefault` | `boolean` | No | — |
| `reference` | `string` | No | — |
| `dashboardEditConfirmation` | `boolean \| null` | No | — |
| `deploymentUrl` | `string` | No | — |
| `expiresAt` | `number \| null` | No | — |
| `class` | `string` | No | — |
| `sendLogsToClient` | `boolean \| null` | No | — |
| `kind` | `cloud \| local` | Yes | — |
| `port` | `number` | No | — |
| `deviceName` | `string` | No | — |
| `isActive` | `boolean` | No | — |

***

### delete

`deployments.delete`

Delete a Convex deployment and all of its data and files

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

```ts theme={null}
await corsair.convex.api.deployments.delete({ deployment_name: 'happy-otter-123' });
```

**Input**

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

**Output**

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

***

### get

`deployments.get`

Get details about a Convex cloud deployment

**Risk:** `read`

```ts theme={null}
await corsair.convex.api.deployments.get({ deployment_name: 'happy-otter-123' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | No | — |
| `name` | `string` | Yes | — |
| `createTime` | `number` | Yes | — |
| `lastDeployTime` | `number \| null` | No | — |
| `deploymentType` | `dev \| prod \| preview \| custom` | Yes | — |
| `projectId` | `number` | Yes | — |
| `creator` | `number \| null` | No | — |
| `previewIdentifier` | `string \| null` | No | — |
| `region` | `string` | No | — |
| `isDefault` | `boolean` | No | — |
| `reference` | `string` | No | — |
| `dashboardEditConfirmation` | `boolean \| null` | No | — |
| `deploymentUrl` | `string` | No | — |
| `expiresAt` | `number \| null` | No | — |
| `class` | `string` | No | — |
| `sendLogsToClient` | `boolean \| null` | No | — |
| `kind` | `cloud \| local` | Yes | — |
| `port` | `number` | No | — |
| `deviceName` | `string` | No | — |
| `isActive` | `boolean` | No | — |

***

### list

`deployments.list`

List deployments for a Convex project

**Risk:** `read`

```ts theme={null}
await corsair.convex.api.deployments.list({ project_id: '123', deploymentType: 'prod' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `project_id` | `string` | Yes | — |
| `includeLocal` | `boolean` | No | — |
| `isDefault` | `boolean \| null` | No | — |
| `deploymentType` | `dev \| prod \| preview \| custom` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: number,
>   name: string,
>   createTime: number,
>   lastDeployTime?: number | null,
>   deploymentType: dev | prod | preview | custom,
>   projectId: number,
>   creator?: number | null,
>   previewIdentifier?: string | null,
>   region?: string,
>   isDefault?: boolean,
>   reference?: string,
>   dashboardEditConfirmation?: boolean | null,
>   deploymentUrl?: string,
>   expiresAt?: number | null,
>   class?: string,
>   sendLogsToClient?: boolean | null,
>   kind: cloud | local,
>   port?: number,
>   deviceName?: string,
>   isActive?: boolean
> }[]
> ```

***

### update

`deployments.update`

Update properties of an existing Convex deployment

**Risk:** `write`

```ts theme={null}
await corsair.convex.api.deployments.update({ deployment_name: 'happy-otter-123', reference: 'staging' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `deployment_name` | `string` | Yes | — |
| `reference` | `string \| null` | No | — |
| `dashboardEditConfirmation` | `boolean \| null` | No | — |
| `expiresAt` | `number \| null` | No | — |
| `sendLogsToClient` | `boolean \| null` | No | — |
| `class` | `string \| null` | No | — |
| `isDefault` | `boolean \| null` | No | — |
| `deploymentType` | `dev \| prod \| preview \| custom \| null` | No | — |

**Output**

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

***

## Platform

### getTokenDetails

`platform.getTokenDetails`

Get details about the token used to authenticate

**Risk:** `read`

```ts theme={null}
await corsair.convex.api.platform.getTokenDetails({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `teamId` | `number` | No | — |
| `projectId` | `number` | No | — |
| `name` | `string` | Yes | — |
| `createTime` | `number` | Yes | — |
| `type` | `teamToken \| projectToken` | Yes | — |

***

### listDeploymentClasses

`platform.listDeploymentClasses`

List the deployment classes available to a Convex team

**Risk:** `read`

```ts theme={null}
await corsair.convex.api.platform.listDeploymentClasses({ team_id: '41' });
```

**Input**

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

**Output**

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

> [accordion] items full type
>
> ```ts theme={null}
> {
>   type: string,
>   available: boolean
> }[]
> ```

***

### listDeploymentRegions

`platform.listDeploymentRegions`

List the deployment regions available to a Convex team

**Risk:** `read`

```ts theme={null}
await corsair.convex.api.platform.listDeploymentRegions({ team_id: '41' });
```

**Input**

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

**Output**

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

> [accordion] items full type
>
> ```ts theme={null}
> {
>   name: string,
>   displayName: string,
>   available: boolean
> }[]
> ```

***

## Projects

### create

`projects.create`

Create a new Convex project, optionally provisioning a deployment

**Risk:** `write`

```ts theme={null}
await corsair.convex.api.projects.create({ team_id: '41', projectName: 'My App', deploymentType: 'dev' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `team_id` | `string` | Yes | — |
| `projectName` | `string` | Yes | — |
| `deploymentType` | `dev \| prod \| preview \| custom \| null` | No | — |
| `deploymentClass` | `string \| null` | No | — |
| `deploymentRegion` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `number` | Yes | — |
| `id` | `number` | Yes | — |
| `slug` | `string` | Yes | — |
| `deploymentName` | `string \| null` | No | — |
| `deploymentUrl` | `string \| null` | No | — |

***

### delete

`projects.delete`

Delete a Convex project and all of its deployments

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

```ts theme={null}
await corsair.convex.api.projects.delete({ project_id: '123' });
```

**Input**

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

**Output**

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

***

### getById

`projects.getById`

Get a Convex project by its ID

**Risk:** `read`

```ts theme={null}
await corsair.convex.api.projects.getById({ project_id: '123' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `name` | `string` | Yes | — |
| `slug` | `string` | Yes | — |
| `teamId` | `number` | Yes | — |
| `teamSlug` | `string` | Yes | — |
| `createTime` | `number` | Yes | — |
| `prodDeploymentName` | `string \| null` | No | — |
| `devDeploymentName` | `string \| null` | No | — |

***

### getBySlug

`projects.getBySlug`

Get a Convex project by team identifier and project slug

**Risk:** `read`

```ts theme={null}
await corsair.convex.api.projects.getBySlug({ team_id_or_slug: 'acme', project_slug: 'my-app' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `team_id_or_slug` | `string` | Yes | — |
| `project_slug` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |
| `name` | `string` | Yes | — |
| `slug` | `string` | Yes | — |
| `teamId` | `number` | Yes | — |
| `teamSlug` | `string` | Yes | — |
| `createTime` | `number` | Yes | — |
| `prodDeploymentName` | `string \| null` | No | — |
| `devDeploymentName` | `string \| null` | No | — |

***

### list

`projects.list`

List projects in a Convex team

**Risk:** `read`

```ts theme={null}
await corsair.convex.api.projects.list({ team_id: '41', limit: 20 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `team_id` | `string` | Yes | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |
| `q` | `string` | No | — |

**Output**

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

> [accordion] items full type
>
> ```ts theme={null}
> {
>   id: number,
>   name: string,
>   slug: string,
>   teamId: number,
>   teamSlug: string,
>   createTime: number,
>   prodDeploymentName?: string | null,
>   devDeploymentName?: string | null
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   hasMore: boolean,
>   nextCursor?: string | null
> }
> ```

***


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