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

# LaunchDarkly API reference

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

## Access Tokens

### create

`accessTokens.create`

Create a new personal or service access token

**Risk:** `destructive`

```ts theme={null}
await corsair.launchdarkly.api.accessTokens.create({ name: 'CI Deployment Token' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | No | — |
| `description` | `string` | No | — |
| `role` | `reader \| writer \| admin` | No | — |
| `customRoleIds` | `string[]` | No | — |
| `serviceToken` | `boolean` | No | — |
| `defaultApiVersion` | `number` | No | — |
| `expiry` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `name` | `string` | No | — |
| `description` | `string` | No | — |
| `role` | `string` | No | — |
| `customRoleIds` | `string[]` | No | — |
| `token` | `string` | No | — |
| `serviceToken` | `boolean` | No | — |
| `defaultApiVersion` | `number` | No | — |
| `creationDate` | `number` | No | — |
| `lastModified` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### delete

`accessTokens.delete`

Revoke and delete an access token

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

```ts theme={null}
await corsair.launchdarkly.api.accessTokens.delete({ id: '5a5c0b000000000000000001' });
```

**Input**

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

**Output:** `void`

***

### get

`accessTokens.get`

Get details of an access token by ID

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.accessTokens.get({ id: '5a5c0b000000000000000001' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `name` | `string` | No | — |
| `description` | `string` | No | — |
| `role` | `string` | No | — |
| `customRoleIds` | `string[]` | No | — |
| `token` | `string` | No | — |
| `serviceToken` | `boolean` | No | — |
| `defaultApiVersion` | `number` | No | — |
| `creationDate` | `number` | No | — |
| `lastModified` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### list

`accessTokens.list`

List access tokens in the account

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.accessTokens.list({ limit: 10 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `showAll` | `boolean` | No | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   _id: string,
>   name?: string,
>   description?: string,
>   role?: string,
>   customRoleIds?: string[],
>   token?: string,
>   serviceToken?: boolean,
>   defaultApiVersion?: number,
>   creationDate?: number,
>   lastModified?: number,
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

## Account Members

### delete

`accountMembers.delete`

Remove an account member from the account

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

```ts theme={null}
await corsair.launchdarkly.api.accountMembers.delete({ id: '5a5c0b000000000000000001' });
```

**Input**

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

**Output:** `void`

***

### get

`accountMembers.get`

Get details of an account member by ID

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.accountMembers.get({ id: '5a5c0b000000000000000001' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `email` | `string` | Yes | — |
| `firstName` | `string` | No | — |
| `lastName` | `string` | No | — |
| `role` | `string` | Yes | — |
| `customRoles` | `string[]` | No | — |
| `_pendingInvite` | `boolean` | No | — |
| `_verified` | `boolean` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### invite

`accountMembers.invite`

Invite new members to the account

**Risk:** `destructive`

```ts theme={null}
await corsair.launchdarkly.api.accountMembers.invite({
	members: [{ email: 'dev@example.com', role: 'writer' }],
});
```

**Input**

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

> [accordion] members full type
>
> ```ts theme={null}
> {
>   email: string,
>   role?: reader | writer | admin | owner/admin | no_access,
>   customRoles?: string[],
>   roleAttributes?: Record<string, string[]>,
>   teamKeys?: string[],
>   password?: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   _id: string,
>   email: string,
>   firstName?: string,
>   lastName?: string,
>   role: string,
>   customRoles?: string[],
>   _pendingInvite?: boolean,
>   _verified?: boolean,
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### list

`accountMembers.list`

List all account members

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.accountMembers.list({ limit: 10 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `sort` | `string` | No | — |
| `filter` | `string` | No | — |
| `expand` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   _id: string,
>   email: string,
>   firstName?: string,
>   lastName?: string,
>   role: string,
>   customRoles?: string[],
>   _pendingInvite?: boolean,
>   _verified?: boolean,
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### update

`accountMembers.update`

Update an account member role or permissions via JSON Patch

**Risk:** `write`

```ts theme={null}
await corsair.launchdarkly.api.accountMembers.update({
	id: '5a5c0b000000000000000001',
	patch: [{ op: 'replace', path: '/role', value: 'writer' }],
});
```

**Input**

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

> [accordion] patch full type
>
> ```ts theme={null}
> (
>   {
>     op: add | replace | test,
>     path: string,
>     value: any
>   } | {
>     op: remove,
>     path: string
>   } | {
>     op: move | copy,
>     from: string,
>     path: string
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `email` | `string` | Yes | — |
| `firstName` | `string` | No | — |
| `lastName` | `string` | No | — |
| `role` | `string` | Yes | — |
| `customRoles` | `string[]` | No | — |
| `_pendingInvite` | `boolean` | No | — |
| `_verified` | `boolean` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

## Audit Log

### get

`auditLog.get`

Get a specific audit log entry by ID

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.auditLog.get({ id: '5a5c0b000000000000000001' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `date` | `number` | Yes | — |
| `kind` | `string` | Yes | — |
| `name` | `string` | No | — |
| `description` | `string` | No | — |
| `shortDescription` | `string` | No | — |
| `comment` | `string` | No | — |
| `member` | `object` | No | — |
| `_links` | `object` | No | — |

> [accordion] member full type
>
> ```ts theme={null}
> {
>   _id?: string,
>   email?: string,
>   firstName?: string,
>   lastName?: string
> }
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### list

`auditLog.list`

List recent audit log entries in the account

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.auditLog.list({ limit: 10 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `before` | `number` | No | — |
| `after` | `number` | No | — |
| `limit` | `number` | No | — |
| `q` | `string` | No | — |
| `spec` | `string` | No | — |
| `member` | `string` | No | — |
| `token` | `string` | No | — |

**Output**

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

> [accordion] items full type
>
> ```ts theme={null}
> {
>   _id: string,
>   date: number,
>   kind: string,
>   name?: string,
>   description?: string,
>   shortDescription?: string,
>   comment?: string,
>   member?: {
>     _id?: string,
>     email?: string,
>     firstName?: string,
>     lastName?: string
>   },
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

## Contexts

### get

`contexts.get`

Get evaluation context by kind and key

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.contexts.get({
	projectKey: 'default',
	environmentKey: 'production',
	kind: 'user',
	key: 'user-123',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |
| `kind` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `continuationToken` | `string` | No | — |
| `sort` | `string` | No | — |
| `filter` | `string` | No | — |
| `includeTotalCount` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_environmentId` | `string` | No | — |
| `items` | `object[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `continuationToken` | `string` | No | — |
| `_links` | `object` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   context: any,
>   lastSeen?: string,
>   applicationId?: string,
>   associatedContexts?: any,
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### listKinds

`contexts.listKinds`

List context kinds defined in a project

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.contexts.listKinds({ projectKey: 'default' });
```

**Input**

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

**Output**

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

> [accordion] items full type
>
> ```ts theme={null}
> {
>   key: string,
>   name?: string,
>   description?: string,
>   archived?: boolean,
>   _version?: number
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### search

`contexts.search`

Search for evaluation contexts in an environment

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.contexts.search({ projectKey: 'default', environmentKey: 'production', limit: 10 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |
| `filter` | `string` | No | — |
| `sort` | `string` | No | — |
| `limit` | `number` | No | — |
| `continuationToken` | `string` | No | — |
| `includeTotalCount` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_environmentId` | `string` | No | — |
| `items` | `object[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `continuationToken` | `string` | No | — |
| `_links` | `object` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   context: any,
>   lastSeen?: string,
>   applicationId?: string,
>   associatedContexts?: any,
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

## Custom Roles

### create

`customRoles.create`

Create a new custom role

**Risk:** `write`

```ts theme={null}
await corsair.launchdarkly.api.customRoles.create({
	key: 'flag-admin',
	name: 'Flag Administrator',
	policy: [{
		effect: 'allow',
		actions: ['*'],
		resources: ['proj/*:env/*:flag/*'],
	}],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string` | No | — |
| `policy` | `object[]` | Yes | — |
| `basePermissions` | `reader \| no_access` | No | — |
| `resourceCategory` | `organization \| project \| any` | No | — |

> [accordion] policy full type
>
> ```ts theme={null}
> {
>   effect: allow | deny,
>   resources?: string[],
>   notResources?: string[],
>   actions?: string[],
>   notActions?: string[]
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string` | No | — |
| `policy` | `object[]` | No | — |
| `basePermissions` | `string` | No | — |
| `_links` | `object` | No | — |

> [accordion] policy full type
>
> ```ts theme={null}
> {
>   effect: allow | deny,
>   resources?: string[],
>   notResources?: string[],
>   actions?: string[],
>   notActions?: string[]
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### delete

`customRoles.delete`

Permanently delete a custom role

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

```ts theme={null}
await corsair.launchdarkly.api.customRoles.delete({ customRoleKey: 'deprecated-role' });
```

**Input**

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

**Output:** `void`

***

### get

`customRoles.get`

Get a custom role by key

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.customRoles.get({ customRoleKey: 'flag-admin' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string` | No | — |
| `policy` | `object[]` | No | — |
| `basePermissions` | `string` | No | — |
| `_links` | `object` | No | — |

> [accordion] policy full type
>
> ```ts theme={null}
> {
>   effect: allow | deny,
>   resources?: string[],
>   notResources?: string[],
>   actions?: string[],
>   notActions?: string[]
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### list

`customRoles.list`

List custom roles in the account

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.customRoles.list({ limit: 10 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   _id: string,
>   key: string,
>   name: string,
>   description?: string,
>   policy?: {
>     effect: allow | deny,
>     resources?: string[],
>     notResources?: string[],
>     actions?: string[],
>     notActions?: string[]
>   }[],
>   basePermissions?: string,
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### update

`customRoles.update`

Update a custom role policy via JSON Patch

**Risk:** `write`

```ts theme={null}
await corsair.launchdarkly.api.customRoles.update({
	customRoleKey: 'flag-admin',
	patch: [{ op: 'replace', path: '/name', value: 'Lead Flag Administrator' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `customRoleKey` | `string` | Yes | — |
| `patch` | `object[]` | Yes | — |
| `comment` | `string` | No | — |

> [accordion] patch full type
>
> ```ts theme={null}
> (
>   {
>     op: add | replace | test,
>     path: string,
>     value: any
>   } | {
>     op: remove,
>     path: string
>   } | {
>     op: move | copy,
>     from: string,
>     path: string
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string` | No | — |
| `policy` | `object[]` | No | — |
| `basePermissions` | `string` | No | — |
| `_links` | `object` | No | — |

> [accordion] policy full type
>
> ```ts theme={null}
> {
>   effect: allow | deny,
>   resources?: string[],
>   notResources?: string[],
>   actions?: string[],
>   notActions?: string[]
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

## Environments

### create

`environments.create`

Create a new environment in a project

**Risk:** `write`

```ts theme={null}
await corsair.launchdarkly.api.environments.create({
	projectKey: 'default',
	key: 'staging',
	name: 'Staging',
	color: 'FF9900',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `color` | `string` | Yes | — |
| `defaultTtl` | `number` | No | — |
| `secureMode` | `boolean` | No | — |
| `defaultTrackEvents` | `boolean` | No | — |
| `confirmChanges` | `boolean` | No | — |
| `requireComments` | `boolean` | No | — |
| `tags` | `string[]` | No | — |
| `critical` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `apiKey` | `string` | No | — |
| `mobileKey` | `string` | No | — |
| `color` | `string` | Yes | — |
| `defaultTtl` | `number` | No | — |
| `secureMode` | `boolean` | No | — |
| `defaultTrackEvents` | `boolean` | No | — |
| `requireComments` | `boolean` | No | — |
| `confirmChanges` | `boolean` | No | — |
| `tags` | `string[]` | No | — |
| `critical` | `boolean` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### delete

`environments.delete`

Permanently delete an environment

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

```ts theme={null}
await corsair.launchdarkly.api.environments.delete({ projectKey: 'default', environmentKey: 'qa' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |

**Output:** `void`

***

### get

`environments.get`

Get details of a specific environment

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.environments.get({ projectKey: 'default', environmentKey: 'production' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `apiKey` | `string` | No | — |
| `mobileKey` | `string` | No | — |
| `color` | `string` | Yes | — |
| `defaultTtl` | `number` | No | — |
| `secureMode` | `boolean` | No | — |
| `defaultTrackEvents` | `boolean` | No | — |
| `requireComments` | `boolean` | No | — |
| `confirmChanges` | `boolean` | No | — |
| `tags` | `string[]` | No | — |
| `critical` | `boolean` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### list

`environments.list`

List all environments in a project

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.environments.list({ projectKey: 'default' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `filter` | `string` | No | — |
| `sort` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   _id: string,
>   key: string,
>   name: string,
>   apiKey?: string,
>   mobileKey?: string,
>   color: string,
>   defaultTtl?: number,
>   secureMode?: boolean,
>   defaultTrackEvents?: boolean,
>   requireComments?: boolean,
>   confirmChanges?: boolean,
>   tags?: string[],
>   critical?: boolean,
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### resetMobileKey

`environments.resetMobileKey`

Reset the mobile key for an environment

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

```ts theme={null}
await corsair.launchdarkly.api.environments.resetMobileKey({ projectKey: 'default', environmentKey: 'production' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `apiKey` | `string` | No | — |
| `mobileKey` | `string` | No | — |
| `color` | `string` | Yes | — |
| `defaultTtl` | `number` | No | — |
| `secureMode` | `boolean` | No | — |
| `defaultTrackEvents` | `boolean` | No | — |
| `requireComments` | `boolean` | No | — |
| `confirmChanges` | `boolean` | No | — |
| `tags` | `string[]` | No | — |
| `critical` | `boolean` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### resetSdkKey

`environments.resetSdkKey`

Reset the SDK key for an environment

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

```ts theme={null}
await corsair.launchdarkly.api.environments.resetSdkKey({ projectKey: 'default', environmentKey: 'production' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |
| `expiry` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `apiKey` | `string` | No | — |
| `mobileKey` | `string` | No | — |
| `color` | `string` | Yes | — |
| `defaultTtl` | `number` | No | — |
| `secureMode` | `boolean` | No | — |
| `defaultTrackEvents` | `boolean` | No | — |
| `requireComments` | `boolean` | No | — |
| `confirmChanges` | `boolean` | No | — |
| `tags` | `string[]` | No | — |
| `critical` | `boolean` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### update

`environments.update`

Update environment configuration via JSON Patch

**Risk:** `destructive`

```ts theme={null}
await corsair.launchdarkly.api.environments.update({
	projectKey: 'default',
	environmentKey: 'staging',
	patch: [{ op: 'replace', path: '/name', value: 'Staging V2' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |
| `patch` | `object[]` | Yes | — |

> [accordion] patch full type
>
> ```ts theme={null}
> (
>   {
>     op: add | replace | test,
>     path: string,
>     value: any
>   } | {
>     op: remove,
>     path: string
>   } | {
>     op: move | copy,
>     from: string,
>     path: string
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `apiKey` | `string` | No | — |
| `mobileKey` | `string` | No | — |
| `color` | `string` | Yes | — |
| `defaultTtl` | `number` | No | — |
| `secureMode` | `boolean` | No | — |
| `defaultTrackEvents` | `boolean` | No | — |
| `requireComments` | `boolean` | No | — |
| `confirmChanges` | `boolean` | No | — |
| `tags` | `string[]` | No | — |
| `critical` | `boolean` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

## Feature Flags

### create

`featureFlags.create`

Create a new feature flag in a project

**Risk:** `write`

```ts theme={null}
await corsair.launchdarkly.api.featureFlags.create({ projectKey: 'default', key: 'new-feature', name: 'New Feature' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `clone` | `string` | No | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string` | No | — |
| `variations` | `object[]` | No | — |
| `temporary` | `boolean` | No | — |
| `tags` | `string[]` | No | — |
| `includeInSnippet` | `boolean` | No | — |
| `clientSideAvailability` | `object` | No | — |
| `defaults` | `object` | No | — |
| `customProperties` | `object` | No | — |
| `purpose` | `migration \| holdout` | No | — |
| `migrationSettings` | `object` | No | — |
| `maintainerId` | `string` | No | — |
| `maintainerTeamKey` | `string` | No | — |
| `initialPrerequisites` | `object[]` | No | — |
| `isFlagOn` | `boolean` | No | — |

> [accordion] variations full type
>
> ```ts theme={null}
> {
>   value: any,
>   name?: string,
>   description?: string
> }[]
> ```

> [accordion] clientSideAvailability full type
>
> ```ts theme={null}
> {
>   usingMobileKey?: boolean,
>   usingEnvironmentId?: boolean
> }
> ```

> [accordion] defaults full type
>
> ```ts theme={null}
> {
>   onVariation?: number,
>   offVariation?: number
> }
> ```

> [accordion] customProperties full type
>
> ```ts theme={null}
> Record<string, {
>   name: string,
>   value: string[]
> }>
> ```

> [accordion] migrationSettings full type
>
> ```ts theme={null}
> {
>   contextKind?: string,
>   stageCount: 2 | 4 | 6
> }
> ```

> [accordion] initialPrerequisites full type
>
> ```ts theme={null}
> {
>   key: string,
>   variationId: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `kind` | `string` | No | — |
| `description` | `string` | No | — |
| `creationDate` | `number` | No | — |
| `archived` | `boolean` | No | — |
| `temporary` | `boolean` | No | — |
| `tags` | `string[]` | No | — |
| `variations` | `object[]` | No | — |
| `_version` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] variations full type
>
> ```ts theme={null}
> {
>   _id?: string,
>   value: any,
>   name?: string,
>   description?: string
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### delete

`featureFlags.delete`

Permanently delete a feature flag

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

```ts theme={null}
await corsair.launchdarkly.api.featureFlags.delete({ projectKey: 'default', featureFlagKey: 'temp-feature' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `featureFlagKey` | `string` | Yes | — |

**Output:** `void`

***

### get

`featureFlags.get`

Get details of a feature flag

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.featureFlags.get({ projectKey: 'default', featureFlagKey: 'enable-feature' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `featureFlagKey` | `string` | Yes | — |
| `env` | `string` | No | — |
| `expand` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `kind` | `string` | No | — |
| `description` | `string` | No | — |
| `creationDate` | `number` | No | — |
| `archived` | `boolean` | No | — |
| `temporary` | `boolean` | No | — |
| `tags` | `string[]` | No | — |
| `variations` | `object[]` | No | — |
| `_version` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] variations full type
>
> ```ts theme={null}
> {
>   _id?: string,
>   value: any,
>   name?: string,
>   description?: string
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### getStatus

`featureFlags.getStatus`

Get the status of a feature flag in an environment

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.featureFlags.getStatus({ projectKey: 'default', environmentKey: 'production', featureFlagKey: 'enable-feature' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |
| `featureFlagKey` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | No | — |
| `lastRequested` | `string \| null` | No | — |
| `default` | `any` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### list

`featureFlags.list`

List feature flags in a project

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.featureFlags.list({ projectKey: 'default' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `env` | `string` | No | — |
| `tag` | `string` | No | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `archived` | `boolean` | No | — |
| `summary` | `boolean` | No | — |
| `filter` | `string` | No | — |
| `sort` | `string` | No | — |
| `filterEnv` | `string` | No | — |
| `expand` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   key: string,
>   name: string,
>   kind?: string,
>   description?: string,
>   creationDate?: number,
>   archived?: boolean,
>   temporary?: boolean,
>   tags?: string[],
>   variations?: {
>     _id?: string,
>     value: any,
>     name?: string,
>     description?: string
>   }[],
>   _version?: number,
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### listStatuses

`featureFlags.listStatuses`

List statuses for all feature flags in an environment

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.featureFlags.listStatuses({ projectKey: 'default', environmentKey: 'production' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |

**Output**

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

> [accordion] items full type
>
> ```ts theme={null}
> {
>   name?: string,
>   lastRequested?: string | null,
>   default?: any,
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### update

`featureFlags.update`

Update feature flag rules and variations via JSON Patch (turning a flag on or off, or changing targeting, changes what live apps serve)

**Risk:** `destructive`

```ts theme={null}
await corsair.launchdarkly.api.featureFlags.update({
	projectKey: 'default',
	featureFlagKey: 'new-feature',
	patch: [{ op: 'replace', path: '/description', value: 'Updated description' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `featureFlagKey` | `string` | Yes | — |
| `patch` | `object[]` | Yes | — |
| `comment` | `string` | No | — |
| `ignoreConflicts` | `boolean` | No | — |
| `dryRun` | `boolean` | No | — |

> [accordion] patch full type
>
> ```ts theme={null}
> (
>   {
>     op: add | replace | test,
>     path: string,
>     value: any
>   } | {
>     op: remove,
>     path: string
>   } | {
>     op: move | copy,
>     from: string,
>     path: string
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `kind` | `string` | No | — |
| `description` | `string` | No | — |
| `creationDate` | `number` | No | — |
| `archived` | `boolean` | No | — |
| `temporary` | `boolean` | No | — |
| `tags` | `string[]` | No | — |
| `variations` | `object[]` | No | — |
| `_version` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] variations full type
>
> ```ts theme={null}
> {
>   _id?: string,
>   value: any,
>   name?: string,
>   description?: string
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

## Projects

### create

`projects.create`

Create a new project

**Risk:** `write`

```ts theme={null}
await corsair.launchdarkly.api.projects.create({
	key: 'mobile-app',
	name: 'Mobile App',
	tags: ['mobile'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `includeInSnippetByDefault` | `boolean` | No | — |
| `defaultClientSideAvailability` | `object` | No | — |
| `tags` | `string[]` | No | — |
| `environments` | `object[]` | No | — |
| `namingConvention` | `object` | No | — |

> [accordion] defaultClientSideAvailability full type
>
> ```ts theme={null}
> {
>   usingMobileKey: boolean,
>   usingEnvironmentId: boolean
> }
> ```

> [accordion] environments full type
>
> ```ts theme={null}
> {
>   key: string,
>   name: string,
>   color: string,
>   defaultTtl?: number,
>   secureMode?: boolean,
>   defaultTrackEvents?: boolean,
>   confirmChanges?: boolean,
>   requireComments?: boolean,
>   tags?: string[],
>   critical?: boolean,
>   source?: {
>     key?: string,
>     version?: number
>   }
> }[]
> ```

> [accordion] namingConvention full type
>
> ```ts theme={null}
> {
>   case?: camelCase | upperCamelCase | snakeCase | kebabCase | constantCase,
>   prefix?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `includeInSnippetByDefault` | `boolean` | No | — |
| `tags` | `string[]` | No | — |
| `environments` | `object[]` | No | — |
| `_links` | `object` | No | — |

> [accordion] environments full type
>
> ```ts theme={null}
> {
>   _id?: string,
>   key: string,
>   name: string,
>   color?: string,
>   apiKey?: string,
>   mobileKey?: string,
>   critical?: boolean,
>   tags?: string[]
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### delete

`projects.delete`

Permanently delete a project

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

```ts theme={null}
await corsair.launchdarkly.api.projects.delete({ projectKey: 'old-project' });
```

**Input**

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

**Output:** `void`

***

### get

`projects.get`

Get details of a specific project by project key

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.projects.get({ projectKey: 'default' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `expand` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `includeInSnippetByDefault` | `boolean` | No | — |
| `tags` | `string[]` | No | — |
| `environments` | `object[]` | No | — |
| `_links` | `object` | No | — |

> [accordion] environments full type
>
> ```ts theme={null}
> {
>   _id?: string,
>   key: string,
>   name: string,
>   color?: string,
>   apiKey?: string,
>   mobileKey?: string,
>   critical?: boolean,
>   tags?: string[]
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### list

`projects.list`

List all projects in the account

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.projects.list({ limit: 10 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `filter` | `string` | No | — |
| `sort` | `string` | No | — |
| `expand` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   _id: string,
>   key: string,
>   name: string,
>   includeInSnippetByDefault?: boolean,
>   tags?: string[],
>   environments?: {
>     _id?: string,
>     key: string,
>     name: string,
>     color?: string,
>     apiKey?: string,
>     mobileKey?: string,
>     critical?: boolean,
>     tags?: string[]
>   }[],
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### update

`projects.update`

Update project configuration via JSON Patch

**Risk:** `write`

```ts theme={null}
await corsair.launchdarkly.api.projects.update({
	projectKey: 'default',
	patch: [{ op: 'replace', path: '/name', value: 'Default Project' }],
});
```

**Input**

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

> [accordion] patch full type
>
> ```ts theme={null}
> (
>   {
>     op: add | replace | test,
>     path: string,
>     value: any
>   } | {
>     op: remove,
>     path: string
>   } | {
>     op: move | copy,
>     from: string,
>     path: string
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `_id` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `includeInSnippetByDefault` | `boolean` | No | — |
| `tags` | `string[]` | No | — |
| `environments` | `object[]` | No | — |
| `_links` | `object` | No | — |

> [accordion] environments full type
>
> ```ts theme={null}
> {
>   _id?: string,
>   key: string,
>   name: string,
>   color?: string,
>   apiKey?: string,
>   mobileKey?: string,
>   critical?: boolean,
>   tags?: string[]
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

## Root

### get

`root.get`

Get LaunchDarkly root API metadata and resource links

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.root.get({});
```

**Input:** *empty object*

**Output**

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

> [accordion] links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

## Segments

### create

`segments.create`

Create a new user segment

**Risk:** `write`

```ts theme={null}
await corsair.launchdarkly.api.segments.create({
	projectKey: 'default',
	environmentKey: 'production',
	key: 'beta-testers',
	name: 'Beta Testers',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string` | No | — |
| `tags` | `string[]` | No | — |
| `unbounded` | `boolean` | No | — |
| `unboundedContextKind` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string \| null` | No | — |
| `tags` | `string[]` | No | — |
| `creationDate` | `number` | No | — |
| `version` | `number` | No | — |
| `included` | `string[]` | No | — |
| `excluded` | `string[]` | No | — |
| `rules` | `any[]` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### delete

`segments.delete`

Permanently delete a user segment

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

```ts theme={null}
await corsair.launchdarkly.api.segments.delete({ projectKey: 'default', environmentKey: 'production', segmentKey: 'old-testers' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |
| `segmentKey` | `string` | Yes | — |

**Output:** `void`

***

### get

`segments.get`

Get details of a user segment

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.segments.get({ projectKey: 'default', environmentKey: 'production', segmentKey: 'beta-testers' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |
| `segmentKey` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string \| null` | No | — |
| `tags` | `string[]` | No | — |
| `creationDate` | `number` | No | — |
| `version` | `number` | No | — |
| `included` | `string[]` | No | — |
| `excluded` | `string[]` | No | — |
| `rules` | `any[]` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### list

`segments.list`

List user segments in an environment

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.segments.list({ projectKey: 'default', environmentKey: 'production' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `sort` | `string` | No | — |
| `filter` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   key: string,
>   name: string,
>   description?: string | null,
>   tags?: string[],
>   creationDate?: number,
>   version?: number,
>   included?: string[],
>   excluded?: string[],
>   rules?: any[],
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### update

`segments.update`

Update user segment rules via JSON Patch (changes who flags that use the segment target)

**Risk:** `destructive`

```ts theme={null}
await corsair.launchdarkly.api.segments.update({
	projectKey: 'default',
	environmentKey: 'production',
	segmentKey: 'beta-testers',
	patch: [{ op: 'replace', path: '/description', value: 'Early adopters' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |
| `segmentKey` | `string` | Yes | — |
| `patch` | `object[]` | Yes | — |
| `comment` | `string` | No | — |

> [accordion] patch full type
>
> ```ts theme={null}
> (
>   {
>     op: add | replace | test,
>     path: string,
>     value: any
>   } | {
>     op: remove,
>     path: string
>   } | {
>     op: move | copy,
>     from: string,
>     path: string
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string \| null` | No | — |
| `tags` | `string[]` | No | — |
| `creationDate` | `number` | No | — |
| `version` | `number` | No | — |
| `included` | `string[]` | No | — |
| `excluded` | `string[]` | No | — |
| `rules` | `any[]` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

## Tags

### list

`tags.list`

List tags across resources in the account

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.tags.list({ limit: 20 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `kind` | `string[]` | No | — |
| `pre` | `string` | No | — |
| `archived` | `boolean` | No | — |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `asOf` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `string[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

## Teams

### create

`teams.create`

Create a new team

**Risk:** `write`

```ts theme={null}
await corsair.launchdarkly.api.teams.create({ key: 'frontend-team', name: 'Frontend Team' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string` | No | — |
| `memberIDs` | `string[]` | No | — |
| `customRoleKeys` | `string[]` | No | — |
| `expand` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string` | No | — |
| `memberIDs` | `string[]` | No | — |
| `customRoleKeys` | `string[]` | No | — |
| `_creationDate` | `number` | No | — |
| `_version` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### delete

`teams.delete`

Permanently delete a team

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

```ts theme={null}
await corsair.launchdarkly.api.teams.delete({ teamKey: 'legacy-team' });
```

**Input**

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

**Output:** `void`

***

### get

`teams.get`

Get details of a team by key

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.teams.get({ teamKey: 'frontend-team' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `teamKey` | `string` | Yes | — |
| `expand` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string` | No | — |
| `memberIDs` | `string[]` | No | — |
| `customRoleKeys` | `string[]` | No | — |
| `_creationDate` | `number` | No | — |
| `_version` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### list

`teams.list`

List teams in the account

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.teams.list({ limit: 10 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | — |
| `offset` | `number` | No | — |
| `filter` | `string` | No | — |
| `sort` | `string` | No | — |
| `expand` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   key: string,
>   name: string,
>   description?: string,
>   memberIDs?: string[],
>   customRoleKeys?: string[],
>   _creationDate?: number,
>   _version?: number,
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### update

`teams.update`

Update a team via semantic instructions

**Risk:** `write`

```ts theme={null}
await corsair.launchdarkly.api.teams.update({
	teamKey: 'frontend-team',
	instructions: [{ kind: 'updateName', value: 'Frontend Core Team' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `teamKey` | `string` | Yes | — |
| `instructions` | `object[]` | Yes | — |
| `comment` | `string` | No | — |
| `expand` | `string` | No | — |

> [accordion] instructions full type
>
> ```ts theme={null}
> (
>   {
>     kind: addCustomRoles | removeCustomRoles | addMembers | removeMembers | replaceMembers,
>     values: string[]
>   } | {
>     kind: updateDescription,
>     value: string
>   } | {
>     kind: updateName,
>     value: string
>   } | {
>     kind: addRoleAttribute,
>     key: string,
>     values: string[]
>   } | {
>     kind: removeRoleAttribute,
>     key: string
>   } | {
>     kind: updateRoleAttribute,
>     key: string,
>     values: string[]
>   } | {
>     kind: replaceRoleAttributes,
>     value: Record<string, string[]>
>   } | {
>     kind: addPermissionGrants | removePermissionGrants,
>     memberIDs: string[],
>     actionSet?: string,
>     actions?: string[]
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `key` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string` | No | — |
| `memberIDs` | `string[]` | No | — |
| `customRoleKeys` | `string[]` | No | — |
| `_creationDate` | `number` | No | — |
| `_version` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

## Users

### get

`users.get`

Get user record in an environment by user key (deprecated by LaunchDarkly; accounts on contexts answer 404, use contexts.get)

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.users.get({ projectKey: 'default', environmentKey: 'production', userKey: 'user-123' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |
| `userKey` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `user` | `object` | No | — |
| `environmentId` | `string` | No | — |
| `lastPing` | `string` | No | — |
| `_links` | `object` | No | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
>   key: string,
>   ip?: string,
>   country?: string,
>   email?: string,
>   firstName?: string,
>   lastName?: string,
>   avatar?: string,
>   name?: string,
>   anonymous?: boolean,
>   custom?: Record<string, any>
> }
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### list

`users.list`

List users in an environment (deprecated by LaunchDarkly; accounts on contexts answer 404, use contexts.search)

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.users.list({ projectKey: 'default', environmentKey: 'production' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `searchAfter` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   user?: {
>     key: string,
>     ip?: string,
>     country?: string,
>     email?: string,
>     firstName?: string,
>     lastName?: string,
>     avatar?: string,
>     name?: string,
>     anonymous?: boolean,
>     custom?: Record<string, any>
>   },
>   environmentId?: string,
>   lastPing?: string,
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***

### search

`users.search`

Search users in an environment by query string (deprecated by LaunchDarkly; accounts on contexts answer 404, use contexts.search)

**Risk:** `read`

```ts theme={null}
await corsair.launchdarkly.api.users.search({ projectKey: 'default', environmentKey: 'production', q: 'test@example.com' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectKey` | `string` | Yes | — |
| `environmentKey` | `string` | Yes | — |
| `q` | `string` | No | — |
| `limit` | `number` | No | — |
| `searchAfter` | `string` | No | — |
| `filter` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `totalCount` | `number` | No | — |
| `_links` | `object` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   user?: {
>     key: string,
>     ip?: string,
>     country?: string,
>     email?: string,
>     firstName?: string,
>     lastName?: string,
>     avatar?: string,
>     name?: string,
>     anonymous?: boolean,
>     custom?: Record<string, any>
>   },
>   environmentId?: string,
>   lastPing?: string,
>   _links?: Record<string, {
>     href?: string,
>     type?: string
>   }>
> }[]
> ```

> [accordion] \_links full type
>
> ```ts theme={null}
> Record<string, {
>   href?: string,
>   type?: string
> }>
> ```

***


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