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

# 21st API reference

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

## Account

### get

`account.get`

Get the caller’s identity, plan, and remaining request quota.

**Risk:** `read`

```ts theme={null}
await corsair.twentyfirst.api.account.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `user` | `object` | No | — |
| `team` | `object \| null` | No | — |
| `plan` | `string \| null` | No | — |
| `requestsRemaining` | `number \| null` | No | — |

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

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

***

### getRegistry

`account.getRegistry`

Get the caller's identity for registry/CLI context (includes team slug)

**Risk:** `read`

```ts theme={null}
await corsair.twentyfirst.api.account.getRegistry({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `user` | `object` | No | — |
| `team` | `object \| null` | No | — |
| `plan` | `string \| null` | No | — |
| `requestsRemaining` | `number \| null` | No | — |

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

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

***

## Components

### getInstallPackage

`components.getInstallPackage`

Retrieve component source files and dependency metadata.

**Risk:** `read`

```ts theme={null}
await corsair.twentyfirst.api.components.getInstallPackage({ username: 'example-author', slug: 'date-picker' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | Author username, optionally prefixed with @ as in install\_ref. |
| `slug` | `string` | Yes | Component slug, the part after / in install\_ref. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string \| null` | No | — |
| `slug` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `registry` | `string \| null` | No | — |
| `visibility` | `string \| null` | No | — |
| `author` | `string \| null` | No | — |
| `install_ref` | `string \| null` | No | — |
| `runtime` | `string \| null` | No | — |
| `files` | `object[]` | Yes | — |
| `dependencies` | `string[]` | No | — |
| `registry_dependencies` | `string[]` | No | — |
| `index_css_url` | `string \| null` | No | — |
| `preview` | `object \| null` | No | — |

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

> [accordion] preview full type
>
> ```ts theme={null}
> {
>   bundle_html_url?: string | null,
>   preview_image_url?: string | null
> } | null
> ```

***

### publish

`components.publish`

Publish a new component, or update an existing one. 21st builds it in a sandbox and answers when the build is done (30 publishes per hour).

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.components.publish({
	body: {
		metadata: {
			name: 'Calendar',
			slug: 'calendar',
			description: 'A date picker',
			runtime: 'react',
			registry: 'ui',
			visibility: 'private',
			demos: [{ name: 'Default', slug: 'default', file_index: 0 }],
		},
		componentCode: { filename: 'calendar.tsx', content: 'export function Calendar() { return <div>Calendar</div>; }' },
		demoFiles: [{ filename: 'default.tsx', content: 'import { Calendar } from "@/components/ui/calendar";
export default function Default() { return <Calendar />; }' }],
	},
});
```

**Input**

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

> [accordion] body full type
>
> ```ts theme={null}
> {
>   metadata: {
>     name: string,
>     slug?: string,
>     description: string,
>     runtime: react | expo,
>     dependencies?: Record<string, string>,
>     component_dependencies?: Record<string, string>,
>     registry_dependencies?: string[],
>     registry: ui | hooks | blocks | icons,
>     license?: string,
>     visibility?: published | private | unlisted | public,
>     submit_for_featuring?: boolean,
>     registry_slug?: string,
>     website_url?: string,
>     tags?: string[],
>     demos: {
>       name: string,
>       slug: string,
>       file_index: number,
>       preview_index?: number,
>       preview_dark_index?: number,
>       tags?: string[],
>       dependencies?: Record<string, string>,
>       registry_dependencies?: string[]
>     }[]
>   },
>   componentCode: {
>     filename: string,
>     content?: string,
>     base64?: string,
>     contentType?: string
>   },
>   demoFiles?: {
>     filename: string,
>     content?: string,
>     base64?: string,
>     contentType?: string
>   }[],
>   previewImages?: {
>     filename: string,
>     content?: string,
>     base64?: string,
>     contentType?: string
>   }[],
>   expectedComponentId?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `component_id` | `number \| null` | No | — |
| `is_new` | `boolean \| null` | No | — |
| `username` | `string \| null` | No | — |
| `slug` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `visibility` | `string` | No | — |
| `install_ref` | `string \| null` | No | — |
| `demos` | `object[]` | No | — |
| `duration_ms` | `number \| null` | No | — |

> [accordion] demos full type
>
> ```ts theme={null}
> {
> }[]
> ```

***

### search

`components.search`

Search the 21st component catalog or your team library.

**Risk:** `read`

```ts theme={null}
await corsair.twentyfirst.api.components.search({ q: 'date picker', scope: 'public', limit: 5 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `q` | `string` | Yes | Search text. |
| `scope` | `team \| mine \| public` | No | public searches the whole registry, team your team library, mine your own components. 21st defaults to team. |
| `limit` | `number` | No | Results to return, 1-50 (default 25). |

**Output**

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

> [accordion] results full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   slug?: string | null,
>   description?: string | null,
>   registry?: string | null,
>   visibility?: string | null,
>   author?: string | null,
>   install_ref?: string | null,
>   url?: string | null,
>   preview_url?: string | null,
>   bundle_html_url?: string | null,
>   tags?: string[] | null,
>   updated_at?: string | null,
>   score?: number | null
> }[]
> ```

***

### submitReview

`components.submitReview`

Move a component through catalog review

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.components.submitReview({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |
| `slug` | `string` | Yes | Component slug or numeric id. |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   action: submit | withdraw | resubmit | remove_from_catalog
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `slug` | `string \| null` | No | — |
| `visibility` | `string` | No | — |
| `reviewStatus` | `string \| null` | No | — |
| `updated` | `boolean \| null` | No | — |

***

### unpublish

`components.unpublish`

Unpublish a component: 21st sets it to private. It is not hard-deleted.

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.components.unpublish({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `slug` | `string` | Yes | Component slug or numeric id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `slug` | `string \| null` | No | — |
| `visibility` | `string \| null` | No | — |
| `unpublished` | `boolean \| null` | No | — |
| `already` | `boolean \| null` | No | — |

***

### update

`components.update`

Update an owned component's visibility, description, or tags

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.components.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |
| `slug` | `string` | Yes | Component slug or numeric id. |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   visibility?: published | private | unlisted | public,
>   description?: string | null,
>   tags?: string[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `slug` | `string \| null` | No | — |
| `visibility` | `string` | No | — |
| `reviewStatus` | `string \| null` | No | — |
| `updated` | `boolean \| null` | No | — |

***

## Drafts

### create

`drafts.create`

Create a new draft (spawns a sandbox)

**Risk:** `destructive`

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

**Input**

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

> [accordion] body full type
>
> ```ts theme={null}
> {
>   metadata: {
>     name: string,
>     slug?: string,
>     description: string,
>     runtime: react | expo,
>     dependencies?: Record<string, string>,
>     component_dependencies?: Record<string, string>,
>     registry_dependencies?: string[],
>     registry: ui | hooks | blocks | icons,
>     license?: string,
>     visibility?: published | private | unlisted | public,
>     submit_for_featuring?: boolean,
>     registry_slug?: string,
>     website_url?: string,
>     tags?: string[],
>     demos: {
>       name: string,
>       slug: string,
>       file_index: number,
>       preview_index?: number,
>       preview_dark_index?: number,
>       tags?: string[],
>       dependencies?: Record<string, string>,
>       registry_dependencies?: string[]
>     }[]
>   },
>   componentCode: {
>     filename: string,
>     content?: string,
>     base64?: string,
>     contentType?: string
>   },
>   demoFiles?: {
>     filename: string,
>     content?: string,
>     base64?: string,
>     contentType?: string
>   }[],
>   previewImages?: {
>     filename: string,
>     content?: string,
>     base64?: string,
>     contentType?: string
>   }[],
>   expectedComponentId?: number,
>   draftRequestId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `state` | `string \| null` | No | — |
| `draft_id` | `string \| null` | No | — |
| `sandbox_id` | `string \| null` | No | — |
| `editor_url` | `string \| null` | No | — |
| `status_url` | `string \| null` | No | — |
| `review_url` | `string \| null` | No | — |
| `component_id` | `number \| null` | No | — |
| `url` | `string \| null` | No | — |
| `install_ref` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |
| `retryable` | `boolean \| null` | No | — |

***

### createRevision

`drafts.createRevision`

Check out a published component into an editable draft

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.drafts.createRevision({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `componentId` | `number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `state` | `string \| null` | No | — |
| `draft_id` | `string \| null` | No | — |
| `sandbox_id` | `string \| null` | No | — |
| `editor_url` | `string \| null` | No | — |
| `status_url` | `string \| null` | No | — |
| `review_url` | `string \| null` | No | — |
| `component_id` | `number \| null` | No | — |
| `url` | `string \| null` | No | — |
| `install_ref` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |
| `retryable` | `boolean \| null` | No | — |

***

### delete

`drafts.delete`

Delete a draft

**Risk:** `destructive`

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

**Input**

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

**Output:** `JsonValue`

***

### get

`drafts.get`

Poll a draft's status

**Risk:** `read`

```ts theme={null}
await corsair.twentyfirst.api.drafts.get({ draftId: '3f9b6c1e-2d4a-4b8e-9c71-5a0e2f6d8b13' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `state` | `string \| null` | No | — |
| `draft_id` | `string \| null` | No | — |
| `sandbox_id` | `string \| null` | No | — |
| `editor_url` | `string \| null` | No | — |
| `status_url` | `string \| null` | No | — |
| `review_url` | `string \| null` | No | — |
| `component_id` | `number \| null` | No | — |
| `url` | `string \| null` | No | — |
| `install_ref` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |
| `retryable` | `boolean \| null` | No | — |

***

### getReview

`drafts.getReview`

Get review context for a draft

**Risk:** `read`

```ts theme={null}
await corsair.twentyfirst.api.drafts.getReview({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `state` | `string \| null` | No | — |
| `draftId` | `string \| null` | No | — |
| `sourceHash` | `string \| null` | No | — |
| `sourceDigest` | `string \| null` | No | — |
| `component` | `object` | No | — |
| `demos` | `object[]` | No | — |
| `media` | `object` | No | — |

> [accordion] component full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] demos full type
>
> ```ts theme={null}
> {
> }[]
> ```

> [accordion] media full type
>
> ```ts theme={null}
> {
> }
> ```

***

### listWorkspaces

`drafts.listWorkspaces`

List the caller's published components and in-progress drafts together

**Risk:** `read`

```ts theme={null}
await corsair.twentyfirst.api.drafts.listWorkspaces({ status: 'draft', limit: 10 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | — |
| `status` | `all \| draft \| published \| private` | No | — |
| `scope` | `string` | No | — |
| `componentCursor` | `string` | No | — |
| `draftCursor` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `components` | `object` | No | — |
| `drafts` | `object` | No | — |
| `draftAllowance` | `object` | No | — |

> [accordion] components full type
>
> ```ts theme={null}
> {
>   items?: {
>     ref?: string | null,
>     kind?: string | null,
>     id?: number | null,
>     name?: string | null,
>     slug?: string | null,
>     status?: string | null,
>     visibility?: string,
>     reviewStatus?: string | null,
>     demoCount?: number | null,
>     updatedAt?: string | null,
>     editorUrl?: string | null,
>     canEdit?: boolean | null,
>     canEditCode?: boolean | null
>   }[],
>   nextCursor?: string | null
> }
> ```

> [accordion] drafts full type
>
> ```ts theme={null}
> {
>   items?: {
>     ref?: string | null,
>     kind?: string | null,
>     id?: string | null,
>     name?: string | null,
>     status?: string | null,
>     editorUrl?: string | null,
>     updatedAt?: string | null
>   }[],
>   nextCursor?: string | null
> }
> ```

> [accordion] draftAllowance full type
>
> ```ts theme={null}
> {
>   remaining?: number | null,
>   limit?: number | null
> }
> ```

***

### publish

`drafts.publish`

Publish a draft as a real component

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.drafts.publish({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `draftId` | `string` | Yes | — |
| `body` | `object` | Yes | The same source and metadata the draft holds. 21st checks it against the draft before publishing. |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   metadata: {
>     name: string,
>     slug?: string,
>     description: string,
>     runtime: react | expo,
>     dependencies?: Record<string, string>,
>     component_dependencies?: Record<string, string>,
>     registry_dependencies?: string[],
>     registry: ui | hooks | blocks | icons,
>     license?: string,
>     visibility?: published | private | unlisted | public,
>     submit_for_featuring?: boolean,
>     registry_slug?: string,
>     website_url?: string,
>     tags?: string[],
>     demos: {
>       name: string,
>       slug: string,
>       file_index: number,
>       preview_index?: number,
>       preview_dark_index?: number,
>       tags?: string[],
>       dependencies?: Record<string, string>,
>       registry_dependencies?: string[]
>     }[]
>   },
>   componentCode: {
>     filename: string,
>     content?: string,
>     base64?: string,
>     contentType?: string
>   },
>   demoFiles?: {
>     filename: string,
>     content?: string,
>     base64?: string,
>     contentType?: string
>   }[],
>   previewImages?: {
>     filename: string,
>     content?: string,
>     base64?: string,
>     contentType?: string
>   }[],
>   expectedComponentId?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `component_id` | `number \| null` | No | — |
| `is_new` | `boolean \| null` | No | — |
| `username` | `string \| null` | No | — |
| `slug` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `visibility` | `string` | No | — |
| `install_ref` | `string \| null` | No | — |
| `demos` | `object[]` | No | — |
| `duration_ms` | `number \| null` | No | — |

> [accordion] demos full type
>
> ```ts theme={null}
> {
> }[]
> ```

***

### requestReview

`drafts.requestReview`

Trigger generated cover/video capture for a draft

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.drafts.requestReview({});
```

**Input**

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

> [accordion] body full type
>
> ```ts theme={null}
> {
>   action: ensure_media
> }
> ```

**Output:** `JsonValue`

***

### updateSource

`drafts.updateSource`

Push updated source into an existing draft

**Risk:** `write`

```ts theme={null}
await corsair.twentyfirst.api.drafts.updateSource({});
```

**Input**

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

> [accordion] body full type
>
> ```ts theme={null}
> {
>   metadata: {
>     name: string,
>     slug?: string,
>     description: string,
>     runtime: react | expo,
>     dependencies?: Record<string, string>,
>     component_dependencies?: Record<string, string>,
>     registry_dependencies?: string[],
>     registry: ui | hooks | blocks | icons,
>     license?: string,
>     visibility?: published | private | unlisted | public,
>     submit_for_featuring?: boolean,
>     registry_slug?: string,
>     website_url?: string,
>     tags?: string[],
>     demos: {
>       name: string,
>       slug: string,
>       file_index: number,
>       preview_index?: number,
>       preview_dark_index?: number,
>       tags?: string[],
>       dependencies?: Record<string, string>,
>       registry_dependencies?: string[]
>     }[]
>   },
>   componentCode: {
>     filename: string,
>     content?: string,
>     base64?: string,
>     contentType?: string
>   },
>   demoFiles?: {
>     filename: string,
>     content?: string,
>     base64?: string,
>     contentType?: string
>   }[],
>   previewImages?: {
>     filename: string,
>     content?: string,
>     base64?: string,
>     contentType?: string
>   }[],
>   expectedComponentId?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `state` | `string \| null` | No | — |
| `draftId` | `string \| null` | No | — |
| `sourceHash` | `string \| null` | No | — |
| `sourceDigest` | `string \| null` | No | — |
| `changed` | `boolean \| null` | No | — |
| `requiresRetry` | `boolean \| null` | No | — |
| `mediaQueued` | `boolean \| null` | No | — |

***

## Libraries

### create

`libraries.create`

Create a new library

**Risk:** `write`

```ts theme={null}
await corsair.twentyfirst.api.libraries.create({
	body: { name: 'Design system', slug: 'design-system' },
});
```

**Input**

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

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name: string,
>   slug: string,
>   description?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `library` | `object` | No | — |

> [accordion] library full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   slug?: string | null,
>   description?: string | null,
>   displayName?: string | null,
>   logoUrl?: string | null,
>   websiteUrl?: string | null,
>   githubUrl?: string | null,
>   twitterUrl?: string | null,
>   isPublicPage?: boolean | null,
>   scope?: {
>     kind?: string | null,
>     teamId?: string | null
>   },
>   componentCount?: number | null
> }
> ```

***

### get

`libraries.get`

Get one manageable library

**Risk:** `read`

```ts theme={null}
await corsair.twentyfirst.api.libraries.get({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `library` | `object` | No | — |

> [accordion] library full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   slug?: string | null,
>   description?: string | null,
>   displayName?: string | null,
>   logoUrl?: string | null,
>   websiteUrl?: string | null,
>   githubUrl?: string | null,
>   twitterUrl?: string | null,
>   isPublicPage?: boolean | null,
>   scope?: {
>     kind?: string | null,
>     teamId?: string | null
>   },
>   componentCount?: number | null
> }
> ```

***

### list

`libraries.list`

List every library (personal and team) the caller can manage

**Risk:** `read`

```ts theme={null}
await corsair.twentyfirst.api.libraries.list({});
```

**Input:** *empty object*

**Output**

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

> [accordion] libraries full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   slug?: string | null,
>   description?: string | null,
>   displayName?: string | null,
>   logoUrl?: string | null,
>   websiteUrl?: string | null,
>   githubUrl?: string | null,
>   twitterUrl?: string | null,
>   isPublicPage?: boolean | null,
>   scope?: {
>     kind?: string | null,
>     teamId?: string | null
>   },
>   componentCount?: number | null
> }[]
> ```

***

### update

`libraries.update`

Edit a library's identity/branding

**Risk:** `write`

```ts theme={null}
await corsair.twentyfirst.api.libraries.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |
| `slug` | `string` | Yes | Library slug. |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name?: string,
>   description?: string,
>   display_name?: string,
>   website_url?: string,
>   github_url?: string,
>   twitter_url?: string,
>   public_page?: boolean,
>   logo_url?: string,
>   logo?: {
>     filename: string,
>     content?: string,
>     base64?: string,
>     contentType?: string
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `library` | `object` | No | — |

> [accordion] library full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   slug?: string | null,
>   description?: string | null,
>   displayName?: string | null,
>   logoUrl?: string | null,
>   websiteUrl?: string | null,
>   githubUrl?: string | null,
>   twitterUrl?: string | null,
>   isPublicPage?: boolean | null,
>   scope?: {
>     kind?: string | null,
>     teamId?: string | null
>   },
>   componentCount?: number | null
> }
> ```

***

## Profile

### get

`profile.get`

Get the caller's own bento profile board

**Risk:** `read`

```ts theme={null}
await corsair.twentyfirst.api.profile.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean \| null` | No | — |
| `blocks` | `object[]` | No | — |
| `warnings` | `string[]` | No | — |

> [accordion] blocks full type
>
> ```ts theme={null}
> {
>   type: string,
>   demoId?: string | null,
>   refId?: string | null,
>   url?: string | null,
>   headline?: string | null,
>   body?: string | null,
>   email?: string | null,
>   cta?: string | null,
>   text?: string | null,
>   mediaUrl?: string | null,
>   w?: number | null,
>   h?: number | null
> }[]
> ```

***

### replaceBento

`profile.replaceBento`

Replace the caller's public bento profile board, clear it, or turn it on or off. The old board is not kept.

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.profile.replaceBento({});
```

**Input**

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

> [accordion] body full type
>
> ```ts theme={null}
> {
>   blocks?: {
>     type: component | social | hire | pro | support | note | image | divider | ascii | template | theme | gradient | library,
>     demoId?: string,
>     refId?: string,
>     url?: string,
>     headline?: string,
>     body?: string,
>     email?: string,
>     cta?: string,
>     text?: string,
>     mediaUrl?: string,
>     w?: number,
>     h?: number
>   }[],
>   clear?: true,
>   enabled?: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean \| null` | No | — |
| `blocks` | `object[]` | No | — |
| `warnings` | `string[]` | No | — |

> [accordion] blocks full type
>
> ```ts theme={null}
> {
>   type: string,
>   demoId?: string | null,
>   refId?: string | null,
>   url?: string | null,
>   headline?: string | null,
>   body?: string | null,
>   email?: string | null,
>   cta?: string | null,
>   text?: string | null,
>   mediaUrl?: string | null,
>   w?: number | null,
>   h?: number | null
> }[]
> ```

***

### uploadMedia

`profile.uploadMedia`

Upload an image for use in an `image` bento block

**Risk:** `write`

```ts theme={null}
await corsair.twentyfirst.api.profile.uploadMedia({});
```

**Input**

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

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

**Output**

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

***

## Teams

### createInviteLink

`teams.createInviteLink`

Create the team's invite link if it doesn't exist yet

**Risk:** `write`

```ts theme={null}
await corsair.twentyfirst.api.teams.createInviteLink({});
```

**Input:** *empty object*

**Output:** `JsonValue`

***

### getInviteLink

`teams.getInviteLink`

Get the team's invite link. Needs a team API key; a personal key gets 403 no\_team.

**Risk:** `read`

```ts theme={null}
await corsair.twentyfirst.api.teams.getInviteLink({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `invite_url` | `string \| null` | No | — |
| `token` | `string \| null` | No | — |
| `team_id` | `string \| null` | No | — |
| `team_name` | `string \| null` | No | — |
| `rotated` | `boolean \| null` | No | — |
| `onboarding` | `object` | No | — |

> [accordion] onboarding full type
>
> ```ts theme={null}
> {
>   cli_setup_url?: string | null,
>   install_command?: string | null
> }
> ```

***

### rotateInviteLink

`teams.rotateInviteLink`

Rotate the team's invite link so the old link stops working (team owner only).

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.teams.rotateInviteLink({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `invite_url` | `string \| null` | No | — |
| `token` | `string \| null` | No | — |
| `team_id` | `string \| null` | No | — |
| `team_name` | `string \| null` | No | — |
| `rotated` | `boolean \| null` | No | — |
| `onboarding` | `object` | No | — |

> [accordion] onboarding full type
>
> ```ts theme={null}
> {
>   cli_setup_url?: string | null,
>   install_command?: string | null
> }
> ```

***

## Templates

### delete

`templates.delete`

Delete an owned template

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.templates.delete({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `deleted` | `boolean \| null` | No | — |

***

### publish

`templates.publish`

Publish a new template listing

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.templates.publish({});
```

**Input**

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

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name: string,
>   description?: string,
>   website_preview_url: string,
>   preview_url: string,
>   video_url?: string,
>   payment_url?: string,
>   price?: number,
>   tagIds?: number[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `slug` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `template` | `object` | No | — |

> [accordion] template full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   slug?: string | null,
>   name?: string | null,
>   description?: string | null,
>   status?: string | null,
>   website_preview_url?: string | null,
>   preview_url?: string | null,
>   video_url?: string | null,
>   payment_url?: string | null,
>   price?: number | null,
>   url?: string | null
> }
> ```

***

### update

`templates.update`

Edit a template listing

**Risk:** `write`

```ts theme={null}
await corsair.twentyfirst.api.templates.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | — |
| `id` | `number` | Yes | — |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name?: string,
>   description?: string,
>   website_preview_url?: string,
>   payment_url?: string,
>   price?: number,
>   preview_url?: string,
>   video_url?: string,
>   tagIds?: number[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `updated` | `boolean \| null` | No | — |
| `template` | `object` | No | — |

> [accordion] template full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   slug?: string | null,
>   name?: string | null,
>   description?: string | null,
>   status?: string | null,
>   website_preview_url?: string | null,
>   preview_url?: string | null,
>   video_url?: string | null,
>   payment_url?: string | null,
>   price?: number | null,
>   url?: string | null
> }
> ```

***

## Themes

### publish

`themes.publish`

Publish a community theme

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.themes.publish({});
```

**Input**

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

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name: string,
>   css: string,
>   tags?: string[]
> }
> ```

**Output**

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

***

### unpublish

`themes.unpublish`

Unpublish an owned theme

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.themes.unpublish({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `unpublished` | `boolean \| null` | No | — |
| `already` | `boolean \| null` | No | — |

***

### update

`themes.update`

Rename, retag, or change visibility of an owned theme

**Risk:** `destructive`

```ts theme={null}
await corsair.twentyfirst.api.themes.update({});
```

**Input**

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

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name?: string,
>   tags?: string[],
>   visibility?: public | private
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `updated` | `boolean \| null` | No | — |

***


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