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

# n8n API reference

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

## Agents

### archive

`agents.archive`

Archive an agent. Soft-deletes an agent by archiving it. Idempotent: archiving an already archived agent returns 200 with the current agent. Requires the agent:delete API key scope. Added in n8n 2.50; older instances answer 404.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.agents.archive({ agentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | The ID of the agent. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `project` | `object \| null` | No | — |
| `availableInMCP` | `boolean \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null \| null` | No | — |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `config` | `object \| null` | No | — |
| `configHash` | `string \| null \| null` | No | — |
| `tools` | `object \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |
| `parentFolder` | `object \| null` | No | — |

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

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

> [accordion] tools full type
>
> ```ts theme={null}
> Record<string, {
>   code?: string | null,
>   descriptor?: {
>     name?: string | null
>   } | null
> }> | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   integrations?: {
>     type?: string | null,
>     credentialId?: string | null,
>     settings?: {
>     } | null,
>     approval?: {
>     } | null
>   }[] | null
> } | null | null
> ```

> [accordion] parentFolder full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   parentFolderId?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null | null
> ```

***

### create

`agents.create`

Create an agent. Create an agent in your personal project or a team project you have access to. Requires the agent:create API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.agents.create({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `name` | `string` | Yes | — |
| `projectId` | `string` | No | — |
| `config` | `object` | No | Agent configuration. Set name, model, and instructions. An empty model creates an unconfigured draft. |
| `tools` | `object` | No | — |
| `availableInMCP` | `boolean` | No | — |

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

> [accordion] tools full type
>
> ```ts theme={null}
> Record<string, {
>   code: string,
>   descriptor: {
>     name: string
>   }
> }>
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `project` | `object \| null` | No | — |
| `availableInMCP` | `boolean \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null \| null` | No | — |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `config` | `object \| null` | No | — |
| `configHash` | `string \| null \| null` | No | — |
| `tools` | `object \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |
| `parentFolder` | `object \| null` | No | — |

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

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

> [accordion] tools full type
>
> ```ts theme={null}
> Record<string, {
>   code?: string | null,
>   descriptor?: {
>     name?: string | null
>   } | null
> }> | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   integrations?: {
>     type?: string | null,
>     credentialId?: string | null,
>     settings?: {
>     } | null,
>     approval?: {
>     } | null
>   }[] | null
> } | null | null
> ```

> [accordion] parentFolder full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   parentFolderId?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null | null
> ```

***

### delete

`agents.delete`

Delete an agent. Delete an agent and its associated resources. The agent is deleted right away: it does not need to be archived first, and a published agent with live channels is deleted too. This matches the workflow delete endpoint. Requires the agent:delete API key scope. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.agents.delete({ agentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | The ID of the agent. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `availableInMCP` | `boolean \| null` | No | — |
| `versionId` | `string \| null \| null` | No | — |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### executions.list

`agents.executions.list`

List agent executions. List the runs of one agent that you can see, newest first. Project sessions are visible to every project member, private sessions only to their owner. The response is one cursor page: read the next page with the cursor query parameter. Added in n8n 2.50; older instances answer 404.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.agents.executions.list({ agentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `limit` | `number` | No | The maximum number of items to return. |
| `agentId` | `string` | Yes | The ID of the agent. |
| `sessionId` | `string` | No | — |
| `status` | `running \| success \| error \| cancelled \| interrupted \| awaiting` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   executionId?: string | null,
>   sessionId?: string | null,
>   status?: string | null,
>   source?: string | null | null,
>   createdAt?: string | null,
>   startedAt?: string | null | null,
>   stoppedAt?: string | null | null,
>   usage?: {
>     promptTokens?: number | null | null,
>     completionTokens?: number | null | null,
>     totalTokens?: number | null | null,
>     cost?: number | null | null
>   } | null
> }[] | null
> ```

***

### executions.stop

`agents.executions.stop`

Stop an agent run. Stop a run of this agent. A finished run returns its status. An unknown execution returns 404. Requires the agent:execute API key scope. Added in n8n 2.50; older instances answer 404.

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

```ts theme={null}
await corsair.n8n.api.agents.executions.stop({ agentId: 'agt_6TfR2kLm', executionId: 'aexec_9QwE3rTy' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `agentId` | `string` | Yes | The ID of the agent. |
| `executionId` | `string` | Yes | The ID of the agent execution. |

**Output**

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

***

### get

`agents.get`

Retrieve an agent. Retrieve one agent by ID. The response carries the agent configuration that the update endpoint writes back. Requires the agent:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.agents.get({ agentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | The ID of the agent. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `project` | `object \| null` | No | — |
| `availableInMCP` | `boolean \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null \| null` | No | — |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `config` | `object \| null` | No | — |
| `configHash` | `string \| null \| null` | No | — |
| `tools` | `object \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |
| `parentFolder` | `object \| null` | No | — |

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

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

> [accordion] tools full type
>
> ```ts theme={null}
> Record<string, {
>   code?: string | null,
>   descriptor?: {
>     name?: string | null
>   } | null
> }> | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   integrations?: {
>     type?: string | null,
>     credentialId?: string | null,
>     settings?: {
>     } | null,
>     approval?: {
>     } | null
>   }[] | null
> } | null | null
> ```

> [accordion] parentFolder full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   parentFolderId?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null | null
> ```

***

### list

`agents.list`

List agents. List the agents in the projects where you hold the agent:list permission. The response is one cursor page: read the next page with the cursor query parameter. Narrow the list to one project with projectId. Requires the agent:list API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.agents.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `limit` | `number` | No | The maximum number of items to return. |
| `projectId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   availableInMCP?: boolean | null,
>   isArchived?: boolean | null,
>   versionId?: string | null | null,
>   activeVersionId?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### publish

`agents.publish`

Publish an agent. Publish an agent. Omit versionId to publish the current draft. Send versionId to publish a saved version. Requires the agent:publish API key scope. Added in n8n 2.50; older instances answer 404.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.agents.publish({ agentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | The ID of the agent. |
| `versionId` | `string` | No | The saved version to publish. Omit this field to publish the current draft. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `project` | `object \| null` | No | — |
| `availableInMCP` | `boolean \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null \| null` | No | — |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `config` | `object \| null` | No | — |
| `configHash` | `string \| null \| null` | No | — |
| `tools` | `object \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |
| `parentFolder` | `object \| null` | No | — |

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

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

> [accordion] tools full type
>
> ```ts theme={null}
> Record<string, {
>   code?: string | null,
>   descriptor?: {
>     name?: string | null
>   } | null
> }> | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   integrations?: {
>     type?: string | null,
>     credentialId?: string | null,
>     settings?: {
>     } | null,
>     approval?: {
>     } | null
>   }[] | null
> } | null | null
> ```

> [accordion] parentFolder full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   parentFolderId?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null | null
> ```

***

### run

`agents.run`

Run an agent. Run the latest published version of an agent and wait for the final response. Omit sessionId to start a session. Send the same sessionId to continue that session. The Public API rejects an agent that has no published version, and an agent whose published version uses a tool that needs approval. Runs the agent: its model calls spend the connected model account's tokens. Added in n8n 2.50; older instances answer 404.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.agents.run({ agentId: 'example', message: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `agentId` | `string` | Yes | The ID of the agent. |
| `message` | `string` | Yes | The message to send to the agent. |
| `sessionId` | `string` | No | The session to continue. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `response` | `string \| null` | No | The final text of the run. |
| `sessionId` | `string \| null` | No | The session this run belongs to. |
| `executionId` | `string \| null` | No | The execution id of this run. |
| `status` | `string \| null` | No | — |
| `usage` | `object \| null` | No | — |
| `error` | `string \| null \| null` | No | — |

> [accordion] usage full type
>
> ```ts theme={null}
> {
>   promptTokens?: number | null | null,
>   completionTokens?: number | null | null,
>   totalTokens?: number | null | null,
>   cost?: number | null | null
> } | null
> ```

***

### unarchive

`agents.unarchive`

Unarchive an agent. Restores an archived agent. Requires the agent:delete API key scope. Added in n8n 2.50; older instances answer 404.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.agents.unarchive({ agentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | The ID of the agent. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `project` | `object \| null` | No | — |
| `availableInMCP` | `boolean \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null \| null` | No | — |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `config` | `object \| null` | No | — |
| `configHash` | `string \| null \| null` | No | — |
| `tools` | `object \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |
| `parentFolder` | `object \| null` | No | — |

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

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

> [accordion] tools full type
>
> ```ts theme={null}
> Record<string, {
>   code?: string | null,
>   descriptor?: {
>     name?: string | null
>   } | null
> }> | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   integrations?: {
>     type?: string | null,
>     credentialId?: string | null,
>     settings?: {
>     } | null,
>     approval?: {
>     } | null
>   }[] | null
> } | null | null
> ```

> [accordion] parentFolder full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   parentFolderId?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null | null
> ```

***

### unpublish

`agents.unpublish`

Unpublish an agent. Unpublish an agent. This stops the published version and disconnects its live channels. Requires the agent:unpublish API key scope. Added in n8n 2.50; older instances answer 404.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.agents.unpublish({ agentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | The ID of the agent. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `project` | `object \| null` | No | — |
| `availableInMCP` | `boolean \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null \| null` | No | — |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `config` | `object \| null` | No | — |
| `configHash` | `string \| null \| null` | No | — |
| `tools` | `object \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |
| `parentFolder` | `object \| null` | No | — |

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

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

> [accordion] tools full type
>
> ```ts theme={null}
> Record<string, {
>   code?: string | null,
>   descriptor?: {
>     name?: string | null
>   } | null
> }> | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   integrations?: {
>     type?: string | null,
>     credentialId?: string | null,
>     settings?: {
>     } | null,
>     approval?: {
>     } | null
>   }[] | null
> } | null | null
> ```

> [accordion] parentFolder full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   parentFolderId?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null | null
> ```

***

### update

`agents.update`

Update an agent. Replace the configuration of an agent. Send the configuration and the concurrency token you read from the retrieve endpoint: a stale token returns a conflict. Fields the server manages are ignored, not rejected. Added in n8n 2.50; older instances answer 404.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.agents.update({
	agentId: 'example',
	config: {},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | The ID of the agent. |
| `config` | `object \| null` | Yes | — |
| `baseConfigHash` | `string \| null` | No | — |
| `configHash` | `string \| null` | No | — |
| `id` | `any` | No | — |
| `name` | `any` | No | — |
| `projectId` | `any` | No | — |
| `project` | `any` | No | — |
| `availableInMCP` | `any` | No | — |
| `isArchived` | `any` | No | — |
| `versionId` | `any` | No | — |
| `activeVersionId` | `any` | No | — |
| `createdAt` | `any` | No | — |
| `updatedAt` | `any` | No | — |
| `tools` | `any` | No | — |
| `activeVersion` | `any` | No | — |
| `parentFolder` | `any` | No | — |
| `parentFolderId` | `any` | No | — |
| `isRunnable` | `any` | No | — |
| `hasPublishHistory` | `any` | No | — |
| `hasVersionHistory` | `any` | No | — |
| `skills` | `any` | No | — |
| `skillHashes` | `any` | No | — |
| `outdatedSkillIds` | `any` | No | — |
| `skillVersions` | `any` | No | — |
| `adopted` | `any` | No | — |

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `project` | `object \| null` | No | — |
| `availableInMCP` | `boolean \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null \| null` | No | — |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `config` | `object \| null` | No | — |
| `configHash` | `string \| null \| null` | No | — |
| `tools` | `object \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |
| `parentFolder` | `object \| null` | No | — |

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

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

> [accordion] tools full type
>
> ```ts theme={null}
> Record<string, {
>   code?: string | null,
>   descriptor?: {
>     name?: string | null
>   } | null
> }> | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   integrations?: {
>     type?: string | null,
>     credentialId?: string | null,
>     settings?: {
>     } | null,
>     approval?: {
>     } | null
>   }[] | null
> } | null | null
> ```

> [accordion] parentFolder full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   parentFolderId?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null | null
> ```

***

### versions.get

`agents.versions.get`

Retrieve an agent version. Retrieve one saved version of an agent, including its configuration, tools, and skills. Requires the agent:read API key scope. Added in n8n 2.50; older instances answer 404.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.agents.versions.get({ agentId: 'example', versionId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | Yes | The ID of the agent. |
| `versionId` | `string` | Yes | The ID of the agent version. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `versionId` | `string \| null` | No | — |
| `agentId` | `string \| null` | No | — |
| `name` | `string \| null \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `author` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `isActive` | `boolean \| null` | No | — |
| `isCurrent` | `boolean \| null` | No | — |
| `lastPublished` | `object \| null` | No | — |
| `config` | `object \| null` | No | — |
| `tools` | `object \| null` | No | — |
| `skills` | `object \| null` | No | — |

> [accordion] lastPublished full type
>
> ```ts theme={null}
> {
>   author?: string | null,
>   createdAt?: string | null,
>   isLegacy?: boolean | null
> } | null
> ```

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

> [accordion] tools full type
>
> ```ts theme={null}
> Record<string, {
>   code?: string | null,
>   descriptor?: {
>     name?: string | null
>   } | null
> }> | null
> ```

> [accordion] skills full type
>
> ```ts theme={null}
> Record<string, {
> }> | null
> ```

***

### versions.list

`agents.versions.list`

Retrieve agent version history. Returns a paginated list of saved agent versions for an agent. The response is one cursor page: read the next page with the cursor query parameter. Requires the agent:read API key scope. Added in n8n 2.50; older instances answer 404.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.agents.versions.list({ agentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `limit` | `number` | No | The maximum number of items to return. |
| `agentId` | `string` | Yes | The ID of the agent. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   agentId?: string | null,
>   name?: string | null | null,
>   description?: string | null | null,
>   author?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   isActive?: boolean | null,
>   isCurrent?: boolean | null,
>   lastPublished?: {
>     author?: string | null,
>     createdAt?: string | null,
>     isLegacy?: boolean | null
>   } | null
> }[] | null
> ```

***

## Ai Preferences

### create

`aiPreferences.create`

Create an AI preference. Create an AI preference for yourself (scope user), for a project (scope project, with projectId), or for the whole instance (scope instance). A preference for the instance or for another user needs the aiPreference:create permission. Added in n8n 2.50; older instances answer 404.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.aiPreferences.create({ content: 'example', scope: 'user' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `content` | `string` | Yes | One instruction, written as the user would say it. At most 2000 characters. A scope that already holds 50 preferences refuses a new one, so edit or delete one first. |
| `scope` | `user \| project \| instance` | Yes | — |
| `projectId` | `string \| null` | No | — |
| `userId` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `content` | `string \| null` | No | — |
| `scope` | `string \| null` | No | — |
| `userId` | `string \| null \| null` | No | — |
| `projectId` | `string \| null \| null` | No | — |
| `source` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### delete

`aiPreferences.delete`

Delete an AI preference. Delete an AI preference. Requires the aiPreference:delete API key scope. Added in n8n 2.50; older instances answer 404. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.aiPreferences.delete({ aiPreferenceId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `aiPreferenceId` | `string` | Yes | The ID of the AI preference. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### get

`aiPreferences.get`

Retrieve an AI preference. Retrieve one AI preference by ID. The content, scope, userId and projectId fields form the body that the update endpoint takes. Requires the aiPreference:read API key scope. Added in n8n 2.50; older instances answer 404.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.aiPreferences.get({ aiPreferenceId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `aiPreferenceId` | `string` | Yes | The ID of the AI preference. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `content` | `string \| null` | No | — |
| `scope` | `string \| null` | No | — |
| `userId` | `string \| null \| null` | No | — |
| `projectId` | `string \| null \| null` | No | — |
| `source` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### list

`aiPreferences.list`

List AI preferences. List the AI preferences you can read: the instance preferences, your own preferences, and the preferences of the projects where you hold the projectAiPreference:list permission. With the aiPreference:list permission, the list also has the preferences of other users. Filter with scope and projectId. Added in n8n 2.50; older instances answer 404.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.aiPreferences.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `limit` | `number` | No | The maximum number of items to return. |
| `scope` | `user \| project \| instance` | No | — |
| `projectId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   content?: string | null,
>   scope?: string | null,
>   userId?: string | null | null,
>   projectId?: string | null | null,
>   source?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### update

`aiPreferences.update`

Update an AI preference. Replace an AI preference with the full body: content, scope, and the userId or projectId of the scope. A user preference names its user in userId, and a project preference names its project in projectId. Added in n8n 2.50; older instances answer 404.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.aiPreferences.update({ aiPreferenceId: 'example', content: 'example', scope: 'user' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `aiPreferenceId` | `string` | Yes | The ID of the AI preference. |
| `content` | `string` | Yes | One instruction, written as the user would say it. At most 2000 characters. A scope that already holds 50 preferences refuses a new one, so edit or delete one first. |
| `scope` | `user \| project \| instance` | Yes | — |
| `projectId` | `string \| null` | No | — |
| `userId` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `content` | `string \| null` | No | — |
| `scope` | `string \| null` | No | — |
| `userId` | `string \| null \| null` | No | — |
| `projectId` | `string \| null \| null` | No | — |
| `source` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

## Audit

### generate

`audit.generate`

Generate an audit. Generate a security audit for your n8n instance. Requires the securityAudit:generate API key scope. Builds a security report of the instance (credentials, database, nodes, filesystem, instance).

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.audit.generate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `additionalOptions` | `object` | No | — |

> [accordion] additionalOptions full type
>
> ```ts theme={null}
> {
>   daysAbandonedWorkflow?: number,
>   categories?: (credentials | database | nodes | filesystem | instance)[]
> }
> ```

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

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   Credentials Risk Report?: {
>     risk?: string | null,
>     sections?: {
>       title?: string | null,
>       description?: string | null,
>       recommendation?: string | null,
>       location?: (
>         {
>           kind?: string | null,
>           workflowId?: string | null,
>           workflowName?: string | null,
>           nodeId?: string | null,
>           nodeName?: string | null,
>           nodeType?: string | null
>         } | {
>           kind?: string | null,
>           id?: string | null,
>           name?: string | null
>         } | {
>           kind?: string | null,
>           nodeType?: string | null,
>           packageUrl?: string | null
>         } | {
>           kind?: string | null,
>           nodeType?: string | null,
>           filePath?: string | null
>         }
>       )[] | null,
>       settings?: Record<string, any> | null,
>       nextVersions?: {
>         name?: string | null,
>         nodes?: any[] | null,
>         createdAt?: string | null,
>         description?: string | null,
>         documentationUrl?: string | null,
>         hasBreakingChange?: boolean | null,
>         hasSecurityFix?: boolean | null | null,
>         hasSecurityIssue?: boolean | null | null,
>         securityIssueFixVersion?: string | null | null
>       }[] | null
>     }[] | null
>   } | null,
>   Database Risk Report?: {
>     risk?: string | null,
>     sections?: {
>       title?: string | null,
>       description?: string | null,
>       recommendation?: string | null,
>       location?: (
>         {
>           kind?: string | null,
>           workflowId?: string | null,
>           workflowName?: string | null,
>           nodeId?: string | null,
>           nodeName?: string | null,
>           nodeType?: string | null
>         } | {
>           kind?: string | null,
>           id?: string | null,
>           name?: string | null
>         } | {
>           kind?: string | null,
>           nodeType?: string | null,
>           packageUrl?: string | null
>         } | {
>           kind?: string | null,
>           nodeType?: string | null,
>           filePath?: string | null
>         }
>       )[] | null,
>       settings?: Record<string, any> | null,
>       nextVersions?: {
>         name?: string | null,
>         nodes?: any[] | null,
>         createdAt?: string | null,
>         description?: string | null,
>         documentationUrl?: string | null,
>         hasBreakingChange?: boolean | null,
>         hasSecurityFix?: boolean | null | null,
>         hasSecurityIssue?: boolean | null | null,
>         securityIssueFixVersion?: string | null | null
>       }[] | null
>     }[] | null
>   } | null,
>   Filesystem Risk Report?: {
>     risk?: string | null,
>     sections?: {
>       title?: string | null,
>       description?: string | null,
>       recommendation?: string | null,
>       location?: (
>         {
>           kind?: string | null,
>           workflowId?: string | null,
>           workflowName?: string | null,
>           nodeId?: string | null,
>           nodeName?: string | null,
>           nodeType?: string | null
>         } | {
>           kind?: string | null,
>           id?: string | null,
>           name?: string | null
>         } | {
>           kind?: string | null,
>           nodeType?: string | null,
>           packageUrl?: string | null
>         } | {
>           kind?: string | null,
>           nodeType?: string | null,
>           filePath?: string | null
>         }
>       )[] | null,
>       settings?: Record<string, any> | null,
>       nextVersions?: {
>         name?: string | null,
>         nodes?: any[] | null,
>         createdAt?: string | null,
>         description?: string | null,
>         documentationUrl?: string | null,
>         hasBreakingChange?: boolean | null,
>         hasSecurityFix?: boolean | null | null,
>         hasSecurityIssue?: boolean | null | null,
>         securityIssueFixVersion?: string | null | null
>       }[] | null
>     }[] | null
>   } | null,
>   Nodes Risk Report?: {
>     risk?: string | null,
>     sections?: {
>       title?: string | null,
>       description?: string | null,
>       recommendation?: string | null,
>       location?: (
>         {
>           kind?: string | null,
>           workflowId?: string | null,
>           workflowName?: string | null,
>           nodeId?: string | null,
>           nodeName?: string | null,
>           nodeType?: string | null
>         } | {
>           kind?: string | null,
>           id?: string | null,
>           name?: string | null
>         } | {
>           kind?: string | null,
>           nodeType?: string | null,
>           packageUrl?: string | null
>         } | {
>           kind?: string | null,
>           nodeType?: string | null,
>           filePath?: string | null
>         }
>       )[] | null,
>       settings?: Record<string, any> | null,
>       nextVersions?: {
>         name?: string | null,
>         nodes?: any[] | null,
>         createdAt?: string | null,
>         description?: string | null,
>         documentationUrl?: string | null,
>         hasBreakingChange?: boolean | null,
>         hasSecurityFix?: boolean | null | null,
>         hasSecurityIssue?: boolean | null | null,
>         securityIssueFixVersion?: string | null | null
>       }[] | null
>     }[] | null
>   } | null,
>   Instance Risk Report?: {
>     risk?: string | null,
>     sections?: {
>       title?: string | null,
>       description?: string | null,
>       recommendation?: string | null,
>       location?: (
>         {
>           kind?: string | null,
>           workflowId?: string | null,
>           workflowName?: string | null,
>           nodeId?: string | null,
>           nodeName?: string | null,
>           nodeType?: string | null
>         } | {
>           kind?: string | null,
>           id?: string | null,
>           name?: string | null
>         } | {
>           kind?: string | null,
>           nodeType?: string | null,
>           packageUrl?: string | null
>         } | {
>           kind?: string | null,
>           nodeType?: string | null,
>           filePath?: string | null
>         }
>       )[] | null,
>       settings?: Record<string, any> | null,
>       nextVersions?: {
>         name?: string | null,
>         nodes?: any[] | null,
>         createdAt?: string | null,
>         description?: string | null,
>         documentationUrl?: string | null,
>         hasBreakingChange?: boolean | null,
>         hasSecurityFix?: boolean | null | null,
>         hasSecurityIssue?: boolean | null | null,
>         securityIssueFixVersion?: string | null | null
>       }[] | null
>     }[] | null
>   } | null
> } | any[]
> ```

***

## Community Packages

### install

`communityPackages.install`

Install a community package. Install a community package by npm name and optional version. Requires the communityPackage:install API key scope. Installs an npm package of nodes on the n8n server.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.communityPackages.install({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `name` | `string` | Yes | npm package name. Unscoped names start with n8n-nodes-. Scoped names use the @\[author]/n8n-nodes- form. |
| `version` | `string` | No | Semver version or npm dist-tag, such as latest or beta. When unverified packages are disabled, only versions verified by n8n can be installed. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `packageName` | `string \| null` | No | npm package name |
| `installedVersion` | `string \| null` | No | Currently installed version |
| `authorName` | `string \| null` | No | Package author name |
| `authorEmail` | `string \| null` | No | Package author email |
| `installedNodes` | `object[] \| null` | No | Nodes included in this package |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `updateAvailable` | `string \| null` | No | Version available for update, if any |
| `failedLoading` | `boolean \| null` | No | Whether the package failed to load |
| `policyRestrictions` | `object \| null` | No | Node types from this package that a node type policy blocks. The install does not fail because of a policy. Absent when no policy was evaluated, for example when node type policies are not licensed. An empty nodeTypes list means that no policy blocks a node type from this package. |

> [accordion] installedNodes full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   type?: string | null,
>   latestVersion?: number | null
> }[] | null
> ```

> [accordion] policyRestrictions full type
>
> ```ts theme={null}
> {
>   nodeTypes?: {
>     type?: string | null,
>     blockedOn?: string | null,
>     optInAvailable?: boolean | null
>   }[] | null
> } | null
> ```

***

### list

`communityPackages.list`

List installed community packages. Retrieve all installed community packages with pending update info. Requires the communityPackage:list API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.communityPackages.list({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   packageName?: string | null,
>   installedVersion?: string | null,
>   authorName?: string | null,
>   authorEmail?: string | null,
>   installedNodes?: {
>     name?: string | null,
>     type?: string | null,
>     latestVersion?: number | null
>   }[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   updateAvailable?: string | null,
>   failedLoading?: boolean | null
> }[]
> ```

***

### uninstall

`communityPackages.uninstall`

Uninstall a community package. Uninstall a community package by name. Requires the communityPackage:uninstall API key scope. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.communityPackages.uninstall({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | npm package name |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### update

`communityPackages.update`

Update a community package. Update an installed community package to a new version. Requires the communityPackage:update API key scope.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.communityPackages.update({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | npm package name |
| `version` | `string` | No | Semver version or npm dist-tag to update to, such as latest or beta. When unverified packages are disabled, only versions verified by n8n can be installed. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `packageName` | `string \| null` | No | npm package name |
| `installedVersion` | `string \| null` | No | Currently installed version |
| `authorName` | `string \| null` | No | Package author name |
| `authorEmail` | `string \| null` | No | Package author email |
| `installedNodes` | `object[] \| null` | No | Nodes included in this package |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `updateAvailable` | `string \| null` | No | Version available for update, if any |
| `failedLoading` | `boolean \| null` | No | Whether the package failed to load |

> [accordion] installedNodes full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   type?: string | null,
>   latestVersion?: number | null
> }[] | null
> ```

***

## Credentials

### create

`credentials.create`

Create a credential. Creates a credential that can be used by nodes of the specified type. Requires the credential:create API key scope. The secret values go in data; n8n encrypts them and never returns them.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.credentials.create({
	name: 'example',
	type: 'example',
	data: {},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `id` | `string` | No | An unused credential ID of 1–16 letters, digits, underscores, or hyphens. The supplied ID is preserved exactly. Omit to generate an ID. |
| `name` | `string` | Yes | — |
| `description` | `string \| null` | No | Plain text, up to 512 characters. A blank value is saved as null. Ignored when credential descriptions are disabled. |
| `type` | `string` | Yes | — |
| `data` | `Record<string, any>` | Yes | The credential data. Fields also accept n8n expressions, which are strings that start with "=". |
| `isResolvable` | `boolean` | No | Whether this credential has resolvable fields |
| `projectId` | `string` | No | Project to create the credential in. Defaults to the user's personal project. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `isManaged` | `boolean \| null` | No | — |
| `isGlobal` | `boolean \| null` | No | — |
| `isResolvable` | `boolean \| null` | No | — |
| `resolvableAllowFallback` | `boolean \| null` | No | — |
| `resolverId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | Present only when credential descriptions are enabled. |

***

### delete

`credentials.delete`

Delete credential by ID. Deletes a credential from your instance. You must be the owner of the credential. Requires the credential:delete API key scope. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.credentials.delete({ credentialId: 'R2DjclaysHbqn778' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `credentialId` | `string` | Yes | The ID of the credential. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `isManaged` | `boolean \| null` | No | — |
| `isGlobal` | `boolean \| null` | No | — |
| `isResolvable` | `boolean \| null` | No | — |
| `resolvableAllowFallback` | `boolean \| null` | No | — |
| `resolverId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | Present only when credential descriptions are enabled. |
| `usageScope` | `string \| null` | No | — |

***

### get

`credentials.get`

Get credential by ID. Retrieves a credential by ID. Credential data (secrets) is not included. Requires the credential:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.credentials.get({ credentialId: 'R2DjclaysHbqn778' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `credentialId` | `string` | Yes | The ID of the credential. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `isManaged` | `boolean \| null` | No | — |
| `isGlobal` | `boolean \| null` | No | — |
| `isResolvable` | `boolean \| null` | No | — |
| `resolvableAllowFallback` | `boolean \| null` | No | — |
| `resolverId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | Present only when credential descriptions are enabled. |

***

### getDependencies

`credentials.getDependencies`

List credential dependencies. List the workflows and agents that use the credential. Requires the credential:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.credentials.getDependencies({ credentialId: 'R2DjclaysHbqn778' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `credentialId` | `string` | Yes | The ID of the credential. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |
| `inaccessibleCount` | `number \| null` | No | The number of dependencies that you do not have access to. They are not listed. |

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

***

### getSchema

`credentials.getSchema`

Show credential data schema. (GET /credentials/schema/\{credentialTypeName})

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.credentials.getSchema({ credentialTypeName: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `credentialTypeName` | `string` | Yes | The credential type name that you want to get the schema for |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `additionalProperties` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | — |
| `properties` | `Record<string, any> \| null` | No | JSON Schema fragment for each of the credential type's fields, keyed by field name. |
| `required` | `string[] \| null` | No | Names of the fields that a request must include. A field with a default value is not listed. |
| `allOf` | `any[] \| null` | No | — |

***

### list

`credentials.list`

List credentials. Retrieve all credentials from your instance. Only available for the instance owner and admin. Credential data (secrets) is not included. Requires the credential:list API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.credentials.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   type?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   shared?: {
>     id?: string | null,
>     name?: string | null,
>     role?: string | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   }[] | null
> }[] | null
> ```

***

### test

`credentials.test`

Test credential by ID. Tests a credential by ID using the stored credential data. Requires the credential:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.credentials.test({ credentialId: 'R2DjclaysHbqn778' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `credentialId` | `string` | Yes | The ID of the credential. |

**Output**

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

***

### transfer

`credentials.transfer`

Transfer a credential to another project. Transfer a credential to another project. Requires the credential:move API key scope.

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

```ts theme={null}
await corsair.n8n.api.credentials.transfer({ credentialId: 'R2DjclaysHbqn778', destinationProjectId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `credentialId` | `string` | Yes | The ID of the credential. |
| `destinationProjectId` | `string` | Yes | The ID of the project to transfer the credential to. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### update

`credentials.update`

Update credential by ID. Updates an existing credential. You must be the owner of the credential. Requires the credential:update API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.credentials.update({ credentialId: 'R2DjclaysHbqn778' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `credentialId` | `string` | Yes | The ID of the credential. |
| `name` | `string` | No | The name of the credential |
| `description` | `string \| null` | No | Plain text, up to 512 characters. Send null or a blank value to clear it. Omit it to keep the stored value. Ignored when credential descriptions are disabled. |
| `type` | `string` | No | The credential type. If changing type, data must also be provided. |
| `data` | `Record<string, any>` | No | The credential data. Required when changing credential type. Fields also accept n8n expressions, which are strings that start with "=". |
| `isGlobal` | `boolean` | No | Whether this credential is available globally |
| `isResolvable` | `boolean` | No | Whether this credential has resolvable fields |
| `isPartialData` | `boolean` | No | If true, unredacts and merges existing credential data with the provided data. If false, replaces the entire data object. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `isManaged` | `boolean \| null` | No | — |
| `isGlobal` | `boolean \| null` | No | — |
| `isResolvable` | `boolean \| null` | No | — |
| `resolvableAllowFallback` | `boolean \| null` | No | — |
| `resolverId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | Present only when credential descriptions are enabled. |

***

## Credential Type Policies

### attachments.get

`credentialTypePolicies.attachments.get`

Preview: Retrieve a scope's attached policy documents. Preview — breaking changes may still occur without major version bump. Returns every attached policy document and the scope version. Attachments use evaluation order: floor first, then priority ascending within each group. Use this version when replacing the attachments. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.credentialTypePolicies.attachments.get({ scopeId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `scopeId` | `string` | Yes | The ID of the credential type policy scope. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `attachments` | `object[] \| null` | No | — |
| `version` | `number \| null` | No | — |

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   policyId?: string | null,
>   rules?: {
>     id?: string | null,
>     action?: string | null,
>     selector?: {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | null
>   }[] | null,
>   priority?: number | null,
>   isFloor?: boolean | null
> }[] | null
> ```

***

### attachments.replace

`credentialTypePolicies.attachments.replace`

Preview: Replace a scope's attached policy documents. Preview — breaking changes may still occur without major version bump. Replaces every attachment on a scope. scopeId comes from the scope's GET response once it has been written. Each policyId and each (isFloor, priority) pair must be unique within the list. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.credentialTypePolicies.attachments.replace({
	scopeId: 'example',
	attachments: [{ policyId: 'example', priority: 1, isFloor: true }],
	version: 1,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `scopeId` | `string` | Yes | The ID of the credential type policy scope. |
| `attachments` | `object[]` | Yes | — |
| `version` | `number` | Yes | — |

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   policyId: string,
>   priority: number,
>   isFloor: boolean
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `attachments` | `object[] \| null` | No | — |
| `version` | `number \| null` | No | — |

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   policyId?: string | null,
>   rules?: {
>     id?: string | null,
>     action?: string | null,
>     selector?: {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | null
>   }[] | null,
>   priority?: number | null,
>   isFloor?: boolean | null
> }[] | null
> ```

***

### documents.create

`credentialTypePolicies.documents.create`

Preview: Create a credential type policy document. Preview — breaking changes may still occur without major version bump. Creates a reusable policy document that is not yet attached to any scope. Rule ids must be unique within the list. warnings lists rules that an earlier rule already shadows. Requires the credentialTypePolicy:manage API key scope. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.credentialTypePolicies.documents.create({
	rules: [{
		id: 'doc_8f2k1x9q',
		action: 'allow',
		selector: { kind: 'name', value: 'example' },
	}],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `rules` | `object[]` | Yes | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id: string,
>   action: allow | deny | delegate,
>   selector: {
>     kind: name,
>     value: string
>   } | {
>     kind: package,
>     value: string
>   } | {
>     kind: extends,
>     value: string
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `policy` | `object \| null` | No | — |
| `warnings` | `object[] \| null` | No | — |

> [accordion] policy full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   kind?: string | null,
>   rules?: {
>     id?: string | null,
>     action?: string | null,
>     selector?: {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | null
>   }[] | null,
>   version?: number | null,
>   updatedBy?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] warnings full type
>
> ```ts theme={null}
> (
>   {
>     kind?: string | null,
>     ruleId?: string | null,
>     shadowedByRuleId?: string | null
>   } | {
>     kind?: string | null,
>     ruleId?: string | null
>   }
> )[] | null
> ```

***

### documents.delete

`credentialTypePolicies.documents.delete`

Preview: Delete a credential type policy document. Preview — breaking changes may still occur without major version bump. Deletes a policy document. A document that is still attached to a scope is rejected with 409; detach it first. Requires the credentialTypePolicy:manage API key scope. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.credentialTypePolicies.documents.delete({ policyId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `policyId` | `string` | Yes | The ID of the credential type policy document. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### documents.get

`credentialTypePolicies.documents.get`

Preview: Retrieve a credential type policy document. Preview — breaking changes may still occur without major version bump. Requires the credentialTypePolicy:manage API key scope. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.credentialTypePolicies.documents.get({ policyId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `policyId` | `string` | Yes | The ID of the credential type policy document. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `kind` | `string \| null` | No | — |
| `rules` | `object[] \| null` | No | — |
| `version` | `number \| null` | No | — |
| `updatedBy` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   action?: string | null,
>   selector?: {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | null
> }[] | null
> ```

***

### documents.list

`credentialTypePolicies.documents.list`

Preview: List credential type policy documents. Preview — breaking changes may still occur without major version bump. Returns a cursor-paginated list of reusable policy documents. Requires the credentialTypePolicy:manage API key scope. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.credentialTypePolicies.documents.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   kind?: string | null,
>   rules?: {
>     id?: string | null,
>     action?: string | null,
>     selector?: {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | null
>   }[] | null,
>   version?: number | null,
>   updatedBy?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### documents.update

`credentialTypePolicies.documents.update`

Preview: Replace the rules of a credential type policy document. Preview — breaking changes may still occur without major version bump. Replaces the document's whole rule list. version must equal the version last read; a stale value is rejected with 409. Every scope the document is attached to has its version bumped. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.credentialTypePolicies.documents.update({
	policyId: 'example',
	rules: [{
		id: 'doc_8f2k1x9q',
		action: 'allow',
		selector: { kind: 'name', value: 'example' },
	}],
	version: 1,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `policyId` | `string` | Yes | The ID of the credential type policy document. |
| `rules` | `object[]` | Yes | — |
| `version` | `number` | Yes | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id: string,
>   action: allow | deny | delegate,
>   selector: {
>     kind: name,
>     value: string
>   } | {
>     kind: package,
>     value: string
>   } | {
>     kind: extends,
>     value: string
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `policy` | `object \| null` | No | — |
| `warnings` | `object[] \| null` | No | — |

> [accordion] policy full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   kind?: string | null,
>   rules?: {
>     id?: string | null,
>     action?: string | null,
>     selector?: {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | null
>   }[] | null,
>   version?: number | null,
>   updatedBy?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] warnings full type
>
> ```ts theme={null}
> (
>   {
>     kind?: string | null,
>     ruleId?: string | null,
>     shadowedByRuleId?: string | null
>   } | {
>     kind?: string | null,
>     ruleId?: string | null
>   }
> )[] | null
> ```

***

### getInstance

`credentialTypePolicies.getInstance`

Preview: Retrieve the instance credential type policy. Preview — breaking changes may still occur without major version bump. Returns the composed instance-scope policy: its default action and the rules of every attached policy document in evaluation order. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.credentialTypePolicies.getInstance({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `scopeId` | `string \| null \| null` | No | — |
| `rules` | `object[] \| null` | No | — |
| `defaultAction` | `string \| null` | No | — |
| `version` | `number \| null` | No | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   action?: string | null,
>   selector?: {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | null
> }[] | null
> ```

***

### getProject

`credentialTypePolicies.getProject`

Preview: Retrieve a project's credential type policy. Preview — breaking changes may still occur without major version bump. Returns the project's own composed policy, not the result of combining it with the instance policy. A project that was never configured reports scopeId: null, no rules, defaultAction: allow, and version: 0. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.credentialTypePolicies.getProject({ projectId: 'VmwOO9HeTEj20kxM' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | The ID of the project. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `scopeId` | `string \| null \| null` | No | — |
| `rules` | `object[] \| null` | No | — |
| `defaultAction` | `string \| null` | No | — |
| `version` | `number \| null` | No | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   action?: string | null,
>   selector?: {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | null
> }[] | null
> ```

***

### setInstance

`credentialTypePolicies.setInstance`

Preview: Replace the instance credential type policy. Preview — breaking changes may still occur without major version bump. Sets the instance default action and replaces the rules of its single policy document, creating both on first write. version must equal the version last read; a stale value is rejected with 409. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.credentialTypePolicies.setInstance({
	rules: [{
		id: 'doc_8f2k1x9q',
		action: 'allow',
		selector: { kind: 'name', value: 'example' },
	}],
	defaultAction: 'allow',
	version: 1,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rules` | `object[]` | Yes | — |
| `defaultAction` | `allow \| deny \| delegate` | Yes | — |
| `version` | `number` | Yes | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id: string,
>   action: allow | deny | delegate,
>   selector: {
>     kind: name,
>     value: string
>   } | {
>     kind: package,
>     value: string
>   } | {
>     kind: extends,
>     value: string
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `scopeId` | `string \| null \| null` | No | — |
| `rules` | `object[] \| null` | No | — |
| `defaultAction` | `string \| null` | No | — |
| `version` | `number \| null` | No | — |
| `warnings` | `object[] \| null` | No | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   action?: string | null,
>   selector?: {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | null
> }[] | null
> ```

> [accordion] warnings full type
>
> ```ts theme={null}
> (
>   {
>     kind?: string | null,
>     ruleId?: string | null,
>     shadowedByRuleId?: string | null
>   } | {
>     kind?: string | null,
>     ruleId?: string | null
>   }
> )[] | null
> ```

***

### setProject

`credentialTypePolicies.setProject`

Preview: Replace a project's credential type policy. Preview — breaking changes may still occur without major version bump. Sets the project's default action and replaces the rules of its single policy document, creating both on first write. Only a team project can have a policy; a personal project is rejected with 400. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.credentialTypePolicies.setProject({
	projectId: 'VmwOO9HeTEj20kxM',
	rules: [{
		id: 'doc_8f2k1x9q',
		action: 'allow',
		selector: { kind: 'name', value: 'example' },
	}],
	defaultAction: 'allow',
	version: 1,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | The ID of the project. |
| `rules` | `object[]` | Yes | — |
| `defaultAction` | `allow \| deny` | Yes | — |
| `version` | `number` | Yes | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id: string,
>   action: allow | deny,
>   selector: {
>     kind: name,
>     value: string
>   } | {
>     kind: package,
>     value: string
>   } | {
>     kind: extends,
>     value: string
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `scopeId` | `string \| null \| null` | No | — |
| `rules` | `object[] \| null` | No | — |
| `defaultAction` | `string \| null` | No | — |
| `version` | `number \| null` | No | — |
| `warnings` | `object[] \| null` | No | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   action?: string | null,
>   selector?: {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | null
> }[] | null
> ```

> [accordion] warnings full type
>
> ```ts theme={null}
> (
>   {
>     kind?: string | null,
>     ruleId?: string | null,
>     shadowedByRuleId?: string | null
>   } | {
>     kind?: string | null,
>     ruleId?: string | null
>   }
> )[] | null
> ```

***

## Data Tables

### columns.create

`dataTables.columns.create`

Add a column to a data table. Add a new column to an existing data table. Requires the dataTableColumn:create API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.dataTables.columns.create({ dataTableId: 'Ab3dEf6hIj9kLm2N', name: 'example', type: 'string' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `dataTableId` | `string` | Yes | The ID of the data table |
| `name` | `string` | Yes | Column name. Must start with a letter; only letters, digits, and underscores after that; maximum 63 characters. |
| `type` | `string \| number \| boolean \| date` | Yes | Column data type |
| `index` | `number` | No | Column position (optional, appended to end if omitted) |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | Column ID |
| `name` | `string \| null` | No | Column name |
| `type` | `string \| null` | No | Column data type |
| `index` | `number \| null` | No | Column position |
| `createdAt` | `string \| null` | No | Timestamp when the column was created |
| `updatedAt` | `string \| null` | No | Timestamp when the column was last updated |
| `dataTableId` | `string \| null` | No | ID of the data table this column belongs to |

***

### columns.delete

`dataTables.columns.delete`

Delete a column. Remove a column from a data table. This will also delete all data in the column. Requires the dataTableColumn:delete API key scope. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.dataTables.columns.delete({ dataTableId: 'Ab3dEf6hIj9kLm2N', columnId: 'Zx8cVb7nMq1wEr4T' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `dataTableId` | `string` | Yes | The ID of the data table |
| `columnId` | `string` | Yes | The ID of the column |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### columns.list

`dataTables.columns.list`

List columns of a data table. Retrieve all columns for a specific data table. Requires the dataTableColumn:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.dataTables.columns.list({ dataTableId: 'Ab3dEf6hIj9kLm2N' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `dataTableId` | `string` | Yes | The ID of the data table |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   type?: string | null,
>   index?: number | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   dataTableId?: string | null
> }[]
> ```

***

### columns.update

`dataTables.columns.update`

Update a column. Rename and/or reorder a column in a data table. Requires the dataTableColumn:update API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.dataTables.columns.update({ dataTableId: 'Ab3dEf6hIj9kLm2N', columnId: 'Zx8cVb7nMq1wEr4T' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `dataTableId` | `string` | Yes | The ID of the data table |
| `columnId` | `string` | Yes | The ID of the column |
| `name` | `string` | No | Column name. Must start with a letter; only letters, digits, and underscores after that; maximum 63 characters. |
| `index` | `number` | No | New zero-based position for the column |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | Column ID |
| `name` | `string \| null` | No | Column name |
| `type` | `string \| null` | No | Column data type |
| `index` | `number \| null` | No | Column position |
| `createdAt` | `string \| null` | No | Timestamp when the column was created |
| `updatedAt` | `string \| null` | No | Timestamp when the column was last updated |
| `dataTableId` | `string \| null` | No | ID of the data table this column belongs to |

***

### create

`dataTables.create`

Create a new data table. Create a new data table in your personal project or a team project you have access to. Requires the dataTable:create API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.dataTables.create({
	name: 'example',
	columns: [{ name: 'example', type: 'string' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `name` | `string` | Yes | Name of the data table |
| `columns` | `object[]` | Yes | Column definitions for the table |
| `projectId` | `string` | No | ID of the project to create the table in. When omitted, the table is created in the user's personal project. |
| `fileId` | `string` | No | ID of a CSV file that you uploaded in the n8n editor. If you set it, n8n fills the new table with the rows from that file. Only a session-authenticated caller can upload a file, so an API-key caller cannot use this field. |
| `hasHeaders` | `boolean` | No | Set to true if the first row of the CSV file holds the column names. Applies only when you set `fileId`. The default is true. |

> [accordion] columns full type
>
> ```ts theme={null}
> {
>   name: string,
>   type: string | number | boolean | date,
>   csvColumnName?: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | Unique identifier for the data table |
| `name` | `string \| null` | No | Name of the data table |
| `columns` | `object[] \| null` | No | Column definitions |
| `projectId` | `string \| null` | No | ID of the project this table belongs to |
| `createdAt` | `string \| null` | No | Timestamp when the table was created |
| `updatedAt` | `string \| null` | No | Timestamp when the table was last updated |
| `sizeBytes` | `number \| null` | No | Physical storage in bytes, including indexes and internal overhead. Not reduced immediately by row deletion, and may be a few seconds stale. |

> [accordion] columns full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   type?: string | null,
>   index?: number | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### delete

`dataTables.delete`

Delete a data table. Delete a data table. This will also delete all rows in the table. Requires the dataTable:delete API key scope. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.dataTables.delete({ dataTableId: 'Ab3dEf6hIj9kLm2N' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `dataTableId` | `string` | Yes | The ID of the data table |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### get

`dataTables.get`

Get a data table. Retrieve a specific data table by ID. Requires the dataTable:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.dataTables.get({ dataTableId: 'Ab3dEf6hIj9kLm2N' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `dataTableId` | `string` | Yes | The ID of the data table |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | Unique identifier for the data table |
| `name` | `string \| null` | No | Name of the data table |
| `columns` | `object[] \| null` | No | Column definitions |
| `projectId` | `string \| null` | No | ID of the project this table belongs to |
| `createdAt` | `string \| null` | No | Timestamp when the table was created |
| `updatedAt` | `string \| null` | No | Timestamp when the table was last updated |
| `sizeBytes` | `number \| null` | No | Physical storage in bytes, including indexes and internal overhead. Not reduced immediately by row deletion, and may be a few seconds stale. |

> [accordion] columns full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   type?: string | null,
>   index?: number | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### getDependencies

`dataTables.getDependencies`

List data table dependencies. List the workflows that use the data table. Requires the dataTable:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.dataTables.getDependencies({ dataTableId: 'Ab3dEf6hIj9kLm2N' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `dataTableId` | `string` | Yes | The ID of the data table |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |
| `inaccessibleCount` | `number \| null` | No | The number of dependencies that you do not have access to. They are not listed. |

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

***

### list

`dataTables.list`

List all data tables. Retrieve a list of all data tables with optional filtering, sorting, and pagination. Each table includes sizeBytes, the value the size sort option orders by. Requires the dataTable:list API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.dataTables.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `filter` | `string` | No | JSON string of filter conditions |
| `sortBy` | `name:asc \| name:desc \| createdAt:asc \| createdAt:desc \| updatedAt:asc \| updatedAt:desc \| size:asc \| size:desc` | No | Sort format: field:asc or field:desc |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | Paginate through data tables by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection. |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   columns?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     index?: number | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   }[] | null,
>   projectId?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   sizeBytes?: number | null
> }[] | null
> ```

***

### rows.clear

`dataTables.rows.clear`

Clear all rows from a data table. Permanently delete all rows from a data table. The table structure is retained. This action cannot be undone. Requires the dataTableRow:delete API key scope. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.dataTables.rows.clear({ dataTableId: 'Ab3dEf6hIj9kLm2N' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `dataTableId` | `string` | Yes | The ID of the data table |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `deletedCount` | `number \| null` | No | The number of rows that were deleted |

***

### rows.delete

`dataTables.rows.delete`

Delete rows from a data table. Delete rows matching filter conditions from a data table. Filter is required to prevent accidental deletion of all data. Requires the dataTableRow:delete API key scope. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.dataTables.rows.delete({ dataTableId: 'Ab3dEf6hIj9kLm2N', filter: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `dataTableId` | `string` | Yes | The ID of the data table |
| `filter` | `string` | Yes | JSON string of filter conditions. Required to prevent accidental deletion of all data. |
| `returnData` | `boolean` | No | If true, return the deleted rows. If false, return true on success. |
| `dryRun` | `boolean` | No | If true, preview which rows would be deleted without actually deleting them. |

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

> [accordion] Output full type
>
> ```ts theme={null}
> boolean | {
>   id?: number | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   dryRunState?: string | null
> }[] | {
>   id?: number | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[]
> ```

***

### rows.insert

`dataTables.rows.insert`

Insert rows into a data table. Insert one or more rows into a data table. Requires the dataTableRow:create API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.dataTables.rows.insert({
	dataTableId: 'Ab3dEf6hIj9kLm2N',
	data: [{}],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `dataTableId` | `string` | Yes | The ID of the data table |
| `data` | `Record<string, string \| number \| boolean \| any \| string \| any>[]` | Yes | Array of rows to insert. Each row is an object with column names as keys. |
| `returnType` | `all \| count \| id` | No | count: return only the number of rows inserted. id: return an array of objects with the id of each inserted row. all: return the full row data for all inserted rows. |

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

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   success?: boolean | null,
>   insertedRows?: number | null
> } | {
>   id?: number | null
> }[] | {
>   id?: number | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[]
> ```

***

### rows.list

`dataTables.rows.list`

List rows of a data table. Retrieve rows from a data table with optional filtering, sorting, and pagination. Requires the dataTableRow:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.dataTables.rows.list({ dataTableId: 'Ab3dEf6hIj9kLm2N' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `dataTableId` | `string` | Yes | The ID of the data table |
| `filter` | `string` | No | JSON string of filter conditions |
| `sortBy` | `string` | No | Sort format: columnName:asc or columnName:desc |
| `search` | `string` | No | Search text across all string columns |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | Paginate through rows by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection. |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### rows.update

`dataTables.rows.update`

Update rows in a data table. Update rows matching filter conditions in a data table. Requires the dataTableRow:update API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.dataTables.rows.update({
	dataTableId: 'Ab3dEf6hIj9kLm2N',
	filter: {
		filters: [{ columnName: 'example', condition: 'eq', value: 'example' }],
	},
	data: {},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `dataTableId` | `string` | Yes | The ID of the data table |
| `filter` | `object` | Yes | Filter conditions to match rows for update. |
| `data` | `Record<string, string \| number \| boolean \| any \| string \| any>` | Yes | Column values to update |
| `returnData` | `boolean` | No | Set to true to return the updated row(s). Set to false to return true on success. |
| `dryRun` | `boolean` | No | Set to true to preview the change without saving it. |

> [accordion] filter full type
>
> ```ts theme={null}
> {
>   type?: and | or,
>   filters: {
>     columnName: string,
>     condition: eq | neq | like | ilike | gt | gte | lt | lte,
>     value: string | number | boolean | string | any | any
>   }[]
> }
> ```

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

> [accordion] Output full type
>
> ```ts theme={null}
> boolean | {
>   id?: number | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   dryRunState?: string | null
> }[] | {
>   id?: number | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[]
> ```

***

### rows.upsert

`dataTables.rows.upsert`

Upsert a row in a data table. Update an existing row, or insert a new one if no row matches the filter conditions. Requires the dataTableRow:upsert API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.dataTables.rows.upsert({
	dataTableId: 'Ab3dEf6hIj9kLm2N',
	filter: {
		filters: [{ columnName: 'example', condition: 'eq', value: 'example' }],
	},
	data: {},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `dataTableId` | `string` | Yes | The ID of the data table |
| `filter` | `object` | Yes | Filter conditions to match an existing row. If no row matches, n8n inserts a new row. |
| `data` | `Record<string, string \| number \| boolean \| any \| string \| any>` | Yes | Column values for the row |
| `returnData` | `boolean` | No | Set to true to return the upserted row(s): the matching rows if updated, or the new row if one was inserted. Set to false to return true on success. |
| `dryRun` | `boolean` | No | Set to true to preview the change without saving it. |

> [accordion] filter full type
>
> ```ts theme={null}
> {
>   type?: and | or,
>   filters: {
>     columnName: string,
>     condition: eq | neq | like | ilike | gt | gte | lt | lte,
>     value: string | number | boolean | string | any | any
>   }[]
> }
> ```

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

> [accordion] Output full type
>
> ```ts theme={null}
> boolean | {
>   id?: number | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   dryRunState?: string | null
> }[] | {
>   id?: number | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[]
> ```

***

### update

`dataTables.update`

Update a data table. Update a data table's name. Requires the dataTable:update API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.dataTables.update({ dataTableId: 'Ab3dEf6hIj9kLm2N', name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `dataTableId` | `string` | Yes | The ID of the data table |
| `name` | `string` | Yes | New name for the data table |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | Unique identifier for the data table |
| `name` | `string \| null` | No | Name of the data table |
| `columns` | `object[] \| null` | No | Column definitions |
| `projectId` | `string \| null` | No | ID of the project this table belongs to |
| `createdAt` | `string \| null` | No | Timestamp when the table was created |
| `updatedAt` | `string \| null` | No | Timestamp when the table was last updated |
| `sizeBytes` | `number \| null` | No | Physical storage in bytes, including indexes and internal overhead. Not reduced immediately by row deletion, and may be a few seconds stale. |

> [accordion] columns full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   type?: string | null,
>   index?: number | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

## Discover

### get

`discover.get`

Discover available API capabilities. Returns a filtered capability map based on the caller's API key scopes. Each resource includes the operations and endpoints accessible to the authenticated API key. Use query parameters to narrow the response.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.discover.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `include` | `schemas` | No | Include additional data. Use "schemas" to inline request body schemas per endpoint, eliminating the need to fetch the full OpenAPI spec. |
| `resource` | `string` | No | Filter to a specific resource (e.g. "workflow", "tags", "credential"). |
| `operation` | `string` | No | Filter to endpoints with a specific operation (e.g. "read", "create", "list"). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   scopes?: string[] | null,
>   resources?: Record<string, {
>     operations?: string[] | null,
>     endpoints?: {
>       method?: string | null,
>       path?: string | null,
>       operationId?: string | null,
>       requestSchema?: {
>       } | null
>     }[] | null
>   }> | null,
>   filters?: Record<string, {
>     description?: string | null,
>     values?: string[] | null
>   }> | null,
>   specUrl?: string | null
> } | null
> ```

***

## Evaluations

### cancelRun

`evaluations.cancelRun`

Cancel a test run. Cancel a running evaluation test run of a workflow. The user must also have the workflow:execute project scope. Requires the testRun:cancel API key scope. Needs a licence with evaluations (Business or Enterprise plans): without it n8n answers 403.

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

```ts theme={null}
await corsair.n8n.api.evaluations.cancelRun({ workflowId: '2tUt1wbLX592XDdX', runId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `workflowId` | `string` | Yes | The ID of the workflow |
| `runId` | `string` | Yes | The ID of the test run. |

**Output**

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

***

### getRun

`evaluations.getRun`

Retrieve a test run. Retrieve a single evaluation test run of a workflow, including its aggregated metrics and final result. Requires the testRun:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.evaluations.getRun({ workflowId: '2tUt1wbLX592XDdX', runId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |
| `runId` | `string` | Yes | The ID of the test run. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `runAt` | `string \| null \| null` | No | — |
| `completedAt` | `string \| null \| null` | No | — |
| `metrics` | `object \| null` | No | Aggregated metrics collected across the run's test cases. |
| `errorCode` | `string \| null \| null` | No | — |
| `errorDetails` | `object \| null` | No | — |
| `finalResult` | `string \| null \| null` | No | Overall result of the run, derived from its test cases once completed. |
| `testCaseCount` | `number \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

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

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

***

### listCases

`evaluations.listCases`

Retrieve test run cases. Retrieve the per-case results of an evaluation test run. Requires the execution:read project scope. Requires the testRun:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.evaluations.listCases({ workflowId: '2tUt1wbLX592XDdX', runId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `workflowId` | `string` | Yes | The ID of the workflow |
| `runId` | `string` | Yes | The ID of the test run. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | Paginate through test cases by setting the cursor parameter to the nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection. |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   status?: string | null,
>   runAt?: string | null | null,
>   completedAt?: string | null | null,
>   metrics?: {
>   } | null | null,
>   errorCode?: string | null | null,
>   errorDetails?: {
>   } | null | null,
>   inputs?: {
>   } | null | null,
>   outputs?: {
>   } | null | null,
>   executionId?: number | null | null
> }[] | null
> ```

***

### listRuns

`evaluations.listRuns`

Retrieve test runs. Retrieve the evaluation test runs of a workflow. Requires the testRun:list API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.evaluations.listRuns({ workflowId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `workflowId` | `string` | Yes | The ID of the workflow |
| `status` | `new \| running \| completed \| error \| cancelled` | No | Status to filter the test runs by. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | Paginate through test runs by setting the cursor parameter to the nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection. |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   status?: string | null,
>   runAt?: string | null | null,
>   completedAt?: string | null | null,
>   metrics?: {
>   } | null | null,
>   errorCode?: string | null | null,
>   errorDetails?: {
>   } | null | null,
>   finalResult?: string | null | null,
>   testCaseCount?: number | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### startRun

`evaluations.startRun`

Trigger a test run. Start a new evaluation test run for a workflow. The workflow must contain a configured evaluation trigger. The user must also have the workflow:execute project scope. Requires the testRun:create API key scope. Needs a licence with evaluations (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.evaluations.startRun({ workflowId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `workflowId` | `string` | Yes | The ID of the workflow |

**Output**

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

***

## Executions

### delete

`executions.delete`

Delete an execution. Deletes an execution from your instance. Requires the execution:delete API key scope. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.executions.delete({ executionId: 1000 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `executionId` | `number` | Yes | The ID of the execution. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | ID of the deleted execution. This endpoint returns it as a number, where every other execution endpoint returns a string. |
| `finished` | `boolean \| null` | No | Whether the execution ran to completion. Use `status` instead. |
| `mode` | `string \| null` | No | — |
| `retryOf` | `string \| null \| null` | No | ID of the execution this one is a retry of. |
| `retrySuccessId` | `string \| null \| null` | No | ID of the retry that succeeded, if this execution failed and a retry did not. |
| `status` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `startedAt` | `string \| null \| null` | No | Null until the execution leaves the queue and starts running. |
| `stoppedAt` | `string \| null \| null` | No | When the execution stopped. Null for the `new`, `running` and `unknown` statuses; a `waiting` execution has stopped its current run, so it has a value. |
| `deletedAt` | `string \| null \| null` | No | Always null. Soft-deleted executions are not returned. |
| `workflowId` | `string \| null` | No | — |
| `waitTill` | `string \| null \| null` | No | The time at which a waiting execution resumes. |
| `storedAt` | `string \| null` | No | Where the execution data is stored. |
| `tracingContext` | `object \| null` | No | W3C trace context propagated with the execution. |
| `deduplicationKey` | `string \| null \| null` | No | Key used to stop a duplicate execution from being created. |
| `jsonSizeBytes` | `number \| null` | No | Size of the stored execution data in bytes. 0 means unknown. |
| `binaryDataSizeBytes` | `number \| null` | No | Size of the stored binary data in bytes. 0 means unknown. |
| `workflowVersionId` | `string \| null \| null` | No | ID of the workflow version this execution ran. |
| `usedPrivateCredentials` | `boolean \| null` | No | Whether the execution used credentials that are not shared with the project. |

> [accordion] tracingContext full type
>
> ```ts theme={null}
> {
>   traceparent?: string | null,
>   tracestate?: string | null
> } | null | null
> ```

***

### get

`executions.get`

Retrieve an execution. Retrieve an execution from your instance. Requires the execution:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.executions.get({ executionId: 1000 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `executionId` | `number` | Yes | The ID of the execution. |
| `includeData` | `boolean` | No | Whether or not to include the execution's detailed data. |
| `ignoreDataSizeLimit` | `boolean` | No | Whether to return the full execution data even if it exceeds the configured size limit (EXECUTIONS\_DATA\_MAX\_DISPLAY\_SIZE). Oversized executions are otherwise returned without their data. |
| `redactExecutionData` | `boolean` | No | Controls execution data redaction. When `true`, execution output data is always redacted. When `false`, requests unredacted (revealed) data — requires the `execution:reveal` scope. When omitted, follows the workflow redaction policy. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `finished` | `boolean \| null` | No | Whether the execution ran to completion. Use `status` instead. |
| `mode` | `string \| null` | No | — |
| `retryOf` | `string \| null \| null` | No | ID of the execution this one is a retry of. |
| `retrySuccessId` | `string \| null \| null` | No | ID of the retry that succeeded, if this execution failed and a retry did not. |
| `status` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `startedAt` | `string \| null \| null` | No | Null until the execution leaves the queue and starts running. |
| `stoppedAt` | `string \| null \| null` | No | When the execution stopped. Null for the `new`, `running` and `unknown` statuses; a `waiting` execution has stopped its current run, so it has a value. |
| `deletedAt` | `string \| null \| null` | No | Always null. Soft-deleted executions are not returned. |
| `workflowId` | `string \| null` | No | — |
| `waitTill` | `string \| null \| null` | No | The time at which a waiting execution resumes. |
| `storedAt` | `string \| null` | No | Where the execution data is stored. |
| `tracingContext` | `object \| null` | No | W3C trace context propagated with the execution. |
| `deduplicationKey` | `string \| null \| null` | No | Key used to stop a duplicate execution from being created. |
| `jsonSizeBytes` | `number \| null` | No | Size of the stored execution data in bytes. 0 means unknown. |
| `binaryDataSizeBytes` | `number \| null` | No | Size of the stored binary data in bytes. 0 means unknown. |
| `workflowVersionId` | `string \| null \| null` | No | ID of the workflow version this execution ran. |
| `usedPrivateCredentials` | `boolean \| null` | No | Whether the execution used credentials that are not shared with the project. |
| `data` | `object \| null` | No | Detailed execution data. Only included when `includeData` is `true`. |
| `customData` | `Record<string, string> \| null` | No | Execution metadata set by the workflow. Only included when `includeData` is `true`. |
| `workflowData` | `object \| null` | No | The workflow as it was saved when the execution ran. Only included when `includeData` is `true`. Older executions carry more fields than newer ones. |
| `dataTooLargeToDisplay` | `boolean \| null` | No | Present and true when the execution data was larger than `EXECUTIONS_DATA_MAX_DISPLAY_SIZE`. `data` is then empty and `jsonSizeBytes` holds the real size. Use `ignoreDataSizeLimit` to read it anyway. |

> [accordion] tracingContext full type
>
> ```ts theme={null}
> {
>   traceparent?: string | null,
>   tracestate?: string | null
> } | null | null
> ```

> [accordion] data full type
>
> ```ts theme={null}
> {
>   redactionInfo?: {
>     isRedacted?: boolean | null,
>     reason?: string | null,
>     canReveal?: boolean | null
>   } | null | null
> } | null
> ```

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

***

### getTags

`executions.getTags`

Get execution tags. Get annotation tags for an execution. Requires the executionTags:list API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.executions.getTags({ executionId: 1000 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `executionId` | `number` | Yes | The ID of the execution. |

**Output:** `object[]`

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

***

### list

`executions.list`

Retrieve all executions. Retrieve all executions from your instance. Requires the execution:list API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.executions.list({ status: 'error', limit: 20 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `includeData` | `boolean` | No | Whether or not to include the execution's detailed data. |
| `ignoreDataSizeLimit` | `boolean` | No | Whether to return the full execution data even if it exceeds the configured size limit (EXECUTIONS\_DATA\_MAX\_DISPLAY\_SIZE). Oversized executions are otherwise returned without their data. |
| `redactExecutionData` | `boolean` | No | Controls execution data redaction. When `true`, execution output data is always redacted. When `false`, requests unredacted (revealed) data — requires the `execution:reveal` scope. When omitted, follows the workflow redaction policy. |
| `status` | `canceled \| crashed \| error \| new \| running \| success \| unknown \| waiting` | No | Status to filter the executions by. |
| `workflowId` | `string` | No | Workflow to filter the executions by. |
| `projectId` | `string` | No | — |
| `startedAfter` | `string` | No | Only return executions that started after this time. |
| `startedBefore` | `string` | No | Only return executions that started before this time. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | Paginate through executions by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection. |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   finished?: boolean | null,
>   mode?: string | null,
>   retryOf?: string | null | null,
>   retrySuccessId?: string | null | null,
>   status?: string | null,
>   startedAt?: string | null | null,
>   stoppedAt?: string | null | null,
>   workflowId?: string | null,
>   waitTill?: string | null | null,
>   storedAt?: string | null,
>   jsonSizeBytes?: number | null,
>   workflowVersionId?: string | null | null,
>   data?: {
>     redactionInfo?: {
>       isRedacted?: boolean | null,
>       reason?: string | null,
>       canReveal?: boolean | null
>     } | null | null
>   } | null,
>   workflowData?: {
>   } | null,
>   customData?: Record<string, string> | null,
>   dataTooLargeToDisplay?: boolean | null
> }[] | null
> ```

***

### retry

`executions.retry`

Retry an execution. Retry an execution from your instance. Requires the execution:retry API key scope. Runs the failed execution again, with the same side effects as the first run.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.executions.retry({ executionId: 1000 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `executionId` | `number` | Yes | The ID of the execution. |
| `loadWorkflow` | `boolean` | No | Whether to load the currently saved workflow to execute instead of the one saved at the time of the execution. If set to true, it will retry with the latest version of the workflow. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | ID of the new execution that the retry started. |
| `mode` | `string \| null` | No | — |
| `startedAt` | `string \| null \| null` | No | The time at which the new execution started. |
| `workflowId` | `string \| null` | No | — |
| `finished` | `boolean \| null` | No | Whether the execution ran to completion. Use `status` instead. |
| `retryOf` | `string \| null \| null` | No | ID of the execution this one is a retry of. |
| `status` | `string \| null` | No | — |
| `waitTill` | `string \| null \| null` | No | The time at which a waiting execution resumes. |
| `data` | `object \| null` | No | Run data of the new execution. Absent when the API key's user cannot read the executions of the workflow. |
| `workflowData` | `object \| null` | No | The workflow as it was saved when the original execution ran. `loadWorkflow` changes which workflow the retry runs, not what this field reports. Absent when the API key's user cannot read the executions of the workflow. |
| `customData` | `Record<string, string> \| null` | No | Execution metadata carried over from the original execution. Absent when the API key's user cannot read the executions of the workflow. |
| `annotation` | `object \| null` | No | Annotation on the original execution. Absent when it carries none, or when the API key's user cannot read the executions of the workflow. |
| `storedAt` | `string \| null` | No | Where the execution data is stored. |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   redactionInfo?: {
>     isRedacted?: boolean | null,
>     reason?: string | null,
>     canReveal?: boolean | null
>   } | null | null
> } | null
> ```

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

> [accordion] annotation full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   vote?: string | null | null,
>   tags?: {
>     id?: string | null,
>     name?: string | null
>   }[] | null
> } | null
> ```

***

### setTags

`executions.setTags`

Update tags of an execution. Update annotation tags of an execution. Requires the executionTags:update API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.executions.setTags({
	executionId: 1000,
	tags: [{ id: 'doc_8f2k1x9q' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `executionId` | `number` | Yes | The ID of the execution. |
| `tags` | `object[]` | Yes | — |

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   id: string
> }[]
> ```

**Output:** `object[]`

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

***

### stop

`executions.stop`

Stop an execution. Stop an execution by id. Requires the execution:stop API key scope.

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

```ts theme={null}
await corsair.n8n.api.executions.stop({ executionId: 1000 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `executionId` | `number` | Yes | The ID of the execution. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `mode` | `string \| null` | No | — |
| `startedAt` | `string \| null` | No | The time at which the execution started. |
| `stoppedAt` | `string \| null` | No | The time at which the execution stopped. Absent when no stop time was recorded. |
| `finished` | `boolean \| null` | No | Whether the execution ran to completion. Use `status` instead. |
| `status` | `string \| null` | No | — |

***

### stopMany

`executions.stopMany`

Stop multiple executions. Stop multiple executions from your instance based on filter criteria. Requires the execution:stop API key scope.

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

```ts theme={null}
await corsair.n8n.api.executions.stopMany({
	status: ['queued'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `status` | `(queued \| running \| waiting)[]` | Yes | Array of execution statuses to stop. Must include at least one status. |
| `workflowId` | `string` | No | Optional workflow ID to filter executions. If not provided, will stop executions across all accessible workflows. The literal value `all` has the same effect as omitting it. |
| `startedAfter` | `string` | No | Only stop executions that started after this time. |
| `startedBefore` | `string` | No | Only stop executions that started before this time. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `stopped` | `number \| null` | No | The number of executions that were successfully stopped. |

***

## Folders

### create

`folders.create`

Create a folder. Create a folder within a project. Requires the folder:create API key scope. Needs folders in the licence (the free registered Community licence has them): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.folders.create({ projectId: 'VmwOO9HeTEj20kxM', name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `projectId` | `string` | Yes | The ID of the project, or `personal` for the calling user's own personal project. |
| `name` | `string` | Yes | — |
| `parentFolderId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `parentFolderId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### delete

`folders.delete`

Delete a folder. Delete a folder within a project. When transferToFolderId is provided, workflows and sub-folders are moved to the target folder before deletion. When omitted, workflows are moved to the project root and archived, and child folders are deleted. Requires the folder:delete API key scope. Needs folders in the licence (the free registered Community licence has them): without it n8n answers 403. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.folders.delete({ projectId: 'VmwOO9HeTEj20kxM', folderId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | The ID of the project, or `personal` for the calling user's own personal project. |
| `folderId` | `string` | Yes | The ID of the folder. |
| `transferToFolderId` | `string` | No | Optional target folder ID to move workflows and sub-folders into before deleting. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### get

`folders.get`

Get folder details. Get folder details including sub-folder and workflow counts. Requires the folder:read API key scope. Needs folders in the licence (the free registered Community licence has them): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.folders.get({ projectId: 'VmwOO9HeTEj20kxM', folderId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | The ID of the project, or `personal` for the calling user's own personal project. |
| `folderId` | `string` | Yes | The ID of the folder. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `parentFolderId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `totalSubFolders` | `number \| null` | No | Total number of sub-folders (recursive). |
| `totalWorkflows` | `number \| null` | No | Total number of workflows (recursive). |

***

### list

`folders.list`

Retrieve folders. Retrieve folders within a project. Supports filtering, sorting, field selection, and pagination. Requires the folder:list API key scope. Needs folders in the licence (the free registered Community licence has them): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.folders.list({ projectId: 'VmwOO9HeTEj20kxM' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | The ID of the project, or `personal` for the calling user's own personal project. |
| `filter` | `string` | No | JSON-encoded filter object. Supported fields — parentFolderId, name, tags (array of tag names), excludeFolderIdAndDescendants. |
| `select` | `string` | No | JSON-encoded array of fields to include. Valid fields — id, name, createdAt, updatedAt, project, tags, parentFolder, workflowCount, subFolderCount, path. |
| `sortBy` | `name:asc \| name:desc \| createdAt:asc \| createdAt:desc \| updatedAt:asc \| updatedAt:desc` | No | Sort order for results. |
| `skip` | `string` | No | Number of items to skip for pagination. Defaults to 0. |
| `take` | `string` | No | Number of items to return. Defaults to 10. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `count` | `number \| null` | No | Total number of folders matching the query. |
| `data` | `object[] \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   parentFolderId?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   homeProject?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     icon?: {
>       type?: string | null,
>       value?: string | null,
>       color?: string | null
>     } | null | null
>   } | null,
>   parentFolder?: {
>     id?: string | null,
>     name?: string | null,
>     parentFolderId?: string | null | null
>   } | null | null,
>   tags?: {
>     id?: string | null,
>     name?: string | null
>   }[] | null,
>   workflowCount?: number | null,
>   subFolderCount?: number | null,
>   path?: string[] | null
> }[] | null
> ```

***

### update

`folders.update`

Update a folder. Update folder name or parent folder. Requires the folder:update API key scope. Needs folders in the licence (the free registered Community licence has them): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.folders.update({ projectId: 'VmwOO9HeTEj20kxM', folderId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | The ID of the project, or `personal` for the calling user's own personal project. |
| `folderId` | `string` | Yes | The ID of the folder. |
| `name` | `string` | No | — |
| `parentFolderId` | `string` | No | ID of the parent folder to move this folder into. Set to "0" to move the folder to the project root. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `parentFolderId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

## Insights

### getSummary

`insights.getSummary`

Retrieve insights summary. Retrieve the insights summary for the selected date range. Requires the insights:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.insights.getSummary({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `startDate` | `string` | No | ISO 8601 start date. Defaults to 7 days ago. |
| `endDate` | `string` | No | ISO 8601 end date. Defaults to now. |
| `projectId` | `string` | No | Project identifier to filter insights by project. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `total` | `object \| null` | No | — |
| `failed` | `object \| null` | No | — |
| `failureRate` | `object \| null` | No | — |
| `timeSaved` | `object \| null` | No | — |
| `averageRunTime` | `object \| null` | No | — |

> [accordion] total full type
>
> ```ts theme={null}
> {
>   value?: number | null,
>   deviation?: number | null | null,
>   unit?: string | null
> } | null
> ```

> [accordion] failed full type
>
> ```ts theme={null}
> {
>   value?: number | null,
>   deviation?: number | null | null,
>   unit?: string | null
> } | null
> ```

> [accordion] failureRate full type
>
> ```ts theme={null}
> {
>   value?: number | null,
>   deviation?: number | null | null,
>   unit?: string | null
> } | null
> ```

> [accordion] timeSaved full type
>
> ```ts theme={null}
> {
>   value?: number | null,
>   deviation?: number | null | null,
>   unit?: string | null
> } | null
> ```

> [accordion] averageRunTime full type
>
> ```ts theme={null}
> {
>   value?: number | null,
>   deviation?: number | null | null,
>   unit?: string | null
> } | null
> ```

***

## Node Type Policies

### attachments.get

`nodeTypePolicies.attachments.get`

Preview: Retrieve a scope's attached policy documents. Preview — breaking changes may still occur without major version bump. Returns every attached policy document and the scope version. Attachments use evaluation order: floor first, then priority ascending within each group. Use this version when replacing the attachments. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.nodeTypePolicies.attachments.get({ scopeId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `scopeId` | `string` | Yes | The ID of the node type policy scope. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `attachments` | `object[] \| null` | No | — |
| `version` | `number \| null` | No | — |

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   policyId?: string | null,
>   rules?: {
>     id?: string | null,
>     action?: string | null,
>     selector?: {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | null
>   }[] | null,
>   priority?: number | null,
>   isFloor?: boolean | null
> }[] | null
> ```

***

### attachments.replace

`nodeTypePolicies.attachments.replace`

Preview: Replace a scope's attached policy documents. Preview — breaking changes may still occur without major version bump. Replaces every attachment on a scope. scopeId comes from the scope's GET response once it has been written. Each policyId and each (isFloor, priority) pair must be unique within the list. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.nodeTypePolicies.attachments.replace({
	scopeId: 'example',
	attachments: [{ policyId: 'example', priority: 1, isFloor: true }],
	version: 1,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `scopeId` | `string` | Yes | The ID of the node type policy scope. |
| `attachments` | `object[]` | Yes | — |
| `version` | `number` | Yes | — |

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   policyId: string,
>   priority: number,
>   isFloor: boolean
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `attachments` | `object[] \| null` | No | — |
| `version` | `number \| null` | No | — |

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   policyId?: string | null,
>   rules?: {
>     id?: string | null,
>     action?: string | null,
>     selector?: {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | null
>   }[] | null,
>   priority?: number | null,
>   isFloor?: boolean | null
> }[] | null
> ```

***

### documents.create

`nodeTypePolicies.documents.create`

Preview: Create a node type policy document. Preview — breaking changes may still occur without major version bump. Creates a reusable policy document that is not yet attached to any scope. Rule ids must be unique within the list. warnings lists rules that an earlier rule already shadows. Requires the nodeTypePolicy:manage API key scope. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.nodeTypePolicies.documents.create({
	rules: [{
		id: 'doc_8f2k1x9q',
		action: 'allow',
		selector: { kind: 'name', value: 'example' },
	}],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `rules` | `object[]` | Yes | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id: string,
>   action: allow | deny | delegate,
>   selector: {
>     kind: name,
>     value: string
>   } | {
>     kind: package,
>     value: string
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `policy` | `object \| null` | No | — |
| `warnings` | `object[] \| null` | No | — |

> [accordion] policy full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   kind?: string | null,
>   rules?: {
>     id?: string | null,
>     action?: string | null,
>     selector?: {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | null
>   }[] | null,
>   version?: number | null,
>   updatedBy?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] warnings full type
>
> ```ts theme={null}
> (
>   {
>     kind?: string | null,
>     ruleId?: string | null,
>     shadowedByRuleId?: string | null
>   } | {
>     kind?: string | null,
>     ruleId?: string | null
>   }
> )[] | null
> ```

***

### documents.delete

`nodeTypePolicies.documents.delete`

Preview: Delete a node type policy document. Preview — breaking changes may still occur without major version bump. Deletes a policy document. A document that is still attached to a scope is rejected with 409; detach it first. Requires the nodeTypePolicy:manage API key scope. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.nodeTypePolicies.documents.delete({ policyId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `policyId` | `string` | Yes | The ID of the node type policy document. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### documents.get

`nodeTypePolicies.documents.get`

Preview: Retrieve a node type policy document. Preview — breaking changes may still occur without major version bump. Requires the nodeTypePolicy:manage API key scope. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.nodeTypePolicies.documents.get({ policyId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `policyId` | `string` | Yes | The ID of the node type policy document. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `kind` | `string \| null` | No | — |
| `rules` | `object[] \| null` | No | — |
| `version` | `number \| null` | No | — |
| `updatedBy` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   action?: string | null,
>   selector?: {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | null
> }[] | null
> ```

***

### documents.list

`nodeTypePolicies.documents.list`

Preview: List node type policy documents. Preview — breaking changes may still occur without major version bump. Returns a cursor-paginated list of reusable policy documents. Requires the nodeTypePolicy:manage API key scope. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.nodeTypePolicies.documents.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   kind?: string | null,
>   rules?: {
>     id?: string | null,
>     action?: string | null,
>     selector?: {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | null
>   }[] | null,
>   version?: number | null,
>   updatedBy?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### documents.update

`nodeTypePolicies.documents.update`

Preview: Replace the rules of a node type policy document. Preview — breaking changes may still occur without major version bump. Replaces the document's whole rule list. version must equal the version last read; a stale value is rejected with 409. Every scope the document is attached to has its version bumped. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.nodeTypePolicies.documents.update({
	policyId: 'example',
	rules: [{
		id: 'doc_8f2k1x9q',
		action: 'allow',
		selector: { kind: 'name', value: 'example' },
	}],
	version: 1,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `policyId` | `string` | Yes | The ID of the node type policy document. |
| `rules` | `object[]` | Yes | — |
| `version` | `number` | Yes | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id: string,
>   action: allow | deny | delegate,
>   selector: {
>     kind: name,
>     value: string
>   } | {
>     kind: package,
>     value: string
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `policy` | `object \| null` | No | — |
| `warnings` | `object[] \| null` | No | — |

> [accordion] policy full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   kind?: string | null,
>   rules?: {
>     id?: string | null,
>     action?: string | null,
>     selector?: {
>       kind?: string | null,
>       value?: string | null
>     } | {
>       kind?: string | null,
>       value?: string | null
>     } | null
>   }[] | null,
>   version?: number | null,
>   updatedBy?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] warnings full type
>
> ```ts theme={null}
> (
>   {
>     kind?: string | null,
>     ruleId?: string | null,
>     shadowedByRuleId?: string | null
>   } | {
>     kind?: string | null,
>     ruleId?: string | null
>   }
> )[] | null
> ```

***

### getInstance

`nodeTypePolicies.getInstance`

Preview: Retrieve the instance node type policy. Preview — breaking changes may still occur without major version bump. Returns the composed instance-scope policy: its default action and the rules of every attached policy document in evaluation order. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.nodeTypePolicies.getInstance({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `scopeId` | `string \| null \| null` | No | — |
| `rules` | `object[] \| null` | No | — |
| `defaultAction` | `string \| null` | No | — |
| `version` | `number \| null` | No | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   action?: string | null,
>   selector?: {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | null
> }[] | null
> ```

***

### getProject

`nodeTypePolicies.getProject`

Preview: Retrieve a project's node type policy. Preview — breaking changes may still occur without major version bump. Returns the project's own composed policy, not the result of combining it with the instance policy. A project that was never configured reports scopeId: null, no rules, defaultAction: allow, and version: 0. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.nodeTypePolicies.getProject({ projectId: 'VmwOO9HeTEj20kxM' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | The ID of the project. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `scopeId` | `string \| null \| null` | No | — |
| `rules` | `object[] \| null` | No | — |
| `defaultAction` | `string \| null` | No | — |
| `version` | `number \| null` | No | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   action?: string | null,
>   selector?: {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | null
> }[] | null
> ```

***

### setInstance

`nodeTypePolicies.setInstance`

Preview: Replace the instance node type policy. Preview — breaking changes may still occur without major version bump. Sets the instance default action and replaces the rules of its single policy document, creating both on first write. version must equal the version last read; a stale value is rejected with 409. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.nodeTypePolicies.setInstance({
	rules: [{
		id: 'doc_8f2k1x9q',
		action: 'allow',
		selector: { kind: 'name', value: 'example' },
	}],
	defaultAction: 'allow',
	version: 1,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `rules` | `object[]` | Yes | — |
| `defaultAction` | `allow \| deny \| delegate` | Yes | — |
| `version` | `number` | Yes | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id: string,
>   action: allow | deny | delegate,
>   selector: {
>     kind: name,
>     value: string
>   } | {
>     kind: package,
>     value: string
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `scopeId` | `string \| null \| null` | No | — |
| `rules` | `object[] \| null` | No | — |
| `defaultAction` | `string \| null` | No | — |
| `version` | `number \| null` | No | — |
| `warnings` | `object[] \| null` | No | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   action?: string | null,
>   selector?: {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | null
> }[] | null
> ```

> [accordion] warnings full type
>
> ```ts theme={null}
> (
>   {
>     kind?: string | null,
>     ruleId?: string | null,
>     shadowedByRuleId?: string | null
>   } | {
>     kind?: string | null,
>     ruleId?: string | null
>   }
> )[] | null
> ```

***

### setProject

`nodeTypePolicies.setProject`

Preview: Replace a project's node type policy. Preview — breaking changes may still occur without major version bump. Sets the project's default action and replaces the rules of its single policy document, creating both on first write. Only a team project can have a policy; a personal project is rejected with 400. Needs a licence with feat:typeAvailabilityPolicies (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.nodeTypePolicies.setProject({
	projectId: 'VmwOO9HeTEj20kxM',
	rules: [{
		id: 'doc_8f2k1x9q',
		action: 'allow',
		selector: { kind: 'name', value: 'example' },
	}],
	defaultAction: 'allow',
	version: 1,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | The ID of the project. |
| `rules` | `object[]` | Yes | — |
| `defaultAction` | `allow \| deny` | Yes | — |
| `version` | `number` | Yes | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id: string,
>   action: allow | deny,
>   selector: {
>     kind: name,
>     value: string
>   } | {
>     kind: package,
>     value: string
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `scopeId` | `string \| null \| null` | No | — |
| `rules` | `object[] \| null` | No | — |
| `defaultAction` | `string \| null` | No | — |
| `version` | `number \| null` | No | — |
| `warnings` | `object[] \| null` | No | — |

> [accordion] rules full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   action?: string | null,
>   selector?: {
>     kind?: string | null,
>     value?: string | null
>   } | {
>     kind?: string | null,
>     value?: string | null
>   } | null
> }[] | null
> ```

> [accordion] warnings full type
>
> ```ts theme={null}
> (
>   {
>     kind?: string | null,
>     ruleId?: string | null,
>     shadowedByRuleId?: string | null
>   } | {
>     kind?: string | null,
>     ruleId?: string | null
>   }
> )[] | null
> ```

***

## Packages

### export

`packages.export`

Beta: Export agents, workflows, folders, or projects as an n8n package. Beta — breaking changes may still occur without major version bump. Export agents, workflows, and folders, or whole projects, as a gzipped tar archive (.n8np). Provide agentIds/workflowIds/folderIds, or projectIds. Do not combine these two groups. Each exported folder includes its nested folders. Returns a .n8np package (gzip) of the chosen workflows, credentials and data tables.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.packages.export({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `agentIds` | `string[]` | No | IDs of the agents to include. Requires the agents module. |
| `workflowIds` | `string[]` | No | IDs of the workflows to include in the exported package. |
| `folderIds` | `string[]` | No | IDs of the folders to include in the exported package. Each folder is exported with its nested folders. |
| `projectIds` | `string[]` | No | IDs of the projects to include in the exported package. Includes their agents when the agents module is enabled. |
| `includeVariableValues` | `boolean` | No | Whether values of variables referenced by the exported entities are bundled into the package. When `false`, variables still travel as name/type files and are listed in the package requirements, but no values travel with the package. |
| `includeTags` | `boolean` | No | Whether tags assigned to the exported workflows are bundled into the package. When `false`, no tag files, tag references, or tag requirements travel with the package. |
| `dependencyPolicy` | `fail \| reference-only \| include-in-package` | No | Policy for workflow and agent dependencies outside the selected package contents. Includes static workflow references and disabled agent references. `fail` aborts when a required workflow or agent is absent from the package. `include-in-package` adds accessible dependencies recursively. `reference-only` records external requirements without including those definitions. The same policy applies to workflows and agents. |
| `versionPolicy` | `published-strict \| prefer-published \| ignore-unpublished \| latest` | No | Which version of each workflow and agent travels in the package. `latest` exports the current draft. `published-strict` requires a published version. `prefer-published` uses the published version when available and the draft otherwise. `ignore-unpublished` skips unpublished selections. Dependencies that cannot be included cause the export to fail only when `dependencyPolicy` is `fail` or `include-in-package`. With `reference-only`, the export records them as external requirements. The selected version supplies the definition and its references. Workflow names, settings, and tags always use their current values. Agent IDs, names, and MCP availability always use their current values. Skills have no published versions. The package always contains the latest saved version of each skill, also under `published-strict`. The package does not pin skill versions. |
| `credentialExportPolicy` | `expression-values-only \| no-values` | No | Whether expression values from credential data are bundled into the package. `expression-values-only` includes credential fields whose value is an n8n expression (for example `={{ $secrets.apiKey }}`). A literal value travels only when it decides whether another credential field shows (a toggle or an auth type, for example) and an exported expression sits in that field. No other literal value travels. `no-values` keeps credential data out of the package entirely, so each credential file carries only its id, name and type. |
| `includeArchived` | `boolean` | No | Whether folder exports include archived workflows and project exports include archived workflows and agents. When `false` (default) they are left out. When `true` they travel with `isArchived: true` and are archived on import. Workflows listed in `workflowIds` and agents listed in `agentIds` always export, also when archived. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contentBase64` | `string` | No | The file, base64-encoded. Missing when the file came back as text or contentOmitted is set. |
| `text` | `string` | No | The file as text, in place of contentBase64, when it is a text file (CSV, JSON, Markdown, XML and the like) in UTF-8. |
| `contentType` | `string` | Yes | Media type of the file, for example application/pdf. |
| `byteLength` | `number` | Yes | Size of the file in bytes. |
| `filename` | `string` | No | The file name, when known. |
| `contentOmitted` | `not_requested \| over_limit` | No | Set when the content was left out: the caller did not ask for it, or the file was over the limit. |
| `fileId` | `string` | No | Where the host saved the file. Over the limit it comes in place of the content; a host that keeps every file sets it beside the content too. On Corsair it is a Files id (fil\_…): pass it to another app wherever that app takes a file URL, or read a text file or PDF with files.read\_text. |

***

### import

`packages.import`

Beta: Import an n8n package into a project. Beta — breaking changes may still occur without major version bump. Imports Agent-only, workflow-only, mixed, and whole-project packages. The Agents module must be active for packages that contain Agents. Send the gzip-compressed tar archive (.n8np) as the multipart field package.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.packages.import({
	package: { base64: 'SGVsbG8gZnJvbSBDb3JzYWly', filename: 'notes.txt', contentType: 'text/plain' },
	conflictPolicy: 'new-version',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `package` | `string \| object \| custom` | Yes | Gzip-compressed tar package (`.n8np`). |
| `projectId` | `string` | No | Target project id. Omit or send empty to import into the caller's personal project. |
| `folderId` | `string` | No | Optional folder within the target project. Omit or send empty for project root. |
| `credentialMatchingMode` | `id-only \| name-and-type \| type-only` | No | How credential references in `requirements.credentials` are matched on the target instance. `id-only` (default) matches by id. `name-and-type` matches credentials with the exact same name and type. `type-only` matches any credential of the same type. For `name-and-type` and `type-only`, candidates are ranked by scope — a credential owned by the target project wins over one merely shared into it, which in turn wins over a global credential; if several candidates remain in the winning scope, the most recently updated one is chosen. |
| `credentialMissingMode` | `must-preexist \| create-stub \| create-with-values` | No | What to do when a credential reference cannot be resolved. `create-stub` (default) creates empty credential placeholders in the target project for missing references. `create-with-values` also creates them, seeded from the expression data bundled in the package (see the export option `credentialExportPolicy`); a reference the package carries no data for falls back to an empty stub. A credential created with package data is listed under `credentials.seeded` when the package confirms that all source data was retained. Otherwise, also when the package has no completeness flag, it is listed under `credentials.incomplete` and blocks workflow publishing with `incomplete-credential`. `create-stub` and `create-with-values` require the `credential:create` scope when the import creates a credential. `must-preexist` requires every referenced credential to already exist. |
| `credentialConflictPolicy` | `keep-existing \| overwrite \| fail` | No | What to do when a credential reference matches an existing credential and the package has different values for it. `keep-existing` (default) never changes a matched credential. `overwrite` writes the package name and the expression values from the package to a matched credential that a project of the import owns. It keeps all other stored values: secrets, other fields, the OAuth connection, and array fields. It never changes a global credential that a different project owns, or a managed, end-user (resolvable) or instance-level credential. The import lists the source ids of changed credentials under `credentials.updated`. An API key needs the `credential:update` scope when the import changes a credential. `fail` rejects the import with a 409 (`credential-conflict`) when `overwrite` would change a matched credential. Every policy leaves a matched credential alone when the package values are the same as the stored values. `overwrite` and `fail` compare stored values, so they need the `credential:update` permission on each matched credential that a project of the import owns, also when it would not change. Without it, the import is rejected with `credential-update-forbidden`. |
| `bindings` | `string` | No | Optional JSON object of explicit source→target id bindings, keyed by entity type. Only `credentials` is supported today: send `{"credentials":{"<packageCredentialId>":"<targetCredentialId>"}}` to map credential ids from the package to credential ids on the target instance. These explicit bindings are validated on type and applied before `credentialMatchingMode` resolution runs. |
| `conflictPolicy` | `new-version \| fail \| skip` | Yes | Applies to Agents, workflows and the skills of imported Agents. `new-version` replaces matched definitions and saves a changed skill as a new version. `fail` rejects the import when an Agent or workflow matches, or when a matched skill has other content. A matched skill with the same content is kept. `skip` leaves matched definitions and skills unchanged. All policies create entities and skills that have no match. A new version of a project or instance skill applies to all Agents on the instance that follow the skill, also Agents that are not in the package. A skill conflict under `fail` is an `agent-invalid` issue, so it returns 422. Matched workflows also follow the package archive state under `new-version`; this change needs `workflow:delete`. This required field replaces `workflowConflictPolicy`. The old field is rejected. |
| `publishingPolicy` | `preserve-published-state \| match-source \| publish-all \| unpublish-all` | No | Controls publication of imported Agents and workflows after definitions are saved. `preserve-published-state` (default) keeps new entities unpublished. It republishes an updated entity only if it was published and the package contains the version published at the source. `match-source` publishes the imported definition when the source publishes it. It unpublishes the destination when the source has no published version. Both policies leave publication unchanged when the source publishes a version absent from the package. `publish-all` requests publication of imported entities. `unpublish-all` leaves new entities unpublished and unpublishes updated entities. Skipped entities remain unchanged. Archived workflows remain unpublished. Publication failures do not undo saved definitions. Only the Agent revision saved by the import can be published or unpublished. This field replaces `workflowPublishingPolicy` and `agentPublishingPolicy`. The old fields are rejected. |
| `idPolicy` | `source` | No | Controls IDs for newly created Agents and workflows. Only `source` is supported. It uses the package ID. An ID already used by an unmatched Agent or workflow, in any project, blocks the import. Matched entities keep their destination ID. Agent and workflow identity maps remain separate. This field replaces `workflowIdPolicy` and `agentIdPolicy`. The old fields are rejected. |
| `missingNodeTypeMode` | `fail \| import-anyway` | No | Controls missing node types and versions in workflow nodes and Agent node tools. `fail` (default) rejects the import before writes. The issues identify the affected consumers. `import-anyway` saves the definitions but blocks their publication. This applies to both Agents and workflows. |
| `projectConflictPolicy` | `merge \| fail \| overwrite` | No | What to do when a project the package defines already exists here (matched by id), and — unless `folderConflictPolicy` overrides it — how its contents are treated. `merge` (default) leaves the existing project's name, description, icon and custom span attributes untouched and adds the package's contents alongside. `overwrite` replaces those details with the package's; a detail the package omits is left as it is, not cleared. `fail` rejects the import before anything is written, with one `project-conflict` issue per existing project. A package project id belonging to a personal project, or to a team project the caller cannot update, always rejects the import. A new project needs the `project:create` scope. `overwrite` needs `project:update` only when it changes a detail. Ignored for workflow packages. |
| `folderConflictPolicy` | `merge \| fail \| overwrite` | No | What to do when a package folder already exists at the same position in the target project. Defaults to whatever `projectConflictPolicy` is, so the intent is stated once; a workflow package defines no projects, so it defaults to `merge` there. `merge` reuses the existing folder and merges the package's children into it. `fail` rejects the import. `overwrite` reuses folders as `merge` does and additionally removes workflows the package does not contain — at a project's root and in folders the package defines, leaving target-only folders and their contents alone. Folders it does not define are then removed too, but only once nothing is left inside them. Removals are listed under `removedWorkflows` and `removedFolders`; see `overwriteDeletionPolicy`. A folder whose id sits under a different parent, or belongs to another project, always blocks the import. `overwrite` is project-packages-only. When it removes a workflow, it needs the `workflow:delete` scope. When it removes a folder, it needs `folder:delete`. It is rejected against a `projectConflictPolicy` other than `overwrite`, and blocks up front if the caller cannot delete something it would remove. The import needs the `folder:create` scope only when it creates a folder, and a folders-enabled license only when it creates, changes or removes a folder. |
| `overwriteDeletionPolicy` | `archive \| hard-delete` | No | How `folderConflictPolicy=overwrite` removes a workflow the package does not contain. `archive` (default) archives it, so it stays recoverable along with its execution history. `hard-delete` archives it — the step that unpublishes it, which a delete will not do on its own — and then deletes the workflow and its executions permanently. Each entry in `removedWorkflows` reports what actually happened in its `deletion` field: a `hard-delete` whose row cannot be dropped yet, because unpublishing defers trigger teardown, is left `archived` rather than failing an import whose content is already written. Ignored unless `folderConflictPolicy` is `overwrite`. |
| `dataTableMatchingMode` | `by-id` | No | How data tables referenced by the package's workflows are matched against the target project. `by-id` matches the target-project table with the same id (imported tables keep their source id) and never falls back to name matching, so a match survives a rename on the target. Currently the only mode. |
| `dataTableMissingMode` | `create \| must-preexist \| do-nothing` | No | Controls what happens when a referenced data table has no match in the target project. `create` (default) creates it from the package schema, keeping the source id, with no rows. It requires the `dataTable:create` scope only when it creates a table. A table that already exists needs no scope. `must-preexist` rejects the import. `do-nothing` skips creation of missing tables. Under the `keep-existing`, `fail`, and `overwrite-non-destructive` schema conflict policies, matched tables are still validated for schema compatibility and can still block the import. The import never imports table rows. Matched tables change only under `dataTableSchemaConflictPolicy=overwrite` or `overwrite-non-destructive`, which keep their rows. |
| `dataTableSchemaConflictPolicy` | `keep-existing \| fail \| overwrite \| overwrite-non-destructive` | No | How strictly a matched data table's schema is compared. `keep-existing` (default) accepts a target table that has every package column with the same name and type. The target table can have extra columns. `fail` rejects any difference, including target-only columns. Under `keep-existing` and `fail`, a missing package column or a type mismatch rejects the import, and the target table does not change. `overwrite` changes the matched target table to match the package. It can remove or retype columns. The values in those columns are removed. Rows and other columns are kept. When the package has column ids, a column that is only renamed keeps its values. The changes apply to all workflows that use the table. A blocked `keep-existing`, `fail`, or `overwrite-non-destructive` import lists them in `overwriteChanges`. Requires the `dataTable:update` scope only when a matched table changes. `overwrite-non-destructive` makes the same changes as `overwrite`, but rejects the import and writes nothing when a change removes or retypes a column. A target-only column counts as removed. |
| `variableMissingMode` | `do-nothing \| must-preexist \| create-stub \| create-with-value` | No | Controls what happens when a variable referenced by the package's workflows is absent from the target project and the global scope (lookup order: project, then global). `create-with-value` (default) creates the variable with its package value and lists its name under `variables.created`. When the package carries no value for it — values were excluded at export, or the exported value was itself empty — it creates an empty stub listed under `variables.stubbed`. `do-nothing` imports without creating the variable and lists its name under `variables.missing`. `must-preexist` rejects the import unless every referenced variable already resolves. `create-stub` creates each missing variable with an empty value at the placement scope (see `variableParentPolicy`) and lists the created names under `variables.stubbed`. An import that actually creates a variable requires a license that permits variables and, for API key callers, the `variable:create` scope; a package whose variables all already resolve creates nothing and needs neither. |
| `variableConflictPolicy` | `keep-existing \| overwrite \| fail` | No | What to do when a referenced variable resolves in the target project or global scope but the package bundles a *different* value for it. `keep-existing` (default) leaves the target value untouched and reports the name under `variables.matched`. `overwrite` silently replaces the value of the existing variable at whichever scope it was found — the target project or the global scope, so a global variable other projects also read can be rewritten by this import — and reports the name under `variables.updated`; it needs a license that permits variables, the `variable:update` / `projectVariable:update` permission on that scope, and, for API key callers, the `variable:update` scope. `fail` rejects the import with a 409 instead. Every policy leaves a resolved variable alone when there is nothing to change — either the package bundles no value for it (values were excluded at export, or the exported value was itself empty), or the value it bundles already matches the target's. The reverse does not hold: a resolved variable holding an empty value — a stub an earlier import created, say — still counts as a value, so `overwrite` fills it and `fail` rejects it. Under `overwrite`, a project package whose projects hold *different* values for a name they all resolve to one row — a global none of them shadows, typically — is rejected with a 409: one row cannot carry both values, and the import will not pick for you. Give the projects their own variables in the target, or import them separately. |
| `variableParentPolicy` | `project \| global` | No | Where `create-with-value` and `create-stub` create missing variables for workflow/folder packages. `project` — also the behaviour when the field is omitted — creates them in the import target project (`projectId`, else the caller's personal project). `global` creates them at the global scope. The license and `variable:create` requirements described under `variableMissingMode` apply to both placements. Must be omitted for project packages, which reject it with a 400: their placement follows the package layout, where a variable bundled under a project is created in that project and one bundled at the top level is created globally. |
| `tagMissingMode` | `create \| do-nothing` | No | What to do when a tag referenced by the package's workflows has no tag with the same id on the target instance (tags are matched by source id, never by name). `create` (default) creates the tag globally with its package (source) id and name; when the import would create a tag this needs an API key carrying the `tag:create` scope. `do-nothing` imports the workflows without the missing tags — nothing is created and the dropped names are listed under `tags.skipped`. |
| `tagConflictPolicy` | `skip \| fail \| rename` | No | What to do when a referenced tag conflicts on the target instance — either the same-id target tag carries a different name (rename drift), or the tag's name is already held by a different tag (name collision). `skip` (default) drops the conflicted tags from the import (not created, not renamed, not attached anywhere; the import proceeds and lists them under `tags.skipped`). `fail` rejects the import with a 409. `rename` renames a drifted target tag to the package name, and reconciles a name collision by re-keying the existing tag to the package (source) id — its name, workflow and folder taggings follow; both need an API key carrying the `tag:update` scope when the import would rename or reconcile a tag. A drifted tag whose package name is held by another tag still rejects the import (rename degrades to fail). |

> [accordion] package full type
>
> ```ts theme={null}
> string | {
>   url: string,
>   filename?: string,
>   contentType?: string
> } | {
>   base64: string,
>   filename?: string,
>   contentType?: string
> } | custom
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `package` | `object \| null` | No | — |
| `agents` | `object[] \| null` | No | — |
| `counts` | `object \| null` | No | — |
| `workflows` | `object[] \| null` | No | — |
| `removedWorkflows` | `object[] \| null` | No | Workflows removed from the target during this import. |
| `removedFolders` | `object[] \| null` | No | Folders the package does not define that reconciliation left empty, removed by `folderConflictPolicy=overwrite`. A folder still holding anything survives, so target-only content is never swept up. Empty under every other policy. |
| `folders` | `object[] \| null` | No | Folder shells created or skipped in the target project. |
| `projects` | `object[] \| null` | No | Project shells created, or matched and then updated or left as-is (see `projectConflictPolicy`). Present for project packages; empty when importing loose workflows/folders. |
| `bindings` | `object \| null` | No | Source id → target id mappings produced during import, one map per entity type. Each value maps an id as it appeared in the package to the id on the target instance. |
| `credentials` | `object \| null` | No | Source credential ids grouped by whether they matched an existing credential, were created as empty stubs, seeded credentials, or incomplete credentials, or matched a credential that this import updated. Full source→target id mapping is in `bindings.credentials`. |
| `dataTables` | `object \| null` | No | — |
| `variables` | `object \| null` | No | Resolution of the package's variable requirements. Names only — values never travel in the response. For project packages these arrays are package-level unions of per-destination outcomes and may overlap (for example, a name may be created with a value in one project and stubbed in another); classification under concurrent external writes is best-effort. |
| `tags` | `object \| null` | No | Resolution of the tags referenced by the imported workflows, matched by source id. Tag names only. |

> [accordion] package full type
>
> ```ts theme={null}
> {
>   sourceN8nVersion?: string | null,
>   sourceId?: string | null
> } | null
> ```

> [accordion] agents full type
>
> ```ts theme={null}
> {
>   sourceAgentId?: string | null,
>   localId?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   activeVersionId?: string | null | null,
>   status?: string | null,
>   publishing?: {
>     state?: string | null,
>     error?: string | null,
>     blockedReason?: string | null,
>     skippedPublishReason?: string | null
>   } | null,
>   channels?: (
>     {
>       type?: string | null,
>       status?: string | null
>     } | {
>       type?: string | null,
>       status?: string | null,
>       reason?: string | null,
>       setupUrl?: string | null
>     }
>   )[] | null
> }[] | null
> ```

> [accordion] counts full type
>
> ```ts theme={null}
> {
>   agents?: {
>     created?: number | null,
>     updated?: number | null,
>     skipped?: number | null
>   } | null
> } | null
> ```

> [accordion] workflows full type
>
> ```ts theme={null}
> {
>   sourceWorkflowId?: string | null,
>   localId?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   parentFolderId?: string | null | null,
>   activeVersionId?: string | null | null,
>   isArchived?: boolean | null,
>   publishing?: {
>     state?: string | null,
>     error?: string | null,
>     blockedReason?: string | null,
>     skippedPublishReason?: string | null
>   } | null,
>   status?: string | null
> }[] | null
> ```

> [accordion] removedWorkflows full type
>
> ```ts theme={null}
> {
>   workflowId?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   parentFolderId?: string | null | null,
>   deletion?: string | null
> }[] | null
> ```

> [accordion] removedFolders full type
>
> ```ts theme={null}
> {
>   folderId?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   parentFolderId?: string | null | null
> }[] | null
> ```

> [accordion] folders full type
>
> ```ts theme={null}
> {
>   sourceFolderId?: string | null,
>   localId?: string | null,
>   name?: string | null,
>   parentFolderId?: string | null | null,
>   status?: string | null
> }[] | null
> ```

> [accordion] projects full type
>
> ```ts theme={null}
> {
>   sourceProjectId?: string | null,
>   localId?: string | null,
>   name?: string | null,
>   status?: string | null
> }[] | null
> ```

> [accordion] bindings full type
>
> ```ts theme={null}
> {
>   agents?: Record<string, string> | null,
>   workflows?: Record<string, string> | null,
>   credentials?: Record<string, string> | null
> } | null
> ```

> [accordion] credentials full type
>
> ```ts theme={null}
> {
>   matched?: string[] | null,
>   stubbed?: string[] | null,
>   seeded?: string[] | null,
>   incomplete?: string[] | null,
>   updated?: string[] | null
> } | null
> ```

> [accordion] dataTables full type
>
> ```ts theme={null}
> {
>   matched?: number | null,
>   created?: number | null,
>   updated?: number | null
> } | null
> ```

> [accordion] variables full type
>
> ```ts theme={null}
> {
>   matched?: string[] | null,
>   missing?: string[] | null,
>   created?: string[] | null,
>   stubbed?: string[] | null,
>   updated?: string[] | null
> } | null
> ```

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   matched?: string[] | null,
>   created?: string[] | null,
>   renamed?: string[] | null,
>   reconciled?: string[] | null,
>   skipped?: string[] | null
> } | null
> ```

***

### importSelection

`packages.importSelection`

Beta: Import a selected subset of workflows from an n8n package. Beta — breaking changes may still occur without major version bump. Imports a chosen subset of workflows from one source project of a gzip-compressed tar package (.n8np), instead of the whole package. Send the archive as the multipart field package.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.packages.importSelection({
	package: { base64: 'SGVsbG8gZnJvbSBDb3JzYWly', filename: 'notes.txt', contentType: 'text/plain' },
	selectedProjectId: 'example',
	selectedWorkflowIds: 'example',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `package` | `string \| object \| custom` | Yes | Gzip-compressed tar package (`.n8np`). |
| `selectedProjectId` | `string` | Yes | Id of the single source project the selection is scoped to, as it appears in the package. |
| `selectedWorkflowIds` | `string` | Yes | JSON-encoded array of source workflow ids to import from `selectedProjectId`, e.g. `["wf-1","wf-2"]`. An empty array (`[]`) is allowed — useful for a delete-only request. Ids outside the scoped project are dropped. |
| `deletedWorkflowIds` | `string` | No | Optional JSON-encoded array of destination workflow ids to remove from the scoped project, e.g. `["wf-3"]`. Removal happens even under the additive profile, and the manner of removal follows `overwriteDeletionPolicy` (archive by default). An absent id is a no-op unless it is also a selected destination. Must not contain a selected workflow's destination id. Needs the `workflow:delete` scope. |
| `conflictPolicy` | `new-version \| fail \| skip` | No | What happens when a selected workflow matches an existing workflow by source id in the target project. `new-version` (default) updates it and creates a new version; `fail` rejects the import when any matching workflow exists; `skip` leaves matching workflows unchanged. An archive state change also needs the `workflow:delete` scope. |
| `idPolicy` | `source` | No | Controls IDs for newly created workflows. Only `source` is supported. It uses the package ID. An ID already used by an unmatched workflow, in any project, blocks the import. Matched workflows keep their destination ID. |
| `overwriteDeletionPolicy` | `archive \| hard-delete` | No | How the ids in `deletedWorkflowIds` are removed. `archive` (default) archives each one, so it stays recoverable along with its execution history. `hard-delete` archives it — the step that unpublishes it, which a delete will not do on its own — and then deletes the workflow and its executions permanently. Each entry in `removedWorkflows` reports what actually happened in its `deletion` field: a `hard-delete` whose row cannot be dropped yet, because unpublishing defers trigger teardown, is left `archived` rather than failing an import whose content is already written. |

> [accordion] package full type
>
> ```ts theme={null}
> string | {
>   url: string,
>   filename?: string,
>   contentType?: string
> } | {
>   base64: string,
>   filename?: string,
>   contentType?: string
> } | custom
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `package` | `object \| null` | No | — |
| `agents` | `object[] \| null` | No | — |
| `counts` | `object \| null` | No | — |
| `workflows` | `object[] \| null` | No | — |
| `removedWorkflows` | `object[] \| null` | No | Workflows removed from the target during this import. |
| `removedFolders` | `object[] \| null` | No | Folders the package does not define that reconciliation left empty, removed by `folderConflictPolicy=overwrite`. A folder still holding anything survives, so target-only content is never swept up. Empty under every other policy. |
| `folders` | `object[] \| null` | No | Folder shells created or skipped in the target project. |
| `projects` | `object[] \| null` | No | Project shells created, or matched and then updated or left as-is (see `projectConflictPolicy`). Present for project packages; empty when importing loose workflows/folders. |
| `bindings` | `object \| null` | No | Source id → target id mappings produced during import, one map per entity type. Each value maps an id as it appeared in the package to the id on the target instance. |
| `credentials` | `object \| null` | No | Source credential ids grouped by whether they matched an existing credential, were created as empty stubs, seeded credentials, or incomplete credentials, or matched a credential that this import updated. Full source→target id mapping is in `bindings.credentials`. |
| `dataTables` | `object \| null` | No | — |
| `variables` | `object \| null` | No | Resolution of the package's variable requirements. Names only — values never travel in the response. For project packages these arrays are package-level unions of per-destination outcomes and may overlap (for example, a name may be created with a value in one project and stubbed in another); classification under concurrent external writes is best-effort. |
| `tags` | `object \| null` | No | Resolution of the tags referenced by the imported workflows, matched by source id. Tag names only. |

> [accordion] package full type
>
> ```ts theme={null}
> {
>   sourceN8nVersion?: string | null,
>   sourceId?: string | null
> } | null
> ```

> [accordion] agents full type
>
> ```ts theme={null}
> {
>   sourceAgentId?: string | null,
>   localId?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   activeVersionId?: string | null | null,
>   status?: string | null,
>   publishing?: {
>     state?: string | null,
>     error?: string | null,
>     blockedReason?: string | null,
>     skippedPublishReason?: string | null
>   } | null,
>   channels?: (
>     {
>       type?: string | null,
>       status?: string | null
>     } | {
>       type?: string | null,
>       status?: string | null,
>       reason?: string | null,
>       setupUrl?: string | null
>     }
>   )[] | null
> }[] | null
> ```

> [accordion] counts full type
>
> ```ts theme={null}
> {
>   agents?: {
>     created?: number | null,
>     updated?: number | null,
>     skipped?: number | null
>   } | null
> } | null
> ```

> [accordion] workflows full type
>
> ```ts theme={null}
> {
>   sourceWorkflowId?: string | null,
>   localId?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   parentFolderId?: string | null | null,
>   activeVersionId?: string | null | null,
>   isArchived?: boolean | null,
>   publishing?: {
>     state?: string | null,
>     error?: string | null,
>     blockedReason?: string | null,
>     skippedPublishReason?: string | null
>   } | null,
>   status?: string | null
> }[] | null
> ```

> [accordion] removedWorkflows full type
>
> ```ts theme={null}
> {
>   workflowId?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   parentFolderId?: string | null | null,
>   deletion?: string | null
> }[] | null
> ```

> [accordion] removedFolders full type
>
> ```ts theme={null}
> {
>   folderId?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   parentFolderId?: string | null | null
> }[] | null
> ```

> [accordion] folders full type
>
> ```ts theme={null}
> {
>   sourceFolderId?: string | null,
>   localId?: string | null,
>   name?: string | null,
>   parentFolderId?: string | null | null,
>   status?: string | null
> }[] | null
> ```

> [accordion] projects full type
>
> ```ts theme={null}
> {
>   sourceProjectId?: string | null,
>   localId?: string | null,
>   name?: string | null,
>   status?: string | null
> }[] | null
> ```

> [accordion] bindings full type
>
> ```ts theme={null}
> {
>   agents?: Record<string, string> | null,
>   workflows?: Record<string, string> | null,
>   credentials?: Record<string, string> | null
> } | null
> ```

> [accordion] credentials full type
>
> ```ts theme={null}
> {
>   matched?: string[] | null,
>   stubbed?: string[] | null,
>   seeded?: string[] | null,
>   incomplete?: string[] | null,
>   updated?: string[] | null
> } | null
> ```

> [accordion] dataTables full type
>
> ```ts theme={null}
> {
>   matched?: number | null,
>   created?: number | null,
>   updated?: number | null
> } | null
> ```

> [accordion] variables full type
>
> ```ts theme={null}
> {
>   matched?: string[] | null,
>   missing?: string[] | null,
>   created?: string[] | null,
>   stubbed?: string[] | null,
>   updated?: string[] | null
> } | null
> ```

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   matched?: string[] | null,
>   created?: string[] | null,
>   renamed?: string[] | null,
>   reconciled?: string[] | null,
>   skipped?: string[] | null
> } | null
> ```

***

## Projects

### create

`projects.create`

Create a project. Create a team project on your instance. Requires the project:create API key scope. Needs a licence with feat:projectRole:admin (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.projects.create({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `name` | `string` | Yes | — |
| `id` | `string` | No | Project ID. The server generates an ID when omitted. An ID that is in use returns HTTP 409. |
| `icon` | `object \| null` | No | — |
| `description` | `string \| null` | No | — |
| `customTelemetryTags` | `object[]` | No | — |

> [accordion] icon full type
>
> ```ts theme={null}
> {
>   type: emoji | icon,
>   value: string,
>   color?: string
> } | null
> ```

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `icon` | `object \| null` | No | Icon of the project, or null when the project has none |
| `description` | `string \| null \| null` | No | — |
| `customTelemetryTags` | `object[] \| null` | No | — |
| `creatorId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `role` | `string \| null` | No | The caller's role in the new project. |
| `scopes` | `string[] \| null` | No | Scopes the caller holds in the new project. |

> [accordion] icon full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   value?: string | null,
>   color?: string | null
> } | null | null
> ```

> [accordion] customTelemetryTags full type
>
> ```ts theme={null}
> {
>   key?: string | null,
>   value?: string | null
> }[] | null
> ```

***

### delete

`projects.delete`

Delete a project. Delete a project from your instance. Requires the project:delete API key scope. Needs a licence with feat:projectRole:admin (Business or Enterprise plans): without it n8n answers 403. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.projects.delete({ projectId: 'VmwOO9HeTEj20kxM' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | The ID of the project. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### list

`projects.list`

Retrieve projects. Retrieve projects from your instance. Requires the project:list API key scope. Needs a licence with feat:projectRole:admin (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.projects.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | Paginate through projects by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection. |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   type?: string | null,
>   icon?: {
>     type?: string | null,
>     value?: string | null,
>     color?: string | null
>   } | null | null,
>   description?: string | null | null,
>   customTelemetryTags?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   creatorId?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### update

`projects.update`

Update a project. Update a project on your instance. Requires the project:update API key scope. Needs a licence with feat:projectRole:admin (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.projects.update({ projectId: 'VmwOO9HeTEj20kxM', name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | The ID of the project. |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### users.add

`projects.users.add`

Add one or more users to a project. Add one or more users to a project on your instance. Requires the project:manageMembers API key scope. Needs a licence with feat:projectRole:admin (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.projects.users.add({
	projectId: 'VmwOO9HeTEj20kxM',
	relations: [{ userId: 'example', role: 'example' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `projectId` | `string` | Yes | The ID of the project. |
| `relations` | `object[]` | Yes | A list of userIds and roles to add to the project. |

> [accordion] relations full type
>
> ```ts theme={null}
> {
>   userId: string,
>   role: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### users.changeRole

`projects.users.changeRole`

Change a user's role in a project. Change a user's role in a project. Requires the project:manageMembers API key scope. Needs a licence with feat:projectRole:admin (Business or Enterprise plans): without it n8n answers 403.

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

```ts theme={null}
await corsair.n8n.api.projects.users.changeRole({ projectId: 'VmwOO9HeTEj20kxM', userId: 'example', role: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | The ID of the project. |
| `userId` | `string` | Yes | The ID of the user. |
| `role` | `string` | Yes | The role assigned to the user in the project. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### users.list

`projects.users.list`

List project members. Returns a list of all members of a project including their role. Requires the user:list API key scope. Needs a licence with feat:projectRole:admin (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.projects.users.list({ projectId: 'VmwOO9HeTEj20kxM' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `projectId` | `string` | Yes | The ID of the project. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | Paginate through project members by setting the cursor parameter to the nextCursor attribute returned by a previous request. Default value fetches the first page of the collection. |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   email?: string | null,
>   firstName?: string | null | null,
>   lastName?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   role?: string | null | null
> }[] | null
> ```

***

### users.remove

`projects.users.remove`

Delete a user from a project. Delete a user from a project on your instance. Requires the project:manageMembers API key scope. Needs a licence with feat:projectRole:admin (Business or Enterprise plans): without it n8n answers 403. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.projects.users.remove({ projectId: 'VmwOO9HeTEj20kxM', userId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | The ID of the project. |
| `userId` | `string` | Yes | The ID of the user. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

## Promotions

### environments.addProject

`promotions.environments.addProject`

Beta: Link a project to a promotion environment. Beta — breaking changes may still occur without major version bump. Links a team project to a project-scoped environment. A project can have one environment for each direction. A direction without a project environment uses the instance environment. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.promotions.environments.addProject({ promotionEnvironmentId: 'example', projectId: 'VmwOO9HeTEj20kxM' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |
| `projectId` | `string` | Yes | The ID of the project. |

**Output**

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

***

### environments.apply

`promotions.environments.apply`

Beta: Apply a package to the instance. Beta — breaking changes may still occur without major version bump. Checks the full package at the configured branch tip. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.promotions.environments.apply({ promotionEnvironmentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |
| `expectedSource` | `object` | No | — |
| `expectedPreviewRevision` | `string` | No | The `revision` of the reviewed preview. The operation builds the preview again. When it differs, the operation returns status `preview-changed` and changes nothing. |

> [accordion] expectedSource full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   branchName: string,
>   commitSha: string
> }
> ```

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null,
>   counts?: {
>     projects?: {
>       created?: number | null,
>       updated?: number | null,
>       skipped?: number | null,
>       deleted?: number | null
>     } | null,
>     folders?: {
>       created?: number | null,
>       updated?: number | null,
>       skipped?: number | null,
>       moved?: number | null,
>       renamed?: number | null,
>       removed?: number | null
>     } | null,
>     workflows?: {
>       created?: number | null,
>       updated?: number | null,
>       skipped?: number | null,
>       moved?: number | null,
>       archived?: number | null,
>       deleted?: number | null,
>       publishing?: {
>         published?: number | null,
>         unpublished?: number | null,
>         unchanged?: number | null,
>         blocked?: number | null,
>         failed?: number | null
>       } | null
>     } | null,
>     credentials?: {
>       matched?: number | null,
>       stubbed?: number | null,
>       updated?: number | null
>     } | null,
>     dataTables?: {
>       matched?: number | null,
>       created?: number | null,
>       updated?: number | null
>     } | null,
>     variables?: {
>       matched?: number | null,
>       created?: number | null,
>       updated?: number | null,
>       stubbed?: number | null,
>       missing?: number | null
>     } | null,
>     tags?: {
>       matched?: number | null,
>       created?: number | null,
>       renamed?: number | null,
>       reconciled?: number | null,
>       skipped?: number | null
>     } | null
>   } | null,
>   warnings?: {
>     kind?: string | null,
>     code?: string | null,
>     name?: string | null,
>     scope?: {
>       kind?: string | null
>     } | null,
>     consumers?: {
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       workflows?: {
>         id?: string | null,
>         name?: string | null
>       }[] | null
>     }[] | null
>   }[] | null
> } | {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null,
>   check?: {
>     missingProjects?: {
>       id?: string | null,
>       name?: string | null,
>       icon?: {
>         type?: string | null,
>         value?: string | null
>       } | null,
>       description?: string | null,
>       customTelemetryTags?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     }[] | null,
>     missingBindings?: (
>       {
>         kind?: string | null,
>         sourceId?: string | null,
>         name?: string | null,
>         credentialType?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         ownerProject?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         expressionData?: Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, string | boolean | (recursive)[] | Record<string, (recursive)>>)[] | Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, (recursive)>)[] | Record<string, (recursive)>>> | null
>       } | {
>         kind?: string | null,
>         name?: string | null,
>         variableType?: string | null,
>         scope?: {
>           kind?: string | null
>         } | {
>           kind?: string | null,
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null
>         } | null,
>         sourceValue?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       }
>     )[] | null,
>     accessRequirements?: {
>       kind?: string | null,
>       sourceId?: string | null,
>       name?: string | null,
>       credentialType?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null
>     }[] | null,
>     conflicts?: (
>       {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null,
>         targetType?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null,
>         usageScope?: string | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         name?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         filePath?: string | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         id?: string | null,
>         name?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         changes?: (
>           {
>             kind?: string | null,
>             column?: string | null,
>             type?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             column?: string | null,
>             type?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             column?: string | null,
>             from?: string | null,
>             to?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             from?: string | null,
>             to?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             from?: string | null,
>             to?: string | null,
>             destructive?: boolean | null
>           }
>         )[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         reason?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         id?: string | null,
>         name?: string | null,
>         reason?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         id?: string | null,
>         name?: string | null,
>         reason?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         reason?: string | null
>       } | {
>         id?: string | null,
>         name?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         projectExists?: boolean | null,
>         instanceProject?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         kind?: string | null,
>         code?: string | null
>       }
>     )[] | null,
>     warnings?: {
>       kind?: string | null,
>       code?: string | null,
>       name?: string | null,
>       scope?: {
>         kind?: string | null
>       } | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     }[] | null
>   } | null
> } | {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null
> } | {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null
> }
> ```

***

### environments.connect

`promotions.environments.connect`

Beta: Connect an environment. Beta — breaking changes may still occur without major version bump. Prepares the environment on the instance that handles the request. For a Git provider, this clones the configured branch into local storage. Safe to call repeatedly. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.promotions.environments.connect({ promotionEnvironmentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `branchName` | `string \| null` | No | — |
| `hasCheckout` | `boolean \| null` | No | — |

***

### environments.continueApply

`promotions.environments.continueApply`

Beta: Continue Apply after binding setup. Beta — breaking changes may still occur without major version bump. Rechecks the configured source and current target bindings. Send expectedSource with the environmentId, branchName, and full commitSha from the reviewed Apply result. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.promotions.environments.continueApply({
	promotionEnvironmentId: 'example',
	expectedSource: { environmentId: 'example', branchName: 'example', commitSha: '9fceb02d0ae598e95dc970b74767f19372d61af8' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |
| `expectedSource` | `object` | Yes | — |
| `expectedPreviewRevision` | `string` | No | The `revision` of the reviewed preview. The operation builds the preview again. When it differs, the operation returns status `preview-changed` and changes nothing. |
| `confirmDestructiveChanges` | `boolean` | No | Also applies destructive data table changes, which a `destructive-change` conflict reports: removed or retyped columns. The values in those columns are removed. Rows and other columns are kept. On a full apply, also deletes the team projects that a `project-deletion` conflict reports, with everything in them. Without `expectedPreviewRevision`, the confirmation covers every such change and deletion when Continue runs, including those that are not in the reviewed result. |

> [accordion] expectedSource full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   branchName: string,
>   commitSha: string
> }
> ```

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null,
>   counts?: {
>     projects?: {
>       created?: number | null,
>       updated?: number | null,
>       skipped?: number | null,
>       deleted?: number | null
>     } | null,
>     folders?: {
>       created?: number | null,
>       updated?: number | null,
>       skipped?: number | null,
>       moved?: number | null,
>       renamed?: number | null,
>       removed?: number | null
>     } | null,
>     workflows?: {
>       created?: number | null,
>       updated?: number | null,
>       skipped?: number | null,
>       moved?: number | null,
>       archived?: number | null,
>       deleted?: number | null,
>       publishing?: {
>         published?: number | null,
>         unpublished?: number | null,
>         unchanged?: number | null,
>         blocked?: number | null,
>         failed?: number | null
>       } | null
>     } | null,
>     credentials?: {
>       matched?: number | null,
>       stubbed?: number | null,
>       updated?: number | null
>     } | null,
>     dataTables?: {
>       matched?: number | null,
>       created?: number | null,
>       updated?: number | null
>     } | null,
>     variables?: {
>       matched?: number | null,
>       created?: number | null,
>       updated?: number | null,
>       stubbed?: number | null,
>       missing?: number | null
>     } | null,
>     tags?: {
>       matched?: number | null,
>       created?: number | null,
>       renamed?: number | null,
>       reconciled?: number | null,
>       skipped?: number | null
>     } | null
>   } | null,
>   warnings?: {
>     kind?: string | null,
>     code?: string | null,
>     name?: string | null,
>     scope?: {
>       kind?: string | null
>     } | null,
>     consumers?: {
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       workflows?: {
>         id?: string | null,
>         name?: string | null
>       }[] | null
>     }[] | null
>   }[] | null
> } | {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null,
>   check?: {
>     missingProjects?: {
>       id?: string | null,
>       name?: string | null,
>       icon?: {
>         type?: string | null,
>         value?: string | null
>       } | null,
>       description?: string | null,
>       customTelemetryTags?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     }[] | null,
>     missingBindings?: (
>       {
>         kind?: string | null,
>         sourceId?: string | null,
>         name?: string | null,
>         credentialType?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         ownerProject?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         expressionData?: Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, string | boolean | (recursive)[] | Record<string, (recursive)>>)[] | Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, (recursive)>)[] | Record<string, (recursive)>>> | null
>       } | {
>         kind?: string | null,
>         name?: string | null,
>         variableType?: string | null,
>         scope?: {
>           kind?: string | null
>         } | {
>           kind?: string | null,
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null
>         } | null,
>         sourceValue?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       }
>     )[] | null,
>     accessRequirements?: {
>       kind?: string | null,
>       sourceId?: string | null,
>       name?: string | null,
>       credentialType?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null
>     }[] | null,
>     conflicts?: (
>       {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null,
>         targetType?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null,
>         usageScope?: string | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         name?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         filePath?: string | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         id?: string | null,
>         name?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         changes?: (
>           {
>             kind?: string | null,
>             column?: string | null,
>             type?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             column?: string | null,
>             type?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             column?: string | null,
>             from?: string | null,
>             to?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             from?: string | null,
>             to?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             from?: string | null,
>             to?: string | null,
>             destructive?: boolean | null
>           }
>         )[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         reason?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         id?: string | null,
>         name?: string | null,
>         reason?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         id?: string | null,
>         name?: string | null,
>         reason?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         reason?: string | null
>       } | {
>         id?: string | null,
>         name?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         projectExists?: boolean | null,
>         instanceProject?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         kind?: string | null,
>         code?: string | null
>       }
>     )[] | null,
>     warnings?: {
>       kind?: string | null,
>       code?: string | null,
>       name?: string | null,
>       scope?: {
>         kind?: string | null
>       } | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     }[] | null
>   } | null
> } | {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null
> } | {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null
> }
> ```

***

### environments.create

`promotions.environments.create`

Beta: Create a promotion environment. Beta — breaking changes may still occur without major version bump. Creates an environment for one direction on an existing provider. The settings must match the direction. A GitLab remote URL must belong to the saved provider. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.promotions.environments.create({
	name: 'example',
	scope: 'instance',
	providerId: 'example',
	remote: { schemaVersion: 1, remoteUrl: 'https://example.com/callback' },
	direction: 'apply',
	settings: { schemaVersion: 1, branchName: 'example' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `name` | `string` | Yes | — |
| `scope` | `instance \| projects` | Yes | — |
| `providerId` | `string` | Yes | — |
| `remote` | `object` | Yes | — |
| `direction` | `apply \| promote` | Yes | — |
| `settings` | `object` | Yes | — |

> [accordion] remote full type
>
> ```ts theme={null}
> {
>   schemaVersion: 1,
>   remoteUrl: string
> }
> ```

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   schemaVersion: 1,
>   branchName: string
> } | {
>   schemaVersion: 1,
>   baseBranchName: string,
>   createBranchOnPromotion: boolean
> }
> ```

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   scope?: string | null,
>   remote?: {
>     schemaVersion?: number | null,
>     remoteUrl?: string | null,
>     repositoryPath?: string | null
>   } | null,
>   provider?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     authType?: string | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   direction?: string | null,
>   settings?: {
>     schemaVersion?: number | null,
>     branchName?: string | null
>   } | null,
>   checkout?: {
>     hasCheckout?: boolean | null,
>     matchesEnvironment?: boolean | null
>   } | null
> } | {
>   id?: string | null,
>   name?: string | null,
>   scope?: string | null,
>   remote?: {
>     schemaVersion?: number | null,
>     remoteUrl?: string | null,
>     repositoryPath?: string | null
>   } | null,
>   provider?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     authType?: string | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   direction?: string | null,
>   settings?: {
>     schemaVersion?: number | null,
>     baseBranchName?: string | null,
>     createBranchOnPromotion?: boolean | null
>   } | null,
>   checkout?: {
>     hasCheckout?: boolean | null,
>     matchesEnvironment?: boolean | null
>   } | null
> }
> ```

***

### environments.delete

`promotions.environments.delete`

Beta: Delete a promotion environment. Beta — breaking changes may still occur without major version bump. Deletes the environment with its project links and local checkout. Its provider is kept. Nothing in the Git repository changes. The open promotion reviews of the environment close in n8n. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.promotions.environments.delete({ promotionEnvironmentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### environments.disconnect

`promotions.environments.disconnect`

Beta: Remove an environment's local checkout. Beta — breaking changes may still occur without major version bump. Removes the local checkout on this instance, asks the other main instances to remove theirs, and keeps the environment, its credentials, and the trusted SSH host keys. Another operation on the same environment returns 423. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.promotions.environments.disconnect({ promotionEnvironmentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `branchName` | `string \| null` | No | — |
| `hasCheckout` | `boolean \| null` | No | — |

***

### environments.get

`promotions.environments.get`

Beta: Retrieve a promotion environment. Beta — breaking changes may still occur without major version bump. Returns the environment with its provider summary and the state of its local checkout. Requires the promotions:readEnvironments API key scope. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.environments.get({ promotionEnvironmentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   scope?: string | null,
>   remote?: {
>     schemaVersion?: number | null,
>     remoteUrl?: string | null,
>     repositoryPath?: string | null
>   } | null,
>   provider?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     authType?: string | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   direction?: string | null,
>   settings?: {
>     schemaVersion?: number | null,
>     branchName?: string | null
>   } | null,
>   checkout?: {
>     hasCheckout?: boolean | null,
>     matchesEnvironment?: boolean | null
>   } | null
> } | {
>   id?: string | null,
>   name?: string | null,
>   scope?: string | null,
>   remote?: {
>     schemaVersion?: number | null,
>     remoteUrl?: string | null,
>     repositoryPath?: string | null
>   } | null,
>   provider?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     authType?: string | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   direction?: string | null,
>   settings?: {
>     schemaVersion?: number | null,
>     baseBranchName?: string | null,
>     createBranchOnPromotion?: boolean | null
>   } | null,
>   checkout?: {
>     hasCheckout?: boolean | null,
>     matchesEnvironment?: boolean | null
>   } | null
> }
> ```

***

### environments.getChangeDetails

`promotions.environments.getChangeDetails`

Beta: Read the content of resources in the whole-instance Apply preview. Beta — breaking changes may still occur without major version bump. Returns the content before and after the change for up to 50 resources of the whole-instance Apply preview. Send the commitSha and the resource key values from the preview. The branch side is read at that commit. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403. Added in n8n 2.50; older instances answer 404.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.environments.getChangeDetails({
	promotionEnvironmentId: 'example',
	commitSha: '9fceb02d0ae598e95dc970b74767f19372d61af8',
	keys: ['example'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |
| `commitSha` | `string \| null` | Yes | The `commitSha` of the preview. `null` when the preview had none. |
| `keys` | `string[]` | Yes | The `key` of each resource to read, from the preview. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `details` | `object[] \| null` | No | — |
| `missingKeys` | `string[] \| null` | No | — |

> [accordion] details full type
>
> ```ts theme={null}
> (
>   {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       id?: string | null,
>       name?: string | null,
>       description?: string | null,
>       icon?: {
>         type?: string | null,
>         value?: string | null
>       } | null,
>       customTelemetryTags?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null | null,
>     after?: {
>       id?: string | null,
>       name?: string | null,
>       description?: string | null,
>       icon?: {
>         type?: string | null,
>         value?: string | null
>       } | null,
>       customTelemetryTags?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null
>   } | {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       id?: string | null,
>       name?: string | null,
>       resourceType?: string | null,
>       parentFolderId?: string | null | null
>     } | null | null,
>     after?: {
>       id?: string | null,
>       name?: string | null,
>       resourceType?: string | null,
>       parentFolderId?: string | null | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null
>   } | {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       id?: string | null,
>       name?: string | null,
>       description?: string | null | null,
>       nodes?: {
>         id?: string | null,
>         name?: string | null,
>         type?: string | null,
>         typeVersion?: number | null,
>         position?: number[] | null,
>         parameters?: Record<string, any> | null,
>         credentials?: Record<string, {
>           id?: string | null | null,
>           name?: string | null,
>           __aiGatewayManaged?: boolean | null
>         }> | null,
>         disabled?: boolean | null,
>         notes?: string | null,
>         notesInFlow?: boolean | null,
>         continueOnFail?: boolean | null,
>         retryOnFail?: boolean | null,
>         maxTries?: number | null,
>         waitBetweenTries?: number | null,
>         alwaysOutputData?: boolean | null,
>         executeOnce?: boolean | null,
>         onError?: string | null,
>         webhookId?: string | null
>       }[] | null,
>       connections?: Record<string, Record<string, (
>         {
>           node?: string | null,
>           type?: string | null,
>           index?: number | null
>         }[] | null
>       )[]>> | null,
>       nodeGroups?: {
>         id?: string | null,
>         name?: string | null,
>         nodeIds?: string[] | null,
>         description?: string | null
>       }[] | null,
>       settings?: Record<string, any> | null,
>       parentFolderId?: string | null | null,
>       isArchived?: boolean | null,
>       tagIds?: string[] | null
>     } | null | null,
>     after?: {
>       id?: string | null,
>       name?: string | null,
>       description?: string | null | null,
>       nodes?: {
>         id?: string | null,
>         name?: string | null,
>         type?: string | null,
>         typeVersion?: number | null,
>         position?: number[] | null,
>         parameters?: Record<string, any> | null,
>         credentials?: Record<string, {
>           id?: string | null | null,
>           name?: string | null,
>           __aiGatewayManaged?: boolean | null
>         }> | null,
>         disabled?: boolean | null,
>         notes?: string | null,
>         notesInFlow?: boolean | null,
>         continueOnFail?: boolean | null,
>         retryOnFail?: boolean | null,
>         maxTries?: number | null,
>         waitBetweenTries?: number | null,
>         alwaysOutputData?: boolean | null,
>         executeOnce?: boolean | null,
>         onError?: string | null,
>         webhookId?: string | null
>       }[] | null,
>       connections?: Record<string, Record<string, (
>         {
>           node?: string | null,
>           type?: string | null,
>           index?: number | null
>         }[] | null
>       )[]>> | null,
>       nodeGroups?: {
>         id?: string | null,
>         name?: string | null,
>         nodeIds?: string[] | null,
>         description?: string | null
>       }[] | null,
>       settings?: Record<string, any> | null,
>       parentFolderId?: string | null | null,
>       isArchived?: boolean | null,
>       tagIds?: string[] | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null
>   } | {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       id?: string | null,
>       name?: string | null,
>       type?: string | null,
>       description?: string | null | null,
>       data?: Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, string | boolean | (recursive)[] | Record<string, (recursive)>>)[] | Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, (recursive)>)[] | Record<string, (recursive)>>> | null,
>       dataIsComplete?: boolean | null
>     } | null | null,
>     after?: {
>       id?: string | null,
>       name?: string | null,
>       type?: string | null,
>       description?: string | null | null,
>       data?: Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, string | boolean | (recursive)[] | Record<string, (recursive)>>)[] | Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, (recursive)>)[] | Record<string, (recursive)>>> | null,
>       dataIsComplete?: boolean | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null
>   } | {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       id?: string | null,
>       name?: string | null,
>       columns?: {
>         id?: string | null,
>         name?: string | null,
>         type?: string | null,
>         index?: number | null
>       }[] | null
>     } | null | null,
>     after?: {
>       id?: string | null,
>       name?: string | null,
>       columns?: {
>         id?: string | null,
>         name?: string | null,
>         type?: string | null,
>         index?: number | null
>       }[] | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null,
>     dataTableChanges?: (
>       {
>         kind?: string | null,
>         column?: string | null,
>         type?: string | null,
>         destructive?: boolean | null
>       } | {
>         kind?: string | null,
>         column?: string | null,
>         type?: string | null,
>         destructive?: boolean | null
>       } | {
>         kind?: string | null,
>         column?: string | null,
>         from?: string | null,
>         to?: string | null,
>         destructive?: boolean | null
>       } | {
>         kind?: string | null,
>         from?: string | null,
>         to?: string | null,
>         destructive?: boolean | null
>       } | {
>         kind?: string | null,
>         destructive?: boolean | null
>       } | {
>         kind?: string | null,
>         from?: string | null,
>         to?: string | null,
>         destructive?: boolean | null
>       }
>     )[] | null
>   } | {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       name?: string | null,
>       type?: string | null,
>       value?: string | null
>     } | null | null,
>     after?: {
>       name?: string | null,
>       type?: string | null,
>       value?: string | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null,
>     valueHidden?: boolean | null
>   } | {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       id?: string | null,
>       name?: string | null
>     } | null | null,
>     after?: {
>       id?: string | null,
>       name?: string | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null
>   }
> )[] | null
> ```

***

### environments.list

`promotions.environments.list`

Beta: List promotion environments. Beta — breaking changes may still occur without major version bump. Returns a cursor-paginated list of environments. Filter by scope and direction for the instance environments, or by providerId to see which environments a provider edit affects. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.environments.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `scope` | `instance \| projects` | No | — |
| `direction` | `apply \| promote` | No | — |
| `providerId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> (
>   {
>     id?: string | null,
>     name?: string | null,
>     scope?: string | null,
>     remote?: {
>       schemaVersion?: number | null,
>       remoteUrl?: string | null,
>       repositoryPath?: string | null
>     } | null,
>     provider?: {
>       id?: string | null,
>       name?: string | null,
>       type?: string | null,
>       authType?: string | null,
>       createdAt?: string | null,
>       updatedAt?: string | null
>     } | null,
>     createdAt?: string | null,
>     updatedAt?: string | null,
>     direction?: string | null,
>     settings?: {
>       schemaVersion?: number | null,
>       branchName?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     name?: string | null,
>     scope?: string | null,
>     remote?: {
>       schemaVersion?: number | null,
>       remoteUrl?: string | null,
>       repositoryPath?: string | null
>     } | null,
>     provider?: {
>       id?: string | null,
>       name?: string | null,
>       type?: string | null,
>       authType?: string | null,
>       createdAt?: string | null,
>       updatedAt?: string | null
>     } | null,
>     createdAt?: string | null,
>     updatedAt?: string | null,
>     direction?: string | null,
>     settings?: {
>       schemaVersion?: number | null,
>       baseBranchName?: string | null,
>       createBranchOnPromotion?: boolean | null
>     } | null
>   }
> )[] | null
> ```

***

### environments.listChanges

`promotions.environments.listChanges`

Beta: Preview the Apply of the whole instance. Beta — breaking changes may still occur without major version bump. Shows what applying the branch tip of an instance Apply environment changes on this instance, for every project of the package. resources and dependencies have the same shape as the project change preview. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403. Added in n8n 2.50; older instances answer 404.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.environments.listChanges({ promotionEnvironmentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `commitSha` | `string \| null` | No | — |
| `source` | `object \| null` | No | — |
| `environment` | `object \| null` | No | — |
| `resources` | `object[] \| null` | No | — |
| `dependencies` | `object[] \| null` | No | — |
| `check` | `object \| null` | No | — |
| `revision` | `string \| null` | No | Send it as `expectedPreviewRevision` to apply only when this instance still matches the preview. |

> [accordion] source full type
>
> ```ts theme={null}
> {
>   environmentId?: string | null,
>   branchName?: string | null
> } | null
> ```

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   providerType?: string | null,
>   createBranchOnPromotion?: boolean | null
> } | null
> ```

> [accordion] resources full type
>
> ```ts theme={null}
> {
>   key?: string | null,
>   type?: string | null,
>   id?: string | null,
>   name?: string | null,
>   previousName?: string | null,
>   previousId?: string | null,
>   parentKey?: string | null | null,
>   previousParentKey?: string | null | null,
>   change?: string | null,
>   selectable?: boolean | null,
>   movedToProject?: {
>     id?: string | null,
>     name?: string | null
>   } | null,
>   movedFromProject?: {
>     id?: string | null,
>     name?: string | null
>   } | null,
>   revision?: {
>     before?: string | null | null,
>     after?: string | null | null
>   } | null
> }[] | null
> ```

> [accordion] dependencies full type
>
> ```ts theme={null}
> {
>   workflowKey?: string | null,
>   resourceKey?: string | null,
>   included?: boolean | null
> }[] | null
> ```

> [accordion] check full type
>
> ```ts theme={null}
> {
>   missingProjects?: {
>     id?: string | null,
>     name?: string | null,
>     icon?: {
>       type?: string | null,
>       value?: string | null
>     } | null,
>     description?: string | null,
>     customTelemetryTags?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   }[] | null,
>   missingBindings?: (
>     {
>       kind?: string | null,
>       sourceId?: string | null,
>       name?: string | null,
>       credentialType?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       ownerProject?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       expressionData?: Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, string | boolean | (recursive)[] | Record<string, (recursive)>>)[] | Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, (recursive)>)[] | Record<string, (recursive)>>> | null
>     } | {
>       kind?: string | null,
>       name?: string | null,
>       variableType?: string | null,
>       scope?: {
>         kind?: string | null
>       } | {
>         kind?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null
>       } | null,
>       sourceValue?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     }
>   )[] | null,
>   accessRequirements?: {
>     kind?: string | null,
>     sourceId?: string | null,
>     name?: string | null,
>     credentialType?: string | null,
>     consumers?: {
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       workflows?: {
>         id?: string | null,
>         name?: string | null
>       }[] | null
>     }[] | null,
>     code?: string | null
>   }[] | null,
>   conflicts?: (
>     {
>       kind?: string | null,
>       sourceId?: string | null | null,
>       name?: string | null,
>       expectedTypes?: string[] | null,
>       filePath?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null
>     } | {
>       kind?: string | null,
>       sourceId?: string | null | null,
>       name?: string | null,
>       expectedTypes?: string[] | null,
>       filePath?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null
>     } | {
>       kind?: string | null,
>       sourceId?: string | null | null,
>       name?: string | null,
>       expectedTypes?: string[] | null,
>       filePath?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null
>     } | {
>       kind?: string | null,
>       sourceId?: string | null | null,
>       name?: string | null,
>       expectedTypes?: string[] | null,
>       filePath?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null
>     } | {
>       kind?: string | null,
>       sourceId?: string | null | null,
>       name?: string | null,
>       expectedTypes?: string[] | null,
>       filePath?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null,
>       targetType?: string | null
>     } | {
>       kind?: string | null,
>       sourceId?: string | null | null,
>       name?: string | null,
>       expectedTypes?: string[] | null,
>       filePath?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null,
>       usageScope?: string | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       name?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       filePath?: string | null,
>       workflows?: {
>         id?: string | null,
>         name?: string | null
>       }[] | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       id?: string | null,
>       name?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       changes?: (
>         {
>           kind?: string | null,
>           column?: string | null,
>           type?: string | null,
>           destructive?: boolean | null
>         } | {
>           kind?: string | null,
>           column?: string | null,
>           type?: string | null,
>           destructive?: boolean | null
>         } | {
>           kind?: string | null,
>           column?: string | null,
>           from?: string | null,
>           to?: string | null,
>           destructive?: boolean | null
>         } | {
>           kind?: string | null,
>           from?: string | null,
>           to?: string | null,
>           destructive?: boolean | null
>         } | {
>           kind?: string | null,
>           destructive?: boolean | null
>         } | {
>           kind?: string | null,
>           from?: string | null,
>           to?: string | null,
>           destructive?: boolean | null
>         }
>       )[] | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       reason?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       id?: string | null,
>       name?: string | null,
>       reason?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       id?: string | null,
>       name?: string | null,
>       reason?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       reason?: string | null
>     } | {
>       id?: string | null,
>       name?: string | null,
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       projectExists?: boolean | null,
>       instanceProject?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       kind?: string | null,
>       code?: string | null
>     }
>   )[] | null,
>   warnings?: {
>     kind?: string | null,
>     code?: string | null,
>     name?: string | null,
>     scope?: {
>       kind?: string | null
>     } | null,
>     consumers?: {
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       workflows?: {
>         id?: string | null,
>         name?: string | null
>       }[] | null
>     }[] | null
>   }[] | null,
>   movedWorkflows?: {
>     id?: string | null,
>     name?: string | null,
>     project?: {
>       id?: string | null,
>       name?: string | null
>     } | null,
>     projectExists?: boolean | null,
>     instanceProject?: {
>       id?: string | null,
>       name?: string | null
>     } | null
>   }[] | null,
>   movedFolders?: {
>     id?: string | null,
>     name?: string | null,
>     project?: {
>       id?: string | null,
>       name?: string | null
>     } | null,
>     projectExists?: boolean | null,
>     instanceProject?: {
>       id?: string | null,
>       name?: string | null
>     } | null
>   }[] | null
> } | null
> ```

***

### environments.listMissingProjects

`promotions.environments.listMissingProjects`

Beta: List package projects that are missing on this instance. Beta — breaking changes may still occur without major version bump. Reads the package at the Apply branch tip and returns its team projects whose IDs do not exist on this instance. Projects are matched by ID, not by name. An ID that a personal project uses counts as existing. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.environments.listMissingProjects({ promotionEnvironmentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string \| null` | No | — |
| `git` | `object \| null` | No | — |
| `data` | `object[] \| null` | No | — |

> [accordion] git full type
>
> ```ts theme={null}
> {
>   commitSha?: string | null,
>   branchName?: string | null
> } | null | null
> ```

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   icon?: {
>     type?: string | null,
>     value?: string | null
>   } | null,
>   description?: string | null,
>   customTelemetryTags?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null
> }[] | null
> ```

***

### environments.listProjects

`promotions.environments.listProjects`

Beta: List projects linked to a promotion environment. Beta — breaking changes may still occur without major version bump. Requires the promotions:readEnvironments API key scope. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.environments.listProjects({ promotionEnvironmentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |

**Output**

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

***

### environments.promote

`promotions.environments.promote`

Beta: Promote all team projects. Beta — breaking changes may still occur without major version bump. Exports every team project, commits it, and pushes to the configured base branch or a new timestamped branch. When the requireApproval setting is alwaysRequired, it always pushes a new branch, whatever the environment setting is. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.promotions.environments.promote({ promotionEnvironmentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |
| `commitMessage` | `string` | No | Message for the promotion commit. If you omit it, the commit uses a generated message. |
| `force` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string \| null` | No | — |
| `counts` | `object \| null` | No | — |
| `git` | `object \| null` | No | — |
| `review` | `object \| null` | No | — |
| `warnings` | `object[] \| null` | No | — |

> [accordion] counts full type
>
> ```ts theme={null}
> {
>   workflows?: number | null,
>   folders?: number | null,
>   credentials?: number | null,
>   dataTables?: number | null,
>   variables?: number | null,
>   tags?: number | null
> } | null
> ```

> [accordion] git full type
>
> ```ts theme={null}
> {
>   commitSha?: string | null,
>   branchName?: string | null
> } | null
> ```

> [accordion] review full type
>
> ```ts theme={null}
> {
>   reviewId?: string | null,
>   number?: number | null,
>   webUrl?: string | null
> } | null
> ```

> [accordion] warnings full type
>
> ```ts theme={null}
> {
>   message?: string | null,
>   linkUrl?: string | null
> }[] | null
> ```

***

### environments.removeProject

`promotions.environments.removeProject`

Beta: Unlink a project from a promotion environment. Beta — breaking changes may still occur without major version bump. Requires the promotions:manageEnvironments API key scope. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.promotions.environments.removeProject({ promotionEnvironmentId: 'example', projectId: 'VmwOO9HeTEj20kxM' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |
| `projectId` | `string` | Yes | The ID of the project. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### environments.update

`promotions.environments.update`

Beta: Update a promotion environment. Beta — breaking changes may still occur without major version bump. Updates the name, provider, remote, or settings. A remote replaces the whole saved remote, and settings replace the whole saved settings. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.promotions.environments.update({ promotionEnvironmentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `promotionEnvironmentId` | `string` | Yes | The ID of the promotion environment. |
| `name` | `string` | No | — |
| `providerId` | `string` | No | — |
| `remote` | `object` | No | — |
| `settings` | `object` | No | — |

> [accordion] remote full type
>
> ```ts theme={null}
> {
>   schemaVersion: 1,
>   remoteUrl: string
> }
> ```

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   schemaVersion: 1,
>   branchName: string
> } | {
>   schemaVersion: 1,
>   baseBranchName: string,
>   createBranchOnPromotion: boolean
> }
> ```

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   scope?: string | null,
>   remote?: {
>     schemaVersion?: number | null,
>     remoteUrl?: string | null,
>     repositoryPath?: string | null
>   } | null,
>   provider?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     authType?: string | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   direction?: string | null,
>   settings?: {
>     schemaVersion?: number | null,
>     branchName?: string | null
>   } | null,
>   checkout?: {
>     hasCheckout?: boolean | null,
>     matchesEnvironment?: boolean | null
>   } | null
> } | {
>   id?: string | null,
>   name?: string | null,
>   scope?: string | null,
>   remote?: {
>     schemaVersion?: number | null,
>     remoteUrl?: string | null,
>     repositoryPath?: string | null
>   } | null,
>   provider?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     authType?: string | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   direction?: string | null,
>   settings?: {
>     schemaVersion?: number | null,
>     baseBranchName?: string | null,
>     createBranchOnPromotion?: boolean | null
>   } | null,
>   checkout?: {
>     hasCheckout?: boolean | null,
>     matchesEnvironment?: boolean | null
>   } | null
> }
> ```

***

### projects.apply

`promotions.projects.apply`

Beta: Apply a selection of a project's workflows and folders. Beta — breaking changes may still occur without major version bump. Applies selected changes from the project's Apply branch. The project's name, icon, description and telemetry tags always come from the branch, so a request without workflowIds and folderIds applies only the project. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.promotions.projects.apply({ projectId: 'VmwOO9HeTEj20kxM' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `projectId` | `string` | Yes | The ID of the project. |
| `workflowIds` | `string[]` | No | — |
| `folderIds` | `string[]` | No | Folders of the project on the branch. Apply creates a selected folder, or moves and renames it to match the branch. |
| `expectedSource` | `object` | No | — |
| `expectedPreviewRevision` | `string` | No | The `revision` of the reviewed preview. The operation builds the preview again. When it differs, the operation returns status `preview-changed` and changes nothing. |

> [accordion] expectedSource full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   branchName: string,
>   commitSha: string
> }
> ```

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null,
>   counts?: {
>     projects?: {
>       created?: number | null,
>       updated?: number | null,
>       skipped?: number | null,
>       deleted?: number | null
>     } | null,
>     folders?: {
>       created?: number | null,
>       updated?: number | null,
>       skipped?: number | null,
>       moved?: number | null,
>       renamed?: number | null,
>       removed?: number | null
>     } | null,
>     workflows?: {
>       created?: number | null,
>       updated?: number | null,
>       skipped?: number | null,
>       moved?: number | null,
>       archived?: number | null,
>       deleted?: number | null,
>       publishing?: {
>         published?: number | null,
>         unpublished?: number | null,
>         unchanged?: number | null,
>         blocked?: number | null,
>         failed?: number | null
>       } | null
>     } | null,
>     credentials?: {
>       matched?: number | null,
>       stubbed?: number | null,
>       updated?: number | null
>     } | null,
>     dataTables?: {
>       matched?: number | null,
>       created?: number | null,
>       updated?: number | null
>     } | null,
>     variables?: {
>       matched?: number | null,
>       created?: number | null,
>       updated?: number | null,
>       stubbed?: number | null,
>       missing?: number | null
>     } | null,
>     tags?: {
>       matched?: number | null,
>       created?: number | null,
>       renamed?: number | null,
>       reconciled?: number | null,
>       skipped?: number | null
>     } | null
>   } | null,
>   warnings?: {
>     kind?: string | null,
>     code?: string | null,
>     name?: string | null,
>     scope?: {
>       kind?: string | null
>     } | null,
>     consumers?: {
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       workflows?: {
>         id?: string | null,
>         name?: string | null
>       }[] | null
>     }[] | null
>   }[] | null
> } | {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null,
>   check?: {
>     missingProjects?: {
>       id?: string | null,
>       name?: string | null,
>       icon?: {
>         type?: string | null,
>         value?: string | null
>       } | null,
>       description?: string | null,
>       customTelemetryTags?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     }[] | null,
>     missingBindings?: (
>       {
>         kind?: string | null,
>         sourceId?: string | null,
>         name?: string | null,
>         credentialType?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         ownerProject?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         expressionData?: Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, string | boolean | (recursive)[] | Record<string, (recursive)>>)[] | Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, (recursive)>)[] | Record<string, (recursive)>>> | null
>       } | {
>         kind?: string | null,
>         name?: string | null,
>         variableType?: string | null,
>         scope?: {
>           kind?: string | null
>         } | {
>           kind?: string | null,
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null
>         } | null,
>         sourceValue?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       }
>     )[] | null,
>     accessRequirements?: {
>       kind?: string | null,
>       sourceId?: string | null,
>       name?: string | null,
>       credentialType?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null
>     }[] | null,
>     conflicts?: (
>       {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null,
>         targetType?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null,
>         usageScope?: string | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         name?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         filePath?: string | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         id?: string | null,
>         name?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         changes?: (
>           {
>             kind?: string | null,
>             column?: string | null,
>             type?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             column?: string | null,
>             type?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             column?: string | null,
>             from?: string | null,
>             to?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             from?: string | null,
>             to?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             from?: string | null,
>             to?: string | null,
>             destructive?: boolean | null
>           }
>         )[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         reason?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         id?: string | null,
>         name?: string | null,
>         reason?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         id?: string | null,
>         name?: string | null,
>         reason?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         reason?: string | null
>       } | {
>         id?: string | null,
>         name?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         projectExists?: boolean | null,
>         instanceProject?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         kind?: string | null,
>         code?: string | null
>       }
>     )[] | null,
>     warnings?: {
>       kind?: string | null,
>       code?: string | null,
>       name?: string | null,
>       scope?: {
>         kind?: string | null
>       } | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     }[] | null
>   } | null
> } | {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null
> } | {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null
> }
> ```

***

### projects.continueApply

`promotions.projects.continueApply`

Beta: Continue applying a selection after binding setup. Beta — breaking changes may still occur without major version bump. Rechecks the project's Apply source and the current bindings for the selection. Resend the full selection: workflowIds and folderIds. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.promotions.projects.continueApply({
	projectId: 'VmwOO9HeTEj20kxM',
	expectedSource: { environmentId: 'example', branchName: 'example', commitSha: '9fceb02d0ae598e95dc970b74767f19372d61af8' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `projectId` | `string` | Yes | The ID of the project. |
| `workflowIds` | `string[]` | No | — |
| `folderIds` | `string[]` | No | Folders of the project on the branch. Apply creates a selected folder, or moves and renames it to match the branch. |
| `expectedSource` | `object` | Yes | — |
| `expectedPreviewRevision` | `string` | No | The `revision` of the reviewed preview. The operation builds the preview again. When it differs, the operation returns status `preview-changed` and changes nothing. |
| `confirmDestructiveChanges` | `boolean` | No | Also applies destructive data table changes, which a `destructive-change` conflict reports: removed or retyped columns. The values in those columns are removed. Rows and other columns are kept. On a full apply, also deletes the team projects that a `project-deletion` conflict reports, with everything in them. Without `expectedPreviewRevision`, the confirmation covers every such change and deletion when Continue runs, including those that are not in the reviewed result. |

> [accordion] expectedSource full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   branchName: string,
>   commitSha: string
> }
> ```

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null,
>   counts?: {
>     projects?: {
>       created?: number | null,
>       updated?: number | null,
>       skipped?: number | null,
>       deleted?: number | null
>     } | null,
>     folders?: {
>       created?: number | null,
>       updated?: number | null,
>       skipped?: number | null,
>       moved?: number | null,
>       renamed?: number | null,
>       removed?: number | null
>     } | null,
>     workflows?: {
>       created?: number | null,
>       updated?: number | null,
>       skipped?: number | null,
>       moved?: number | null,
>       archived?: number | null,
>       deleted?: number | null,
>       publishing?: {
>         published?: number | null,
>         unpublished?: number | null,
>         unchanged?: number | null,
>         blocked?: number | null,
>         failed?: number | null
>       } | null
>     } | null,
>     credentials?: {
>       matched?: number | null,
>       stubbed?: number | null,
>       updated?: number | null
>     } | null,
>     dataTables?: {
>       matched?: number | null,
>       created?: number | null,
>       updated?: number | null
>     } | null,
>     variables?: {
>       matched?: number | null,
>       created?: number | null,
>       updated?: number | null,
>       stubbed?: number | null,
>       missing?: number | null
>     } | null,
>     tags?: {
>       matched?: number | null,
>       created?: number | null,
>       renamed?: number | null,
>       reconciled?: number | null,
>       skipped?: number | null
>     } | null
>   } | null,
>   warnings?: {
>     kind?: string | null,
>     code?: string | null,
>     name?: string | null,
>     scope?: {
>       kind?: string | null
>     } | null,
>     consumers?: {
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       workflows?: {
>         id?: string | null,
>         name?: string | null
>       }[] | null
>     }[] | null
>   }[] | null
> } | {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null,
>   check?: {
>     missingProjects?: {
>       id?: string | null,
>       name?: string | null,
>       icon?: {
>         type?: string | null,
>         value?: string | null
>       } | null,
>       description?: string | null,
>       customTelemetryTags?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     }[] | null,
>     missingBindings?: (
>       {
>         kind?: string | null,
>         sourceId?: string | null,
>         name?: string | null,
>         credentialType?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         ownerProject?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         expressionData?: Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, string | boolean | (recursive)[] | Record<string, (recursive)>>)[] | Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, (recursive)>)[] | Record<string, (recursive)>>> | null
>       } | {
>         kind?: string | null,
>         name?: string | null,
>         variableType?: string | null,
>         scope?: {
>           kind?: string | null
>         } | {
>           kind?: string | null,
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null
>         } | null,
>         sourceValue?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       }
>     )[] | null,
>     accessRequirements?: {
>       kind?: string | null,
>       sourceId?: string | null,
>       name?: string | null,
>       credentialType?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null
>     }[] | null,
>     conflicts?: (
>       {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null,
>         targetType?: string | null
>       } | {
>         kind?: string | null,
>         sourceId?: string | null | null,
>         name?: string | null,
>         expectedTypes?: string[] | null,
>         filePath?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         code?: string | null,
>         usageScope?: string | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         name?: string | null,
>         referenceFiles?: string[] | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         filePath?: string | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         id?: string | null,
>         name?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null,
>         changes?: (
>           {
>             kind?: string | null,
>             column?: string | null,
>             type?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             column?: string | null,
>             type?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             column?: string | null,
>             from?: string | null,
>             to?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             from?: string | null,
>             to?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             destructive?: boolean | null
>           } | {
>             kind?: string | null,
>             from?: string | null,
>             to?: string | null,
>             destructive?: boolean | null
>           }
>         )[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         reason?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         id?: string | null,
>         name?: string | null,
>         reason?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         id?: string | null,
>         name?: string | null,
>         reason?: string | null,
>         consumers?: {
>           project?: {
>             id?: string | null,
>             name?: string | null
>           } | null,
>           workflows?: {
>             id?: string | null,
>             name?: string | null
>           }[] | null
>         }[] | null
>       } | {
>         kind?: string | null,
>         code?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         reason?: string | null
>       } | {
>         id?: string | null,
>         name?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         projectExists?: boolean | null,
>         instanceProject?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         kind?: string | null,
>         code?: string | null
>       }
>     )[] | null,
>     warnings?: {
>       kind?: string | null,
>       code?: string | null,
>       name?: string | null,
>       scope?: {
>         kind?: string | null
>       } | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     }[] | null
>   } | null
> } | {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null
> } | {
>   environmentId?: string | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   status?: string | null
> }
> ```

***

### projects.getChangeDetails

`promotions.projects.getChangeDetails`

Beta: Read the content of changed resources. Beta — breaking changes may still occur without major version bump. Returns the content before and after the change for up to 50 resources of a change preview. Send the commitSha and the resource key values from the preview. The branch side is read at that commit. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.projects.getChangeDetails({
	projectId: 'VmwOO9HeTEj20kxM',
	direction: 'apply',
	commitSha: '9fceb02d0ae598e95dc970b74767f19372d61af8',
	keys: ['example'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `projectId` | `string` | Yes | The ID of the project. |
| `direction` | `apply \| promote` | Yes | The direction of the promotion: apply or promote. |
| `commitSha` | `string \| null` | Yes | The `commitSha` of the preview. `null` when the preview had none. |
| `keys` | `string[]` | Yes | The `key` of each resource to read, from the preview. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `details` | `object[] \| null` | No | — |
| `missingKeys` | `string[] \| null` | No | — |

> [accordion] details full type
>
> ```ts theme={null}
> (
>   {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       id?: string | null,
>       name?: string | null,
>       description?: string | null,
>       icon?: {
>         type?: string | null,
>         value?: string | null
>       } | null,
>       customTelemetryTags?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null | null,
>     after?: {
>       id?: string | null,
>       name?: string | null,
>       description?: string | null,
>       icon?: {
>         type?: string | null,
>         value?: string | null
>       } | null,
>       customTelemetryTags?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null
>   } | {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       id?: string | null,
>       name?: string | null,
>       resourceType?: string | null,
>       parentFolderId?: string | null | null
>     } | null | null,
>     after?: {
>       id?: string | null,
>       name?: string | null,
>       resourceType?: string | null,
>       parentFolderId?: string | null | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null
>   } | {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       id?: string | null,
>       name?: string | null,
>       description?: string | null | null,
>       nodes?: {
>         id?: string | null,
>         name?: string | null,
>         type?: string | null,
>         typeVersion?: number | null,
>         position?: number[] | null,
>         parameters?: Record<string, any> | null,
>         credentials?: Record<string, {
>           id?: string | null | null,
>           name?: string | null,
>           __aiGatewayManaged?: boolean | null
>         }> | null,
>         disabled?: boolean | null,
>         notes?: string | null,
>         notesInFlow?: boolean | null,
>         continueOnFail?: boolean | null,
>         retryOnFail?: boolean | null,
>         maxTries?: number | null,
>         waitBetweenTries?: number | null,
>         alwaysOutputData?: boolean | null,
>         executeOnce?: boolean | null,
>         onError?: string | null,
>         webhookId?: string | null
>       }[] | null,
>       connections?: Record<string, Record<string, (
>         {
>           node?: string | null,
>           type?: string | null,
>           index?: number | null
>         }[] | null
>       )[]>> | null,
>       nodeGroups?: {
>         id?: string | null,
>         name?: string | null,
>         nodeIds?: string[] | null,
>         description?: string | null
>       }[] | null,
>       settings?: Record<string, any> | null,
>       parentFolderId?: string | null | null,
>       isArchived?: boolean | null,
>       tagIds?: string[] | null
>     } | null | null,
>     after?: {
>       id?: string | null,
>       name?: string | null,
>       description?: string | null | null,
>       nodes?: {
>         id?: string | null,
>         name?: string | null,
>         type?: string | null,
>         typeVersion?: number | null,
>         position?: number[] | null,
>         parameters?: Record<string, any> | null,
>         credentials?: Record<string, {
>           id?: string | null | null,
>           name?: string | null,
>           __aiGatewayManaged?: boolean | null
>         }> | null,
>         disabled?: boolean | null,
>         notes?: string | null,
>         notesInFlow?: boolean | null,
>         continueOnFail?: boolean | null,
>         retryOnFail?: boolean | null,
>         maxTries?: number | null,
>         waitBetweenTries?: number | null,
>         alwaysOutputData?: boolean | null,
>         executeOnce?: boolean | null,
>         onError?: string | null,
>         webhookId?: string | null
>       }[] | null,
>       connections?: Record<string, Record<string, (
>         {
>           node?: string | null,
>           type?: string | null,
>           index?: number | null
>         }[] | null
>       )[]>> | null,
>       nodeGroups?: {
>         id?: string | null,
>         name?: string | null,
>         nodeIds?: string[] | null,
>         description?: string | null
>       }[] | null,
>       settings?: Record<string, any> | null,
>       parentFolderId?: string | null | null,
>       isArchived?: boolean | null,
>       tagIds?: string[] | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null
>   } | {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       id?: string | null,
>       name?: string | null,
>       type?: string | null,
>       description?: string | null | null,
>       data?: Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, string | boolean | (recursive)[] | Record<string, (recursive)>>)[] | Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, (recursive)>)[] | Record<string, (recursive)>>> | null,
>       dataIsComplete?: boolean | null
>     } | null | null,
>     after?: {
>       id?: string | null,
>       name?: string | null,
>       type?: string | null,
>       description?: string | null | null,
>       data?: Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, string | boolean | (recursive)[] | Record<string, (recursive)>>)[] | Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, (recursive)>)[] | Record<string, (recursive)>>> | null,
>       dataIsComplete?: boolean | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null
>   } | {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       id?: string | null,
>       name?: string | null,
>       columns?: {
>         id?: string | null,
>         name?: string | null,
>         type?: string | null,
>         index?: number | null
>       }[] | null
>     } | null | null,
>     after?: {
>       id?: string | null,
>       name?: string | null,
>       columns?: {
>         id?: string | null,
>         name?: string | null,
>         type?: string | null,
>         index?: number | null
>       }[] | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null,
>     dataTableChanges?: (
>       {
>         kind?: string | null,
>         column?: string | null,
>         type?: string | null,
>         destructive?: boolean | null
>       } | {
>         kind?: string | null,
>         column?: string | null,
>         type?: string | null,
>         destructive?: boolean | null
>       } | {
>         kind?: string | null,
>         column?: string | null,
>         from?: string | null,
>         to?: string | null,
>         destructive?: boolean | null
>       } | {
>         kind?: string | null,
>         from?: string | null,
>         to?: string | null,
>         destructive?: boolean | null
>       } | {
>         kind?: string | null,
>         destructive?: boolean | null
>       } | {
>         kind?: string | null,
>         from?: string | null,
>         to?: string | null,
>         destructive?: boolean | null
>       }
>     )[] | null
>   } | {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       name?: string | null,
>       type?: string | null,
>       value?: string | null
>     } | null | null,
>     after?: {
>       name?: string | null,
>       type?: string | null,
>       value?: string | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null,
>     valueHidden?: boolean | null
>   } | {
>     key?: string | null,
>     type?: string | null,
>     before?: {
>       id?: string | null,
>       name?: string | null
>     } | null | null,
>     after?: {
>       id?: string | null,
>       name?: string | null
>     } | null | null,
>     revision?: {
>       before?: string | null | null,
>       after?: string | null | null
>     } | null
>   }
> )[] | null
> ```

***

### projects.listChanges

`promotions.projects.listChanges`

Beta: Preview the changes of a project in one direction. Beta — breaking changes may still occur without major version bump. Compares a team project on this instance with the branch of its promotion environment for that direction. For promote the preview is what a promotion sends to the branch, and the key needs the promotions:promote scope. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.projects.listChanges({ projectId: 'VmwOO9HeTEj20kxM', direction: 'apply' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | The ID of the project. |
| `direction` | `apply \| promote` | Yes | The direction of the promotion: apply or promote. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `commitSha` | `string \| null \| null` | No | — |
| `source` | `object \| null` | No | — |
| `environment` | `object \| null` | No | — |
| `resources` | `object[] \| null` | No | — |
| `dependencies` | `object[] \| null` | No | — |
| `blocker` | `object \| null` | No | Set when an open review already holds the changes of this project. The preview then lists no resources. Only a Promote that opens a review on a new branch sets it. |
| `check` | `object \| null` | No | — |
| `revision` | `string \| null` | No | A hash of what this preview shows. Send it as `expectedPreviewRevision` with Promote or Apply to run only when the preview did not change. |

> [accordion] source full type
>
> ```ts theme={null}
> {
>   environmentId?: string | null,
>   branchName?: string | null
> } | null
> ```

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   providerType?: string | null,
>   createBranchOnPromotion?: boolean | null
> } | null
> ```

> [accordion] resources full type
>
> ```ts theme={null}
> {
>   key?: string | null,
>   type?: string | null,
>   id?: string | null,
>   name?: string | null,
>   previousName?: string | null,
>   previousId?: string | null,
>   parentKey?: string | null | null,
>   previousParentKey?: string | null | null,
>   change?: string | null,
>   selectable?: boolean | null,
>   movedToProject?: {
>     id?: string | null,
>     name?: string | null
>   } | null,
>   movedFromProject?: {
>     id?: string | null,
>     name?: string | null
>   } | null,
>   revision?: {
>     before?: string | null | null,
>     after?: string | null | null
>   } | null
> }[] | null
> ```

> [accordion] dependencies full type
>
> ```ts theme={null}
> {
>   workflowKey?: string | null,
>   resourceKey?: string | null,
>   included?: boolean | null
> }[] | null
> ```

> [accordion] blocker full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   reviewId?: string | null
> } | null
> ```

> [accordion] check full type
>
> ```ts theme={null}
> {
>   missingProjects?: {
>     id?: string | null,
>     name?: string | null,
>     icon?: {
>       type?: string | null,
>       value?: string | null
>     } | null,
>     description?: string | null,
>     customTelemetryTags?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   }[] | null,
>   missingBindings?: (
>     {
>       kind?: string | null,
>       sourceId?: string | null,
>       name?: string | null,
>       credentialType?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       ownerProject?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       expressionData?: Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, string | boolean | (recursive)[] | Record<string, (recursive)>>)[] | Record<string, string | boolean | (string | boolean | (recursive)[] | Record<string, (recursive)>)[] | Record<string, (recursive)>>> | null
>     } | {
>       kind?: string | null,
>       name?: string | null,
>       variableType?: string | null,
>       scope?: {
>         kind?: string | null
>       } | {
>         kind?: string | null,
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null
>       } | null,
>       sourceValue?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     }
>   )[] | null,
>   accessRequirements?: {
>     kind?: string | null,
>     sourceId?: string | null,
>     name?: string | null,
>     credentialType?: string | null,
>     consumers?: {
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       workflows?: {
>         id?: string | null,
>         name?: string | null
>       }[] | null
>     }[] | null,
>     code?: string | null
>   }[] | null,
>   conflicts?: (
>     {
>       kind?: string | null,
>       sourceId?: string | null | null,
>       name?: string | null,
>       expectedTypes?: string[] | null,
>       filePath?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null
>     } | {
>       kind?: string | null,
>       sourceId?: string | null | null,
>       name?: string | null,
>       expectedTypes?: string[] | null,
>       filePath?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null
>     } | {
>       kind?: string | null,
>       sourceId?: string | null | null,
>       name?: string | null,
>       expectedTypes?: string[] | null,
>       filePath?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null
>     } | {
>       kind?: string | null,
>       sourceId?: string | null | null,
>       name?: string | null,
>       expectedTypes?: string[] | null,
>       filePath?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null
>     } | {
>       kind?: string | null,
>       sourceId?: string | null | null,
>       name?: string | null,
>       expectedTypes?: string[] | null,
>       filePath?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null,
>       targetType?: string | null
>     } | {
>       kind?: string | null,
>       sourceId?: string | null | null,
>       name?: string | null,
>       expectedTypes?: string[] | null,
>       filePath?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       code?: string | null,
>       usageScope?: string | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       name?: string | null,
>       referenceFiles?: string[] | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       filePath?: string | null,
>       workflows?: {
>         id?: string | null,
>         name?: string | null
>       }[] | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       id?: string | null,
>       name?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null,
>       changes?: (
>         {
>           kind?: string | null,
>           column?: string | null,
>           type?: string | null,
>           destructive?: boolean | null
>         } | {
>           kind?: string | null,
>           column?: string | null,
>           type?: string | null,
>           destructive?: boolean | null
>         } | {
>           kind?: string | null,
>           column?: string | null,
>           from?: string | null,
>           to?: string | null,
>           destructive?: boolean | null
>         } | {
>           kind?: string | null,
>           from?: string | null,
>           to?: string | null,
>           destructive?: boolean | null
>         } | {
>           kind?: string | null,
>           destructive?: boolean | null
>         } | {
>           kind?: string | null,
>           from?: string | null,
>           to?: string | null,
>           destructive?: boolean | null
>         }
>       )[] | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       reason?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       id?: string | null,
>       name?: string | null,
>       reason?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       id?: string | null,
>       name?: string | null,
>       reason?: string | null,
>       consumers?: {
>         project?: {
>           id?: string | null,
>           name?: string | null
>         } | null,
>         workflows?: {
>           id?: string | null,
>           name?: string | null
>         }[] | null
>       }[] | null
>     } | {
>       kind?: string | null,
>       code?: string | null,
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       reason?: string | null
>     } | {
>       id?: string | null,
>       name?: string | null,
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       projectExists?: boolean | null,
>       instanceProject?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       kind?: string | null,
>       code?: string | null
>     }
>   )[] | null,
>   warnings?: {
>     kind?: string | null,
>     code?: string | null,
>     name?: string | null,
>     scope?: {
>       kind?: string | null
>     } | null,
>     consumers?: {
>       project?: {
>         id?: string | null,
>         name?: string | null
>       } | null,
>       workflows?: {
>         id?: string | null,
>         name?: string | null
>       }[] | null
>     }[] | null
>   }[] | null,
>   movedWorkflows?: {
>     id?: string | null,
>     name?: string | null,
>     project?: {
>       id?: string | null,
>       name?: string | null
>     } | null,
>     projectExists?: boolean | null,
>     instanceProject?: {
>       id?: string | null,
>       name?: string | null
>     } | null
>   }[] | null,
>   movedFolders?: {
>     id?: string | null,
>     name?: string | null,
>     project?: {
>       id?: string | null,
>       name?: string | null
>     } | null,
>     projectExists?: boolean | null,
>     instanceProject?: {
>       id?: string | null,
>       name?: string | null
>     } | null
>   }[] | null
> } | null
> ```

***

### projects.promote

`promotions.projects.promote`

Beta: Promote a selection of a project's workflows and folders. Beta — breaking changes may still occur without major version bump. Promotes a chosen set of a team project's workflows and folders to the branch of the project's Promote environment. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.promotions.projects.promote({ projectId: 'VmwOO9HeTEj20kxM' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `projectId` | `string` | Yes | The ID of the project. |
| `workflowIds` | `string[]` | No | — |
| `folderIds` | `string[]` | No | Folders of the project to promote. Promote writes a selected folder with its current name and place, even when it is empty. |
| `credentialIds` | `string[]` | No | Credentials that the project owns, to promote without a selected workflow that uses them. Promote writes a credential under the folder of its owner project. It never writes secret values. |
| `commitMessage` | `string` | No | Message for the promotion commit. If you omit it, the commit uses a generated message. |
| `expectedPreviewRevision` | `string` | No | The `revision` of the reviewed preview. The operation builds the preview again. When it differs, the operation returns status `preview-changed` and changes nothing. |

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   environmentId?: string | null,
>   counts?: {
>     workflows?: number | null,
>     folders?: number | null,
>     credentials?: number | null,
>     dataTables?: number | null,
>     variables?: number | null,
>     tags?: number | null
>   } | null,
>   git?: {
>     commitSha?: string | null,
>     branchName?: string | null
>   } | null,
>   review?: {
>     reviewId?: string | null,
>     number?: number | null,
>     webUrl?: string | null
>   } | null,
>   warnings?: {
>     message?: string | null,
>     linkUrl?: string | null
>   }[] | null,
>   status?: string | null
> } | {
>   status?: string | null,
>   environmentId?: string | null
> }
> ```

***

### providers.create

`promotions.providers.create`

Beta: Create a promotion provider. Beta — breaking changes may still occur without major version bump. Creates a provider and its authentication material. A Git host provider validates authenticated API access before it saves. For GitLab, the service uses n8n as the Git transport username. Its auth.username is optional. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.promotions.providers.create({
	name: 'example',
	type: 'git',
	auth: { authType: 'ssh-key' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `name` | `string` | Yes | — |
| `type` | `git \| gitlab` | Yes | — |
| `auth` | `object` | Yes | — |
| `config` | `object` | No | — |

> [accordion] auth full type
>
> ```ts theme={null}
> {
>   authType: ssh-key,
>   keyType?: ed25519 | rsa
> } | {
>   authType: token,
>   username?: string,
>   password: string
> }
> ```

> [accordion] config full type
>
> ```ts theme={null}
> {
>   schemaVersion: 1,
>   baseUrl: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `provider` | `object \| null` | No | — |
| `publicKey` | `string \| null \| null` | No | — |

> [accordion] provider full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   type?: string | null,
>   authType?: string | null,
>   config?: {
>     schemaVersion?: number | null,
>     publicKey?: string | null,
>     keyType?: string | null
>   } | {
>     schemaVersion?: number | null
>   } | {
>     schemaVersion?: number | null,
>     baseUrl?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null
> ```

***

### providers.delete

`promotions.providers.delete`

Beta: Delete a promotion provider. Beta — breaking changes may still occur without major version bump. A provider used by an environment cannot be deleted. Requires the promotions:manageProviders API key scope. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.promotions.providers.delete({ promotionProviderId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `promotionProviderId` | `string` | Yes | The ID of the promotion provider. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### providers.get

`promotions.providers.get`

Beta: Retrieve a promotion provider. Beta — breaking changes may still occur without major version bump. Returns the provider with its public configuration. Secrets are never returned. Requires the promotions:readProviders API key scope. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.providers.get({ promotionProviderId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `promotionProviderId` | `string` | Yes | The ID of the promotion provider. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `authType` | `string \| null` | No | — |
| `config` | `object \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] config full type
>
> ```ts theme={null}
> {
>   schemaVersion?: number | null,
>   publicKey?: string | null,
>   keyType?: string | null
> } | {
>   schemaVersion?: number | null
> } | {
>   schemaVersion?: number | null,
>   baseUrl?: string | null
> } | null
> ```

***

### providers.list

`promotions.providers.list`

Beta: List promotion providers. Beta — breaking changes may still occur without major version bump. Returns a cursor-paginated list of providers, without their public configuration. Requires the promotions:readProviders API key scope. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.providers.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   type?: string | null,
>   authType?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### providers.listBranches

`promotions.providers.listBranches`

Beta: List branches of a promotion repository. Beta — breaking changes may still occur without major version bump. Lists branches of the selected GitLab repository and identifies its default branch. Pass the URL-encoded fullPath from repository discovery, or the repositoryPath of a saved GitLab environment, as repositoryId. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.providers.listBranches({ promotionProviderId: 'example', repositoryId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `promotionProviderId` | `string` | Yes | The ID of the promotion provider. |
| `repositoryId` | `string` | Yes | The URL-encoded fullPath of the repository. A GitLab project ID is also accepted. |
| `search` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

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

***

### providers.listRepositories

`promotions.providers.listRepositories`

Beta: List repositories of a promotion provider. Beta — breaking changes may still occur without major version bump. Lists repositories where the GitLab token identity has at least the Developer role. The token also needs Git write scope for promotions. Protected branches can restrict pushes. Use remoteUrl as an environment remote. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.providers.listRepositories({ promotionProviderId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `promotionProviderId` | `string` | Yes | The ID of the promotion provider. |
| `search` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   fullPath?: string | null,
>   remoteUrl?: string | null,
>   defaultBranch?: string | null | null
> }[] | null
> ```

***

### providers.update

`promotions.providers.update`

Beta: Update a promotion provider. Beta — breaking changes may still occur without major version bump. Renames the provider, and replaces its credentials when auth is sent. A Git host provider can also update its base URL. A different API destination requires auth in the same request. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.promotions.providers.update({ promotionProviderId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `promotionProviderId` | `string` | Yes | The ID of the promotion provider. |
| `name` | `string` | No | — |
| `auth` | `object` | No | — |
| `config` | `object` | No | — |

> [accordion] auth full type
>
> ```ts theme={null}
> {
>   authType: ssh-key,
>   keyType?: ed25519 | rsa
> } | {
>   authType: token,
>   username?: string,
>   password: string
> }
> ```

> [accordion] config full type
>
> ```ts theme={null}
> {
>   schemaVersion: 1,
>   baseUrl: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `authType` | `string \| null` | No | — |
| `config` | `object \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] config full type
>
> ```ts theme={null}
> {
>   schemaVersion?: number | null,
>   publicKey?: string | null,
>   keyType?: string | null
> } | {
>   schemaVersion?: number | null
> } | {
>   schemaVersion?: number | null,
>   baseUrl?: string | null
> } | null
> ```

***

### reviews.get

`promotions.reviews.get`

Beta: Retrieve a promotion review. Beta — breaking changes may still occur without major version bump. Returns one promotion review with the same fields as the list. Reads the merge request from the Git host now. Returns 404 when the Inbox of the key owner does not show the review. Requires the promotions:readReviews API key scope. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403. Added in n8n 2.50; older instances answer 404.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.reviews.get({ promotionReviewId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `promotionReviewId` | `string` | Yes | The ID of the promotion review. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `state` | `string \| null` | No | The Inbox tab of the review. `closed` covers the merged and the closed reviews. |
| `reviewState` | `string \| null` | No | The state of the review. `open` and `changes_requested` come from the Git host. `merged` and `closed` are final. |
| `reviewType` | `string \| null` | No | — |
| `title` | `string \| null \| null` | No | — |
| `webUrl` | `string \| null \| null` | No | — |
| `branchName` | `string \| null \| null` | No | — |
| `environmentName` | `string \| null \| null` | No | — |
| `requester` | `object \| null` | No | — |
| `approver` | `object \| null` | No | — |
| `remoteError` | `string \| null \| null` | No | Why the Git host data is missing. Then `title`, `webUrl` and `headCommitSha` are NULL, and `hasConflicts` is false without a check. NULL when the Git host answered. |
| `headCommitSha` | `string \| null \| null` | No | The head of the merge request on the Git host. It differs from `runCommitSha` after a push on the Git host. |
| `runCommitSha` | `string \| null \| null` | No | The commit that n8n pushed in the newest promotion. |
| `hasConflicts` | `boolean \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

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

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

***

### reviews.list

`promotions.reviews.list`

Beta: List promotion reviews. Beta — breaking changes may still occur without major version bump. Returns the promotion reviews that the Inbox of the key owner shows. Instance owners and admins see all reviews. state selects the open or the closed reviews, as the Inbox tabs do. The list starts with the newest activity. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403. Added in n8n 2.50; older instances answer 404.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.reviews.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `state` | `open \| closed` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   state?: string | null,
>   reviewState?: string | null,
>   reviewType?: string | null,
>   title?: string | null | null,
>   webUrl?: string | null | null,
>   branchName?: string | null | null,
>   environmentName?: string | null | null,
>   requester?: {
>     id?: string | null,
>     firstName?: string | null | null,
>     lastName?: string | null | null,
>     email?: string | null | null
>   } | null | null,
>   approver?: {
>     id?: string | null,
>     firstName?: string | null | null,
>     lastName?: string | null | null,
>     email?: string | null | null
>   } | null | null,
>   remoteError?: string | null | null,
>   headCommitSha?: string | null | null,
>   runCommitSha?: string | null | null,
>   hasConflicts?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### settings.get

`promotions.settings.get`

Beta: Get the promotion settings. Beta — breaking changes may still occur without major version bump. Returns who can promote, approve, and apply in their own projects, and whether every promote needs a review. Instance owners and admins can always promote, approve, and apply. Requires the securitySettings:manage API key scope. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403. Added in n8n 2.50; older instances answer 404.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.promotions.settings.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `whoCanPromote` | `string \| null` | No | Who can promote a project and see its promotion reviews. `instanceAdmins`: only instance owners and admins. `projectAdmins`: also project admins, in their projects. `projectAdminsAndEditors`: also project admins and editors, in their projects. |
| `whoCanApprove` | `string \| null` | No | Who can see and approve the promotion reviews of a project. `instanceAdmins`: only instance owners and admins. `projectAdmins`: also project admins, in their projects. `projectAdminsAndEditors`: also project admins and editors, in their projects. |
| `whoCanApply` | `string \| null` | No | Who can apply changes into a project. `instanceAdmins`: only instance owners and admins. `projectAdmins`: also project admins, in their projects. `projectAdminsAndEditors`: also project admins and editors, in their projects. |
| `requireApproval` | `string \| null` | No | Whether a promote needs a review. `whenConfigured`: each Promote environment uses its own review setting. `alwaysRequired`: every promote pushes a new branch. With a `gitlab` provider, it also opens a merge request. With a `git` provider, n8n cannot see the review and cannot stop direct pushes. |

***

### settings.update

`promotions.settings.update`

Beta: Update the promotion settings. Beta — breaking changes may still occur without major version bump. Changes who can promote, approve, and apply in their own projects, and whether every promote needs a review. Send only the settings to change. A setting that you leave out keeps its value. Needs a licence with feat:promotions (Business or Enterprise plans): without it n8n answers 403. Added in n8n 2.50; older instances answer 404.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.promotions.settings.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `whoCanPromote` | `instanceAdmins \| projectAdmins \| projectAdminsAndEditors` | No | Who can promote a project and see its promotion reviews. `instanceAdmins`: only instance owners and admins. `projectAdmins`: also project admins, in their projects. `projectAdminsAndEditors`: also project admins and editors, in their projects. |
| `whoCanApprove` | `instanceAdmins \| projectAdmins \| projectAdminsAndEditors` | No | Who can see and approve the promotion reviews of a project. `instanceAdmins`: only instance owners and admins. `projectAdmins`: also project admins, in their projects. `projectAdminsAndEditors`: also project admins and editors, in their projects. |
| `whoCanApply` | `instanceAdmins \| projectAdmins \| projectAdminsAndEditors` | No | Who can apply changes into a project. `instanceAdmins`: only instance owners and admins. `projectAdmins`: also project admins, in their projects. `projectAdminsAndEditors`: also project admins and editors, in their projects. |
| `requireApproval` | `whenConfigured \| alwaysRequired` | No | Whether a promote needs a review. `whenConfigured`: each Promote environment uses its own review setting. `alwaysRequired`: every promote pushes a new branch. With a `gitlab` provider, it also opens a merge request. With a `git` provider, n8n cannot see the review and cannot stop direct pushes. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `whoCanPromote` | `string \| null` | No | Who can promote a project and see its promotion reviews. `instanceAdmins`: only instance owners and admins. `projectAdmins`: also project admins, in their projects. `projectAdminsAndEditors`: also project admins and editors, in their projects. |
| `whoCanApprove` | `string \| null` | No | Who can see and approve the promotion reviews of a project. `instanceAdmins`: only instance owners and admins. `projectAdmins`: also project admins, in their projects. `projectAdminsAndEditors`: also project admins and editors, in their projects. |
| `whoCanApply` | `string \| null` | No | Who can apply changes into a project. `instanceAdmins`: only instance owners and admins. `projectAdmins`: also project admins, in their projects. `projectAdminsAndEditors`: also project admins and editors, in their projects. |
| `requireApproval` | `string \| null` | No | Whether a promote needs a review. `whenConfigured`: each Promote environment uses its own review setting. `alwaysRequired`: every promote pushes a new branch. With a `gitlab` provider, it also opens a merge request. With a `git` provider, n8n cannot see the review and cannot stop direct pushes. |

***

## Role Mapping Rules

### create

`roleMappingRules.create`

Create a role-mapping rule. Creates a rule that maps an identity-provider claim expression to a role. Set type to instance for a rule granting a global role, or project for a rule granting a project role on the projects named in projectIds. Omitting order appends the rule to the end of the evaluation order for its type. Needs a licence with provisioning (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.roleMappingRules.create({ expression: 'example', role: 'example', type: 'instance' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `expression` | `string` | Yes | — |
| `role` | `string` | Yes | — |
| `type` | `instance \| project` | Yes | — |
| `order` | `number` | No | — |
| `projectIds` | `string[]` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `expression` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `order` | `number \| null` | No | — |
| `projectIds` | `string[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### delete

`roleMappingRules.delete`

Delete a role-mapping rule. Deletes a role-mapping rule. The remaining rules of the same type close the gap, so their order values stay a contiguous sequence starting at 0. Requires the roleMappingRule:delete API key scope. Needs a licence with provisioning (Business or Enterprise plans): without it n8n answers 403. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.roleMappingRules.delete({ roleMappingRuleId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `roleMappingRuleId` | `string` | Yes | The ID of the role mapping rule. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `expression` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `order` | `number \| null` | No | — |
| `projectIds` | `string[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### list

`roleMappingRules.list`

Retrieve role-mapping rules. Returns the configured role-mapping rules. order is the rule's evaluation position within its own type, so instance and project rules each have their own sequence starting at 0 — filter by type to retrieve a single evaluation order. Requires the roleMappingRule:list API key scope. Needs a licence with provisioning (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.roleMappingRules.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `type` | `instance \| project` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   expression?: string | null,
>   role?: string | null,
>   type?: string | null,
>   order?: number | null,
>   projectIds?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### move

`roleMappingRules.move`

Move a role-mapping rule. Changes a rule's position in the evaluation order for its type. targetIndex is the desired 0-based position within the rule's own type sequence; a value beyond the last position moves the rule to the end. Requires the roleMappingRule:update API key scope. Needs a licence with provisioning (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.roleMappingRules.move({ roleMappingRuleId: 'example', targetIndex: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `roleMappingRuleId` | `string` | Yes | The ID of the role mapping rule. |
| `targetIndex` | `number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `expression` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `order` | `number \| null` | No | — |
| `projectIds` | `string[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### update

`roleMappingRules.update`

Update a role-mapping rule. Updates a rule's claim expression, role, and/or project assignments. A rule's type cannot be changed once created, so type isn't accepted here, and reordering is handled by the move endpoint. Requires the roleMappingRule:update API key scope. Needs a licence with provisioning (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.roleMappingRules.update({ roleMappingRuleId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `roleMappingRuleId` | `string` | Yes | The ID of the role mapping rule. |
| `expression` | `string` | No | — |
| `role` | `string` | No | — |
| `projectIds` | `string[]` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `expression` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `order` | `number \| null` | No | — |
| `projectIds` | `string[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

## Roles

### create

`roles.create`

Create a custom role. Creates a custom role. Set roleType to global for an instance-wide role or project for a project role. Requires one of these API key scopes: role:manage, role:manageProject. Needs a licence with feat:customRoles (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.roles.create({
	displayName: 'example',
	roleType: 'project',
	scopes: ['example'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `displayName` | `string` | Yes | — |
| `description` | `string` | No | — |
| `roleType` | `project \| global` | Yes | — |
| `scopes` | `string[]` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `slug` | `string \| null` | No | — |
| `displayName` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `systemRole` | `boolean \| null` | No | — |
| `roleType` | `string \| null` | No | — |
| `scopes` | `string[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### delete

`roles.delete`

Delete a custom role. Deletes a custom role. System roles cannot be deleted. A role with users assigned cannot be deleted unless reassignRoleSlug is set to move those users to another role first. Requires one of these API key scopes: role:manage, role:manageProject. Needs a licence with feat:customRoles (Business or Enterprise plans): without it n8n answers 403. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.roles.delete({ roleSlug: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `roleSlug` | `string` | Yes | The slug of the role. |
| `reassignRoleSlug` | `global:admin \| global:member \| global:chatUser \| string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `slug` | `string \| null` | No | — |
| `displayName` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `systemRole` | `boolean \| null` | No | — |
| `roleType` | `string \| null` | No | — |
| `scopes` | `string[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### get

`roles.get`

Retrieve a role. Returns a single role with its scopes. Set withUsageCount to include how many users and projects use the role. Requires the role:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.roles.get({ roleSlug: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `roleSlug` | `string` | Yes | The slug of the role. |
| `withUsageCount` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `slug` | `string \| null` | No | — |
| `displayName` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `systemRole` | `boolean \| null` | No | — |
| `roleType` | `string \| null` | No | — |
| `scopes` | `string[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `licensed` | `boolean \| null` | No | — |
| `usedByUsers` | `number \| null` | No | — |
| `usedByProjects` | `number \| null` | No | — |

***

### list

`roles.list`

Retrieve all roles. Returns all roles grouped by type (global and project). Set withUsageCount to include how many users and projects use each role. Requires the role:list API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.roles.list({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `global` | `object[] \| null` | No | — |
| `project` | `object[] \| null` | No | — |

> [accordion] global full type
>
> ```ts theme={null}
> {
>   slug?: string | null,
>   displayName?: string | null,
>   description?: string | null | null,
>   systemRole?: boolean | null,
>   roleType?: string | null,
>   scopes?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   licensed?: boolean | null,
>   usedByUsers?: number | null,
>   usedByProjects?: number | null
> }[] | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   slug?: string | null,
>   displayName?: string | null,
>   description?: string | null | null,
>   systemRole?: boolean | null,
>   roleType?: string | null,
>   scopes?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   licensed?: boolean | null,
>   usedByUsers?: number | null,
>   usedByProjects?: number | null
> }[] | null
> ```

***

### update

`roles.update`

Update a custom role. Replaces a custom role's display name, description, and scopes. System roles cannot be updated. Requires one of these API key scopes: role:manage, role:manageProject. Needs a licence with feat:customRoles (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.roles.update({
	roleSlug: 'example',
	displayName: 'example',
	description: 'example',
	scopes: ['example'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `roleSlug` | `string` | Yes | The slug of the role. |
| `displayName` | `string` | Yes | — |
| `description` | `string \| null` | Yes | — |
| `scopes` | `string[]` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `slug` | `string \| null` | No | — |
| `displayName` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `systemRole` | `boolean \| null` | No | — |
| `roleType` | `string \| null` | No | — |
| `scopes` | `string[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

## Settings

### ldap.get

`settings.ldap.get`

Retrieve the LDAP configuration. Retrieve the current LDAP configuration, including every field exposed in the UI. The binding admin password is redacted on read. Requires the LDAP feature to be licensed. Requires the ldap:manage API key scope. Needs a licence with feat:ldap (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.settings.ldap.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `loginEnabled` | `boolean \| null` | No | Whether LDAP login is enabled. |
| `loginLabel` | `string \| null` | No | Label shown on the LDAP login button. |
| `connectionUrl` | `string \| null` | No | LDAP server URL. |
| `allowUnauthorizedCerts` | `boolean \| null` | No | Whether to allow unauthorized (self-signed) certificates. |
| `connectionSecurity` | `string \| null` | No | TLS/SSL security mode for the LDAP connection. |
| `connectionPort` | `number \| null` | No | LDAP server port. |
| `baseDn` | `string \| null` | No | Base DN for LDAP search queries. |
| `bindingAdminDn` | `string \| null` | No | DN of the LDAP admin user for binding. |
| `bindingAdminPassword` | `string \| null` | No | Password for the LDAP admin user. Redacted on GET; returns the blanking placeholder when a password is stored, empty string when unset. Send the blanking placeholder from a prior GET to keep the stored password unchanged. |
| `firstNameAttribute` | `string \| null` | No | LDAP attribute mapped to the user's first name. |
| `lastNameAttribute` | `string \| null` | No | LDAP attribute mapped to the user's last name. |
| `emailAttribute` | `string \| null` | No | LDAP attribute mapped to the user's email. |
| `loginIdAttribute` | `string \| null` | No | LDAP attribute used for login (usually the same as emailAttribute). |
| `ldapIdAttribute` | `string \| null` | No | LDAP attribute that uniquely identifies a user. |
| `userFilter` | `string \| null` | No | Additional LDAP filter to apply when searching for users. Use an empty string for no additional filter. |
| `synchronizationEnabled` | `boolean \| null` | No | Whether automatic LDAP synchronization is enabled. |
| `synchronizationInterval` | `number \| null` | No | Interval in minutes between automatic synchronizations. Ignored if synchronizationEnabled is false. |
| `searchPageSize` | `number \| null` | No | Number of LDAP entries to fetch per search page. |
| `searchTimeout` | `number \| null` | No | LDAP search timeout in seconds. |
| `enforceEmailUniqueness` | `boolean \| null` | No | Whether to enforce that email addresses are unique across LDAP users. When true, if two users have the same email, only the first will be imported. |
| `linkExistingAccountsByEmail` | `boolean \| null` | No | Whether an LDAP user may be linked to an existing n8n account that has the same email. When false, login and synchronization skip such users. Optional on PUT; the stored value is kept when omitted. |

***

### ldap.listSyncs

`settings.ldap.listSyncs`

Retrieve LDAP synchronization history. Retrieve the history of LDAP synchronizations, most recent first. Requires the LDAP feature to be licensed. Requires the ldap:sync API key scope. Needs a licence with feat:ldap (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.settings.ldap.listSyncs({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | Paginate through the synchronization history by setting the cursor parameter to the nextCursor attribute returned by the previous request. A null value means there are no more records. |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   runMode?: string | null,
>   status?: string | null,
>   startedAt?: string | null,
>   endedAt?: string | null,
>   scanned?: number | null,
>   created?: number | null,
>   updated?: number | null,
>   disabled?: number | null,
>   error?: string | null
> }[] | null
> ```

***

### ldap.runSync

`settings.ldap.runSync`

Trigger an LDAP synchronization. Manually trigger an LDAP synchronization. The response returns the new sync history record. Requires the LDAP feature to be licensed. Requires the ldap:sync API key scope. Needs a licence with feat:ldap (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.settings.ldap.runSync({ type: 'live' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `type` | `live \| dry` | Yes | Type of synchronization. 'live' applies changes to the database. 'dry' performs a test run and does not persist changes. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | Unique identifier for this sync run. |
| `runMode` | `string \| null` | No | Whether the sync was a dry run or applied live. |
| `status` | `string \| null` | No | Status of the synchronization (for example, success or error). |
| `startedAt` | `string \| null` | No | Timestamp when the synchronization started. |
| `endedAt` | `string \| null` | No | Timestamp when the synchronization completed. |
| `scanned` | `number \| null` | No | Number of LDAP entries scanned during synchronization. |
| `created` | `number \| null` | No | Number of new users created during synchronization. |
| `updated` | `number \| null` | No | Number of existing users updated during synchronization. |
| `disabled` | `number \| null` | No | Number of users disabled during synchronization. |
| `error` | `string \| null` | No | Error message if the synchronization failed. Empty string if successful. |

***

### ldap.update

`settings.ldap.update`

Set the LDAP configuration. Replace the LDAP configuration with the provided full object (partial updates are not supported). For bindingAdminPassword, submit the blanking placeholder from a prior GET to keep the stored password unchanged. Requires the LDAP feature to be licensed. Needs a licence with feat:ldap (Business or Enterprise plans): without it n8n answers 403.

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

```ts theme={null}
await corsair.n8n.api.settings.ldap.update({
	loginEnabled: true,
	loginLabel: 'example',
	connectionUrl: 'https://example.com/callback',
	allowUnauthorizedCerts: true,
	connectionSecurity: 'none',
	connectionPort: 1,
	baseDn: 'example',
	bindingAdminDn: 'example',
	bindingAdminPassword: 'example',
	firstNameAttribute: 'example',
	lastNameAttribute: 'example',
	emailAttribute: 'ada@example.com',
	loginIdAttribute: 'example',
	ldapIdAttribute: 'example',
	userFilter: 'example',
	synchronizationEnabled: true,
	synchronizationInterval: 1,
	searchPageSize: 1,
	searchTimeout: 1,
	enforceEmailUniqueness: true,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `loginEnabled` | `boolean` | Yes | Whether LDAP login is enabled. Setting this to false is destructive — it deletes all stored LDAP user identities and disables synchronization. |
| `loginLabel` | `string` | Yes | Label shown on the LDAP login button. |
| `connectionUrl` | `string` | Yes | LDAP server URL. |
| `allowUnauthorizedCerts` | `boolean` | Yes | Whether to allow unauthorized (self-signed) certificates. |
| `connectionSecurity` | `none \| tls \| startTls` | Yes | TLS/SSL security mode for the LDAP connection. |
| `connectionPort` | `number` | Yes | LDAP server port. |
| `baseDn` | `string` | Yes | Base DN for LDAP search queries. |
| `bindingAdminDn` | `string` | Yes | DN of the LDAP admin user for binding. |
| `bindingAdminPassword` | `string` | Yes | Password for the LDAP admin user. To keep an existing password unchanged, submit the blanking placeholder from a prior GET response. Use an empty string to clear the password. |
| `firstNameAttribute` | `string` | Yes | LDAP attribute mapped to the user's first name. |
| `lastNameAttribute` | `string` | Yes | LDAP attribute mapped to the user's last name. |
| `emailAttribute` | `string` | Yes | LDAP attribute mapped to the user's email. |
| `loginIdAttribute` | `string` | Yes | LDAP attribute used for login (usually the same as emailAttribute). |
| `ldapIdAttribute` | `string` | Yes | LDAP attribute that uniquely identifies a user. |
| `userFilter` | `string` | Yes | Additional LDAP filter to apply when searching for users. Use an empty string for no additional filter. |
| `synchronizationEnabled` | `boolean` | Yes | Whether automatic LDAP synchronization is enabled. |
| `synchronizationInterval` | `number` | Yes | Interval in minutes between automatic synchronizations. Ignored if synchronizationEnabled is false. |
| `searchPageSize` | `number` | Yes | Number of LDAP entries to fetch per search page. |
| `searchTimeout` | `number` | Yes | LDAP search timeout in seconds. |
| `enforceEmailUniqueness` | `boolean` | Yes | Whether to enforce that email addresses are unique across LDAP users. When true, if two users have the same email, only the first will be imported. |
| `linkExistingAccountsByEmail` | `boolean` | No | Whether an LDAP user may be linked to an existing n8n account that has the same email. When false, login and synchronization skip such users. Optional on PUT; the stored value is kept when omitted. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `loginEnabled` | `boolean \| null` | No | Whether LDAP login is enabled. |
| `loginLabel` | `string \| null` | No | Label shown on the LDAP login button. |
| `connectionUrl` | `string \| null` | No | LDAP server URL. |
| `allowUnauthorizedCerts` | `boolean \| null` | No | Whether to allow unauthorized (self-signed) certificates. |
| `connectionSecurity` | `string \| null` | No | TLS/SSL security mode for the LDAP connection. |
| `connectionPort` | `number \| null` | No | LDAP server port. |
| `baseDn` | `string \| null` | No | Base DN for LDAP search queries. |
| `bindingAdminDn` | `string \| null` | No | DN of the LDAP admin user for binding. |
| `bindingAdminPassword` | `string \| null` | No | Password for the LDAP admin user. Redacted on GET; returns the blanking placeholder when a password is stored, empty string when unset. Send the blanking placeholder from a prior GET to keep the stored password unchanged. |
| `firstNameAttribute` | `string \| null` | No | LDAP attribute mapped to the user's first name. |
| `lastNameAttribute` | `string \| null` | No | LDAP attribute mapped to the user's last name. |
| `emailAttribute` | `string \| null` | No | LDAP attribute mapped to the user's email. |
| `loginIdAttribute` | `string \| null` | No | LDAP attribute used for login (usually the same as emailAttribute). |
| `ldapIdAttribute` | `string \| null` | No | LDAP attribute that uniquely identifies a user. |
| `userFilter` | `string \| null` | No | Additional LDAP filter to apply when searching for users. Use an empty string for no additional filter. |
| `synchronizationEnabled` | `boolean \| null` | No | Whether automatic LDAP synchronization is enabled. |
| `synchronizationInterval` | `number \| null` | No | Interval in minutes between automatic synchronizations. Ignored if synchronizationEnabled is false. |
| `searchPageSize` | `number \| null` | No | Number of LDAP entries to fetch per search page. |
| `searchTimeout` | `number \| null` | No | LDAP search timeout in seconds. |
| `enforceEmailUniqueness` | `boolean \| null` | No | Whether to enforce that email addresses are unique across LDAP users. When true, if two users have the same email, only the first will be imported. |
| `linkExistingAccountsByEmail` | `boolean \| null` | No | Whether an LDAP user may be linked to an existing n8n account that has the same email. When false, login and synchronization skip such users. Optional on PUT; the stored value is kept when omitted. |

***

### logStreaming.createDestination

`settings.logStreaming.createDestination`

Create a log streaming destination. Create a log streaming destination. The destination takes effect exactly as it would from the UI, using the same validation. Requires the Log Streaming feature to be licensed. Needs a licence with feat:logStreaming (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.settings.logStreaming.createDestination({ type: 'webhook' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `label` | `string` | No | Human-readable name shown in the UI. |
| `enabled` | `boolean` | No | Whether the destination currently receives events. |
| `subscribedEvents` | `string[]` | No | Event names (or group prefixes, e.g. `n8n.workflow`, which matches all `n8n.workflow.*` events) this destination receives. Retrieve the full list of streamable event names from `GET /settings/log-streaming/event-types`. |
| `anonymizeAuditMessages` | `boolean` | No | Whether audit message payloads are anonymized before being sent. |
| `circuitBreaker` | `object` | No | Circuit-breaker tuning for delivery. After repeated failures the destination stops sending for a cool-down window instead of hammering an unhealthy target. All fields are optional; sensible defaults apply when omitted. |
| `type` | `webhook \| syslog \| sentry` | Yes | Sends each event as an HTTP request to a URL. |
| `url` | `string` | No | Target URL that receives the event payload. |
| `method` | `string` | No | HTTP method used for the request. |
| `sendHeaders` | `boolean` | No | Whether to attach custom headers to the request. |
| `specifyHeaders` | `string` | No | How custom headers are provided — `keypair` or `json`. |
| `headerParameters` | `object` | No | Key-value pairs used when the matching `specify*` field is `keypair`. |
| `jsonHeaders` | `string` | No | Custom headers as a JSON string when `specifyHeaders` is `json`. |
| `sendQuery` | `boolean` | No | Whether to attach query parameters to the request. |
| `specifyQuery` | `string` | No | How query parameters are provided — `keypair` or `json`. |
| `queryParameters` | `object` | No | Key-value pairs used when the matching `specify*` field is `keypair`. |
| `jsonQuery` | `string` | No | Query parameters as a JSON string when `specifyQuery` is `json`. |
| `options` | `object` | No | Additional HTTP request options. |
| `host` | `string` | No | Syslog server host. |
| `port` | `number` | No | Syslog server port. |
| `protocol` | `udp \| tcp \| tls` | No | Transport protocol. |
| `facility` | `number` | No | Syslog facility code (0–23, per RFC 5424). Common values: 0 Kernel, 1 User, 3 System, 13 Audit, 14 Alert, 16 Local0, 17 Local1, 18 Local2, 19 Local3, 20 Local4, 21 Local5, 22 Local6, 23 Local7. |
| `app_name` | `string` | No | Application name reported in the syslog message. |
| `tlsCa` | `string` | No | PEM-encoded CA certificate used when `protocol` is `tls`. |
| `dsn` | `string` | No | Sentry DSN the events are sent to. |

> [accordion] circuitBreaker full type
>
> ```ts theme={null}
> {
>   maxFailures?: number,
>   failureWindow?: number
> }
> ```

> [accordion] headerParameters full type
>
> ```ts theme={null}
> {
>   parameters: {
>     name: string,
>     value: string | number | boolean | any | any
>   }[]
> }
> ```

> [accordion] queryParameters full type
>
> ```ts theme={null}
> {
>   parameters: {
>     name: string,
>     value: string | number | boolean | any | any
>   }[]
> }
> ```

> [accordion] options full type
>
> ```ts theme={null}
> {
>   timeout?: number,
>   allowUnauthorizedCerts?: boolean,
>   queryParameterArrays?: indices | brackets | repeat,
>   redirect?: {
>     redirect: {
>       followRedirects?: boolean,
>       maxRedirects?: number
>     }
>   },
>   proxy?: {
>     proxy: {
>       protocol: https | http,
>       host: string,
>       port: number
>     }
>   },
>   socket?: {
>     keepAlive?: boolean,
>     maxSockets?: number,
>     maxFreeSockets?: number
>   }
> }
> ```

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   label?: string | null,
>   enabled?: boolean | null,
>   subscribedEvents?: string[] | null,
>   anonymizeAuditMessages?: boolean | null,
>   circuitBreaker?: {
>     maxFailures?: number | null,
>     failureWindow?: number | null
>   } | null,
>   type?: string | null,
>   url?: string | null,
>   method?: string | null,
>   sendHeaders?: boolean | null,
>   specifyHeaders?: string | null,
>   headerParameters?: {
>     parameters?: {
>       name?: string | null,
>       value?: string | number | boolean | any | any | null
>     }[] | null
>   } | null,
>   jsonHeaders?: string | null,
>   sendQuery?: boolean | null,
>   specifyQuery?: string | null,
>   queryParameters?: {
>     parameters?: {
>       name?: string | null,
>       value?: string | number | boolean | any | any | null
>     }[] | null
>   } | null,
>   jsonQuery?: string | null,
>   options?: {
>     timeout?: number | null,
>     allowUnauthorizedCerts?: boolean | null,
>     queryParameterArrays?: string | null,
>     redirect?: {
>       redirect?: {
>         followRedirects?: boolean | null,
>         maxRedirects?: number | null
>       } | null
>     } | null,
>     proxy?: {
>       proxy?: {
>         protocol?: string | null,
>         host?: string | null,
>         port?: number | null
>       } | null
>     } | null,
>     socket?: {
>       keepAlive?: boolean | null,
>       maxSockets?: number | null,
>       maxFreeSockets?: number | null
>     } | null
>   } | null,
>   id?: string | null
> } | {
>   label?: string | null,
>   enabled?: boolean | null,
>   subscribedEvents?: string[] | null,
>   anonymizeAuditMessages?: boolean | null,
>   circuitBreaker?: {
>     maxFailures?: number | null,
>     failureWindow?: number | null
>   } | null,
>   type?: string | null,
>   host?: string | null,
>   port?: number | null,
>   protocol?: string | null,
>   facility?: number | null,
>   app_name?: string | null,
>   tlsCa?: string | null,
>   id?: string | null
> } | {
>   label?: string | null,
>   enabled?: boolean | null,
>   subscribedEvents?: string[] | null,
>   anonymizeAuditMessages?: boolean | null,
>   circuitBreaker?: {
>     maxFailures?: number | null,
>     failureWindow?: number | null
>   } | null,
>   type?: string | null,
>   dsn?: string | null,
>   id?: string | null
> }
> ```

***

### logStreaming.deleteDestination

`settings.logStreaming.deleteDestination`

Delete a log streaming destination. Remove a log streaming destination. Requires the Log Streaming feature to be licensed. When destinations are managed via environment variables, the delete is rejected with 409 and nothing is removed; reads still return the current values. Requires the eventBusDestination:delete API key scope. Needs a licence with feat:logStreaming (Business or Enterprise plans): without it n8n answers 403. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.settings.logStreaming.deleteDestination({ destinationId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `destinationId` | `string` | Yes | The id of the log streaming destination. |

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   label?: string | null,
>   enabled?: boolean | null,
>   subscribedEvents?: string[] | null,
>   anonymizeAuditMessages?: boolean | null,
>   circuitBreaker?: {
>     maxFailures?: number | null,
>     failureWindow?: number | null
>   } | null,
>   type?: string | null,
>   url?: string | null,
>   method?: string | null,
>   sendHeaders?: boolean | null,
>   specifyHeaders?: string | null,
>   headerParameters?: {
>     parameters?: {
>       name?: string | null,
>       value?: string | number | boolean | any | any | null
>     }[] | null
>   } | null,
>   jsonHeaders?: string | null,
>   sendQuery?: boolean | null,
>   specifyQuery?: string | null,
>   queryParameters?: {
>     parameters?: {
>       name?: string | null,
>       value?: string | number | boolean | any | any | null
>     }[] | null
>   } | null,
>   jsonQuery?: string | null,
>   options?: {
>     timeout?: number | null,
>     allowUnauthorizedCerts?: boolean | null,
>     queryParameterArrays?: string | null,
>     redirect?: {
>       redirect?: {
>         followRedirects?: boolean | null,
>         maxRedirects?: number | null
>       } | null
>     } | null,
>     proxy?: {
>       proxy?: {
>         protocol?: string | null,
>         host?: string | null,
>         port?: number | null
>       } | null
>     } | null,
>     socket?: {
>       keepAlive?: boolean | null,
>       maxSockets?: number | null,
>       maxFreeSockets?: number | null
>     } | null
>   } | null,
>   id?: string | null
> } | {
>   label?: string | null,
>   enabled?: boolean | null,
>   subscribedEvents?: string[] | null,
>   anonymizeAuditMessages?: boolean | null,
>   circuitBreaker?: {
>     maxFailures?: number | null,
>     failureWindow?: number | null
>   } | null,
>   type?: string | null,
>   host?: string | null,
>   port?: number | null,
>   protocol?: string | null,
>   facility?: number | null,
>   app_name?: string | null,
>   tlsCa?: string | null,
>   id?: string | null
> } | {
>   label?: string | null,
>   enabled?: boolean | null,
>   subscribedEvents?: string[] | null,
>   anonymizeAuditMessages?: boolean | null,
>   circuitBreaker?: {
>     maxFailures?: number | null,
>     failureWindow?: number | null
>   } | null,
>   type?: string | null,
>   dsn?: string | null,
>   id?: string | null
> }
> ```

***

### logStreaming.getDestination

`settings.logStreaming.getDestination`

Retrieve a log streaming destination. Retrieve a single log streaming destination by id. Requires the Log Streaming feature to be licensed. Requires the eventBusDestination:read API key scope. Needs a licence with feat:logStreaming (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.settings.logStreaming.getDestination({ destinationId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `destinationId` | `string` | Yes | The id of the log streaming destination. |

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   label?: string | null,
>   enabled?: boolean | null,
>   subscribedEvents?: string[] | null,
>   anonymizeAuditMessages?: boolean | null,
>   circuitBreaker?: {
>     maxFailures?: number | null,
>     failureWindow?: number | null
>   } | null,
>   type?: string | null,
>   url?: string | null,
>   method?: string | null,
>   sendHeaders?: boolean | null,
>   specifyHeaders?: string | null,
>   headerParameters?: {
>     parameters?: {
>       name?: string | null,
>       value?: string | number | boolean | any | any | null
>     }[] | null
>   } | null,
>   jsonHeaders?: string | null,
>   sendQuery?: boolean | null,
>   specifyQuery?: string | null,
>   queryParameters?: {
>     parameters?: {
>       name?: string | null,
>       value?: string | number | boolean | any | any | null
>     }[] | null
>   } | null,
>   jsonQuery?: string | null,
>   options?: {
>     timeout?: number | null,
>     allowUnauthorizedCerts?: boolean | null,
>     queryParameterArrays?: string | null,
>     redirect?: {
>       redirect?: {
>         followRedirects?: boolean | null,
>         maxRedirects?: number | null
>       } | null
>     } | null,
>     proxy?: {
>       proxy?: {
>         protocol?: string | null,
>         host?: string | null,
>         port?: number | null
>       } | null
>     } | null,
>     socket?: {
>       keepAlive?: boolean | null,
>       maxSockets?: number | null,
>       maxFreeSockets?: number | null
>     } | null
>   } | null,
>   id?: string | null
> } | {
>   label?: string | null,
>   enabled?: boolean | null,
>   subscribedEvents?: string[] | null,
>   anonymizeAuditMessages?: boolean | null,
>   circuitBreaker?: {
>     maxFailures?: number | null,
>     failureWindow?: number | null
>   } | null,
>   type?: string | null,
>   host?: string | null,
>   port?: number | null,
>   protocol?: string | null,
>   facility?: number | null,
>   app_name?: string | null,
>   tlsCa?: string | null,
>   id?: string | null
> } | {
>   label?: string | null,
>   enabled?: boolean | null,
>   subscribedEvents?: string[] | null,
>   anonymizeAuditMessages?: boolean | null,
>   circuitBreaker?: {
>     maxFailures?: number | null,
>     failureWindow?: number | null
>   } | null,
>   type?: string | null,
>   dsn?: string | null,
>   id?: string | null
> }
> ```

***

### logStreaming.listDestinations

`settings.logStreaming.listDestinations`

List log streaming destinations. List the configured log streaming destinations. Requires the Log Streaming feature to be licensed. Requires the eventBusDestination:list API key scope. Needs a licence with feat:logStreaming (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.settings.logStreaming.listDestinations({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | The configured log streaming destinations. |

> [accordion] data full type
>
> ```ts theme={null}
> (
>   {
>     label?: string | null,
>     enabled?: boolean | null,
>     subscribedEvents?: string[] | null,
>     anonymizeAuditMessages?: boolean | null,
>     circuitBreaker?: {
>       maxFailures?: number | null,
>       failureWindow?: number | null
>     } | null,
>     type?: string | null,
>     url?: string | null,
>     method?: string | null,
>     sendHeaders?: boolean | null,
>     specifyHeaders?: string | null,
>     headerParameters?: {
>       parameters?: {
>         name?: string | null,
>         value?: string | number | boolean | any | any | null
>       }[] | null
>     } | null,
>     jsonHeaders?: string | null,
>     sendQuery?: boolean | null,
>     specifyQuery?: string | null,
>     queryParameters?: {
>       parameters?: {
>         name?: string | null,
>         value?: string | number | boolean | any | any | null
>       }[] | null
>     } | null,
>     jsonQuery?: string | null,
>     options?: {
>       timeout?: number | null,
>       allowUnauthorizedCerts?: boolean | null,
>       queryParameterArrays?: string | null,
>       redirect?: {
>         redirect?: {
>           followRedirects?: boolean | null,
>           maxRedirects?: number | null
>         } | null
>       } | null,
>       proxy?: {
>         proxy?: {
>           protocol?: string | null,
>           host?: string | null,
>           port?: number | null
>         } | null
>       } | null,
>       socket?: {
>         keepAlive?: boolean | null,
>         maxSockets?: number | null,
>         maxFreeSockets?: number | null
>       } | null
>     } | null,
>     id?: string | null
>   } | {
>     label?: string | null,
>     enabled?: boolean | null,
>     subscribedEvents?: string[] | null,
>     anonymizeAuditMessages?: boolean | null,
>     circuitBreaker?: {
>       maxFailures?: number | null,
>       failureWindow?: number | null
>     } | null,
>     type?: string | null,
>     host?: string | null,
>     port?: number | null,
>     protocol?: string | null,
>     facility?: number | null,
>     app_name?: string | null,
>     tlsCa?: string | null,
>     id?: string | null
>   } | {
>     label?: string | null,
>     enabled?: boolean | null,
>     subscribedEvents?: string[] | null,
>     anonymizeAuditMessages?: boolean | null,
>     circuitBreaker?: {
>       maxFailures?: number | null,
>       failureWindow?: number | null
>     } | null,
>     type?: string | null,
>     dsn?: string | null,
>     id?: string | null
>   }
> )[] | null
> ```

***

### logStreaming.listEventTypes

`settings.logStreaming.listEventTypes`

List streamable event types. List the event types that can be streamed to a log streaming destination. Requires the Log Streaming feature to be licensed. Requires the eventBusDestination:list API key scope. Needs a licence with feat:logStreaming (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.settings.logStreaming.listEventTypes({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `string[] \| null` | No | Event names that can be streamed to a destination. |

***

### logStreaming.testDestination

`settings.logStreaming.testDestination`

Send a test message to a log streaming destination. Send a test message to the destination to verify it is reachable and configured correctly. Requires the Log Streaming feature to be licensed. Requires the eventBusDestination:test API key scope. Needs a licence with feat:logStreaming (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.settings.logStreaming.testDestination({ destinationId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `destinationId` | `string` | Yes | The id of the log streaming destination. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | Whether the test message was delivered to the destination successfully. |

***

### logStreaming.updateDestination

`settings.logStreaming.updateDestination`

Update a log streaming destination. Replace an existing log streaming destination. The update takes effect exactly as it would from the UI, using the same validation. Requires the Log Streaming feature to be licensed. Needs a licence with feat:logStreaming (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.settings.logStreaming.updateDestination({ destinationId: 'example', type: 'webhook' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `destinationId` | `string` | Yes | The id of the log streaming destination. |
| `label` | `string` | No | Human-readable name shown in the UI. |
| `enabled` | `boolean` | No | Whether the destination currently receives events. |
| `subscribedEvents` | `string[]` | No | Event names (or group prefixes, e.g. `n8n.workflow`, which matches all `n8n.workflow.*` events) this destination receives. Retrieve the full list of streamable event names from `GET /settings/log-streaming/event-types`. |
| `anonymizeAuditMessages` | `boolean` | No | Whether audit message payloads are anonymized before being sent. |
| `circuitBreaker` | `object` | No | Circuit-breaker tuning for delivery. After repeated failures the destination stops sending for a cool-down window instead of hammering an unhealthy target. All fields are optional; sensible defaults apply when omitted. |
| `type` | `webhook \| syslog \| sentry` | Yes | Sends each event as an HTTP request to a URL. |
| `url` | `string` | No | Target URL that receives the event payload. |
| `method` | `string` | No | HTTP method used for the request. |
| `sendHeaders` | `boolean` | No | Whether to attach custom headers to the request. |
| `specifyHeaders` | `string` | No | How custom headers are provided — `keypair` or `json`. |
| `headerParameters` | `object` | No | Key-value pairs used when the matching `specify*` field is `keypair`. |
| `jsonHeaders` | `string` | No | Custom headers as a JSON string when `specifyHeaders` is `json`. |
| `sendQuery` | `boolean` | No | Whether to attach query parameters to the request. |
| `specifyQuery` | `string` | No | How query parameters are provided — `keypair` or `json`. |
| `queryParameters` | `object` | No | Key-value pairs used when the matching `specify*` field is `keypair`. |
| `jsonQuery` | `string` | No | Query parameters as a JSON string when `specifyQuery` is `json`. |
| `options` | `object` | No | Additional HTTP request options. |
| `host` | `string` | No | Syslog server host. |
| `port` | `number` | No | Syslog server port. |
| `protocol` | `udp \| tcp \| tls` | No | Transport protocol. |
| `facility` | `number` | No | Syslog facility code (0–23, per RFC 5424). Common values: 0 Kernel, 1 User, 3 System, 13 Audit, 14 Alert, 16 Local0, 17 Local1, 18 Local2, 19 Local3, 20 Local4, 21 Local5, 22 Local6, 23 Local7. |
| `app_name` | `string` | No | Application name reported in the syslog message. |
| `tlsCa` | `string` | No | PEM-encoded CA certificate used when `protocol` is `tls`. |
| `dsn` | `string` | No | Sentry DSN the events are sent to. |

> [accordion] circuitBreaker full type
>
> ```ts theme={null}
> {
>   maxFailures?: number,
>   failureWindow?: number
> }
> ```

> [accordion] headerParameters full type
>
> ```ts theme={null}
> {
>   parameters: {
>     name: string,
>     value: string | number | boolean | any | any
>   }[]
> }
> ```

> [accordion] queryParameters full type
>
> ```ts theme={null}
> {
>   parameters: {
>     name: string,
>     value: string | number | boolean | any | any
>   }[]
> }
> ```

> [accordion] options full type
>
> ```ts theme={null}
> {
>   timeout?: number,
>   allowUnauthorizedCerts?: boolean,
>   queryParameterArrays?: indices | brackets | repeat,
>   redirect?: {
>     redirect: {
>       followRedirects?: boolean,
>       maxRedirects?: number
>     }
>   },
>   proxy?: {
>     proxy: {
>       protocol: https | http,
>       host: string,
>       port: number
>     }
>   },
>   socket?: {
>     keepAlive?: boolean,
>     maxSockets?: number,
>     maxFreeSockets?: number
>   }
> }
> ```

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   label?: string | null,
>   enabled?: boolean | null,
>   subscribedEvents?: string[] | null,
>   anonymizeAuditMessages?: boolean | null,
>   circuitBreaker?: {
>     maxFailures?: number | null,
>     failureWindow?: number | null
>   } | null,
>   type?: string | null,
>   url?: string | null,
>   method?: string | null,
>   sendHeaders?: boolean | null,
>   specifyHeaders?: string | null,
>   headerParameters?: {
>     parameters?: {
>       name?: string | null,
>       value?: string | number | boolean | any | any | null
>     }[] | null
>   } | null,
>   jsonHeaders?: string | null,
>   sendQuery?: boolean | null,
>   specifyQuery?: string | null,
>   queryParameters?: {
>     parameters?: {
>       name?: string | null,
>       value?: string | number | boolean | any | any | null
>     }[] | null
>   } | null,
>   jsonQuery?: string | null,
>   options?: {
>     timeout?: number | null,
>     allowUnauthorizedCerts?: boolean | null,
>     queryParameterArrays?: string | null,
>     redirect?: {
>       redirect?: {
>         followRedirects?: boolean | null,
>         maxRedirects?: number | null
>       } | null
>     } | null,
>     proxy?: {
>       proxy?: {
>         protocol?: string | null,
>         host?: string | null,
>         port?: number | null
>       } | null
>     } | null,
>     socket?: {
>       keepAlive?: boolean | null,
>       maxSockets?: number | null,
>       maxFreeSockets?: number | null
>     } | null
>   } | null,
>   id?: string | null
> } | {
>   label?: string | null,
>   enabled?: boolean | null,
>   subscribedEvents?: string[] | null,
>   anonymizeAuditMessages?: boolean | null,
>   circuitBreaker?: {
>     maxFailures?: number | null,
>     failureWindow?: number | null
>   } | null,
>   type?: string | null,
>   host?: string | null,
>   port?: number | null,
>   protocol?: string | null,
>   facility?: number | null,
>   app_name?: string | null,
>   tlsCa?: string | null,
>   id?: string | null
> } | {
>   label?: string | null,
>   enabled?: boolean | null,
>   subscribedEvents?: string[] | null,
>   anonymizeAuditMessages?: boolean | null,
>   circuitBreaker?: {
>     maxFailures?: number | null,
>     failureWindow?: number | null
>   } | null,
>   type?: string | null,
>   dsn?: string | null,
>   id?: string | null
> }
> ```

***

### oidc.get

`settings.oidc.get`

Retrieve the OIDC SSO configuration. Retrieve the current OIDC SSO configuration, including every field exposed in the UI. The client secret is redacted on read and is never echoed back in plaintext. Requires the OIDC feature to be licensed. Requires the oidc:manage API key scope. Needs a licence with feat:oidc (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.settings.oidc.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `clientId` | `string \| null` | No | The client ID issued when registering n8n with the OIDC provider. |
| `clientSecret` | `string \| null` | No | The client secret issued when registering n8n with the OIDC provider. Redacted on read when set; never echoed back in plaintext. |
| `discoveryEndpoint` | `string \| null` | No | The OIDC provider's well-known discovery endpoint. |
| `loginEnabled` | `boolean \| null` | No | Whether OIDC single sign-on is enabled. |
| `prompt` | `string \| null` | No | The prompt parameter to use when authenticating with the OIDC provider. |
| `authenticationContextClassReference` | `string[] \| null` | No | ACR values to include in the authorization request (acr\_values parameter), in order of preference. |
| `additionalScopes` | `string \| null` | No | Additional scopes to request, space separated. n8n always requests `openid`, `profile` and `email`. |
| `emailVerifiedRequired` | `boolean \| null` | No | Whether the identity provider must assert that the user's email address is verified before the login is accepted. When disabled, only an explicit negative assertion is rejected. |
| `rpInitiatedLogoutEnabled` | `boolean \| null` | No | Whether signing out of n8n also ends the session at the OIDC provider via RP-Initiated Logout. When disabled, sign-out is local to n8n only. |

***

### oidc.update

`settings.oidc.update`

Set the OIDC SSO configuration. Set the OIDC SSO configuration. The update takes effect exactly as it would from the UI, using the same validation. clientId, clientSecret and discoveryEndpoint are required; submit the redacted client secret sentinel to keep the stored secret unchanged. Requires the OIDC feature to be licensed. Needs a licence with feat:oidc (Business or Enterprise plans): without it n8n answers 403.

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

```ts theme={null}
await corsair.n8n.api.settings.oidc.update({
	clientId: 'example',
	clientSecret: 'example',
	discoveryEndpoint: 'example',
	loginEnabled: true,
	prompt: 'none',
	authenticationContextClassReference: ['example'],
	additionalScopes: 'example',
	emailVerifiedRequired: true,
	rpInitiatedLogoutEnabled: true,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `clientId` | `string` | Yes | The client ID issued when registering n8n with the OIDC provider. |
| `clientSecret` | `string` | Yes | The client secret issued when registering n8n with the OIDC provider. Submit the redacted sentinel value returned on read to keep the stored secret unchanged. |
| `discoveryEndpoint` | `string` | Yes | The OIDC provider's well-known discovery endpoint. |
| `loginEnabled` | `boolean` | Yes | Whether OIDC single sign-on is enabled. |
| `prompt` | `none \| login \| consent \| select_account \| create` | Yes | The prompt parameter to use when authenticating. |
| `authenticationContextClassReference` | `string[]` | Yes | ACR values to include in the authorization request (acr\_values parameter), in order of preference. Use an empty array when unused. |
| `additionalScopes` | `string` | Yes | Additional scopes to request, space separated. n8n always requests `openid`, `profile` and `email`. Use an empty string when unused. |
| `emailVerifiedRequired` | `boolean` | Yes | Whether the identity provider must assert that the user's email address is verified before the login is accepted. When disabled, only an explicit negative assertion is rejected. |
| `rpInitiatedLogoutEnabled` | `boolean` | Yes | Whether signing out of n8n also ends the session at the OIDC provider via RP-Initiated Logout. When disabled, sign-out is local to n8n only. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `clientId` | `string \| null` | No | The client ID issued when registering n8n with the OIDC provider. |
| `clientSecret` | `string \| null` | No | The client secret issued when registering n8n with the OIDC provider. Redacted on read when set; never echoed back in plaintext. |
| `discoveryEndpoint` | `string \| null` | No | The OIDC provider's well-known discovery endpoint. |
| `loginEnabled` | `boolean \| null` | No | Whether OIDC single sign-on is enabled. |
| `prompt` | `string \| null` | No | The prompt parameter to use when authenticating with the OIDC provider. |
| `authenticationContextClassReference` | `string[] \| null` | No | ACR values to include in the authorization request (acr\_values parameter), in order of preference. |
| `additionalScopes` | `string \| null` | No | Additional scopes to request, space separated. n8n always requests `openid`, `profile` and `email`. |
| `emailVerifiedRequired` | `boolean \| null` | No | Whether the identity provider must assert that the user's email address is verified before the login is accepted. When disabled, only an explicit negative assertion is rejected. |
| `rpInitiatedLogoutEnabled` | `boolean \| null` | No | Whether signing out of n8n also ends the session at the OIDC provider via RP-Initiated Logout. When disabled, sign-out is local to n8n only. |

***

### otel.get

`settings.otel.get`

Retrieve the OpenTelemetry configuration. Retrieve the current OpenTelemetry configuration, including every field exposed in the UI. Requires the otel:manage API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.settings.otel.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean \| null` | No | Whether OpenTelemetry tracing is enabled. |
| `exporterProtocol` | `string \| null` | No | The wire protocol used to export spans. Collectors conventionally serve OTLP/HTTP on port 4318 and OTLP/gRPC on port 4317. The endpoint scheme (`http://` or `https://`) controls TLS for both protocols. Optional: a write that omits it selects `http/protobuf`, but an instance that sets this field to another value with an environment variable rejects that write with 409. |
| `exporterEndpoint` | `string \| null` | No | The base URL of the OTLP collector to export traces to. The value must be an `http://` or `https://` URL, because the scheme selects TLS — for gRPC, `https://` uses SSL and `http://` is plaintext. |
| `exporterTracingPath` | `string \| null` | No | The path appended to the endpoint for the OTLP traces signal. Ignored when `exporterProtocol` is `grpc`, which takes no URL path. |
| `exporterServiceName` | `string \| null` | No | The `service.name` resource attribute reported on every span. |
| `exporterHeaders` | `string \| null` | No | Additional headers sent to the OTLP collector, as a single string of comma-separated `key=value` pairs (e.g. `authorization=Bearer my-token,x-tenant-id=acme`). Whitespace around each key and value is trimmed; a value may contain spaces but not commas. Use an empty string when unused. |
| `tracesSampleRate` | `number \| null` | No | The ratio of traces to sample, between 0 (none) and 1 (all). |
| `startupConnectivityTimeoutMs` | `number \| null` | No | How long, in milliseconds, to wait when checking the collector is reachable. Also used as the timeout for the test-trace endpoint. |
| `includeNodeSpans` | `boolean \| null` | No | Whether to emit a span for each node execution in addition to the workflow span. |
| `emitWorkflowStartSpan` | `boolean \| null` | No | Whether to emit a `workflow.execute.started` span with a duration of 0 ms when each execution or resumed segment starts. Optional: a write that omits it selects `false`, but an instance that sets this field to `true` with an environment variable rejects that write with 409. |
| `emitNodeStartSpan` | `boolean \| null` | No | Whether to emit a `node.execute.started` span with a duration of 0 ms when each node span starts. This doubles the number of node spans. Has no effect when `includeNodeSpans` is false. Optional: a write that omits it selects `false`, but an instance that sets this field to `true` with an environment variable rejects that write with 409. |
| `injectOutbound` | `boolean \| null` | No | Whether to inject trace context headers into outbound HTTP requests made by nodes. |
| `productionExecutionsOnly` | `boolean \| null` | No | When true, only production executions of published (active) workflows are traced, not manual/test runs. |

***

### otel.testTrace

`settings.otel.testTrace`

Test the connection to an OTLP collector. Send a single test span to the given OTLP collector and report whether it was accepted. This tests the supplied connection details without changing the stored configuration. Fields managed declaratively via environment variables are overridden with their effective value before the test is sent.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.settings.otel.testTrace({
	exporterEndpoint: 'https://otel.example.com:4318',
	exporterTracingPath: 'example',
	exporterServiceName: 'example',
	exporterHeaders: 'example',
	startupConnectivityTimeoutMs: 1,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `exporterProtocol` | `http/protobuf \| grpc` | No | The wire protocol used to send the test span. Collectors conventionally serve OTLP/HTTP on port 4318 and OTLP/gRPC on port 4317. The endpoint scheme (`http://` or `https://`) controls TLS for both protocols. Optional: omitting it selects `http/protobuf`, unless an environment variable manages this field, which then supplies the value. |
| `exporterEndpoint` | `string` | Yes | The base URL of the OTLP collector to export traces to. The value must be an `http://` or `https://` URL, because the scheme selects TLS — for gRPC, `https://` uses SSL and `http://` is plaintext. |
| `exporterTracingPath` | `string` | Yes | The path appended to the endpoint for the OTLP traces signal. Ignored when `exporterProtocol` is `grpc`, which takes no URL path. |
| `exporterServiceName` | `string` | Yes | The `service.name` resource attribute reported on the test span. |
| `exporterHeaders` | `string` | Yes | Additional headers sent to the OTLP collector, as a single string of comma-separated `key=value` pairs (e.g. `authorization=Bearer my-token,x-tenant-id=acme`). Whitespace around each key and value is trimmed; a value may contain spaces but not commas. Use an empty string when unused. |
| `startupConnectivityTimeoutMs` | `number` | Yes | How long, in milliseconds, to wait for the collector to respond. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | Whether the test span was accepted by the collector. |
| `error` | `string \| null` | No | The error reported by the collector or exporter. Present only when `success` is false. |

***

### otel.update

`settings.otel.update`

Set the OpenTelemetry configuration. Set the OpenTelemetry configuration. This is a full replacement: every field must be provided, and a partial body is rejected. The exceptions are exporterProtocol, which defaults to http/protobuf when omitted, and emitWorkflowStartSpan and emitNodeStartSpan, which default to false when omitted.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.settings.otel.update({
	enabled: true,
	exporterEndpoint: 'https://otel.example.com:4318',
	exporterTracingPath: 'example',
	exporterServiceName: 'example',
	exporterHeaders: 'example',
	tracesSampleRate: 1,
	startupConnectivityTimeoutMs: 1,
	includeNodeSpans: true,
	injectOutbound: true,
	productionExecutionsOnly: true,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean` | Yes | Whether OpenTelemetry tracing is enabled. |
| `exporterProtocol` | `http/protobuf \| grpc` | No | The wire protocol used to export spans. Collectors conventionally serve OTLP/HTTP on port 4318 and OTLP/gRPC on port 4317. The endpoint scheme (`http://` or `https://`) controls TLS for both protocols. Optional: a write that omits it selects `http/protobuf`, but an instance that sets this field to another value with an environment variable rejects that write with 409. |
| `exporterEndpoint` | `string` | Yes | The base URL of the OTLP collector to export traces to. The value must be an `http://` or `https://` URL, because the scheme selects TLS — for gRPC, `https://` uses SSL and `http://` is plaintext. |
| `exporterTracingPath` | `string` | Yes | The path appended to the endpoint for the OTLP traces signal. Ignored when `exporterProtocol` is `grpc`, which takes no URL path. |
| `exporterServiceName` | `string` | Yes | The `service.name` resource attribute reported on every span. |
| `exporterHeaders` | `string` | Yes | Additional headers sent to the OTLP collector, as a single string of comma-separated `key=value` pairs (e.g. `authorization=Bearer my-token,x-tenant-id=acme`). Whitespace around each key and value is trimmed; a value may contain spaces but not commas. Use an empty string when unused. |
| `tracesSampleRate` | `number` | Yes | The ratio of traces to sample, between 0 (none) and 1 (all). |
| `startupConnectivityTimeoutMs` | `number` | Yes | How long, in milliseconds, to wait when checking the collector is reachable. Also used as the timeout for the test-trace endpoint. |
| `includeNodeSpans` | `boolean` | Yes | Whether to emit a span for each node execution in addition to the workflow span. |
| `emitWorkflowStartSpan` | `boolean` | No | Whether to emit a `workflow.execute.started` span with a duration of 0 ms when each execution or resumed segment starts. Optional: a write that omits it selects `false`, but an instance that sets this field to `true` with an environment variable rejects that write with 409. |
| `emitNodeStartSpan` | `boolean` | No | Whether to emit a `node.execute.started` span with a duration of 0 ms when each node span starts. This doubles the number of node spans. Has no effect when `includeNodeSpans` is false. Optional: a write that omits it selects `false`, but an instance that sets this field to `true` with an environment variable rejects that write with 409. |
| `injectOutbound` | `boolean` | Yes | Whether to inject trace context headers into outbound HTTP requests made by nodes. |
| `productionExecutionsOnly` | `boolean` | Yes | When true, only production executions of published (active) workflows are traced, not manual/test runs. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean \| null` | No | Whether OpenTelemetry tracing is enabled. |
| `exporterProtocol` | `string \| null` | No | The wire protocol used to export spans. Collectors conventionally serve OTLP/HTTP on port 4318 and OTLP/gRPC on port 4317. The endpoint scheme (`http://` or `https://`) controls TLS for both protocols. Optional: a write that omits it selects `http/protobuf`, but an instance that sets this field to another value with an environment variable rejects that write with 409. |
| `exporterEndpoint` | `string \| null` | No | The base URL of the OTLP collector to export traces to. The value must be an `http://` or `https://` URL, because the scheme selects TLS — for gRPC, `https://` uses SSL and `http://` is plaintext. |
| `exporterTracingPath` | `string \| null` | No | The path appended to the endpoint for the OTLP traces signal. Ignored when `exporterProtocol` is `grpc`, which takes no URL path. |
| `exporterServiceName` | `string \| null` | No | The `service.name` resource attribute reported on every span. |
| `exporterHeaders` | `string \| null` | No | Additional headers sent to the OTLP collector, as a single string of comma-separated `key=value` pairs (e.g. `authorization=Bearer my-token,x-tenant-id=acme`). Whitespace around each key and value is trimmed; a value may contain spaces but not commas. Use an empty string when unused. |
| `tracesSampleRate` | `number \| null` | No | The ratio of traces to sample, between 0 (none) and 1 (all). |
| `startupConnectivityTimeoutMs` | `number \| null` | No | How long, in milliseconds, to wait when checking the collector is reachable. Also used as the timeout for the test-trace endpoint. |
| `includeNodeSpans` | `boolean \| null` | No | Whether to emit a span for each node execution in addition to the workflow span. |
| `emitWorkflowStartSpan` | `boolean \| null` | No | Whether to emit a `workflow.execute.started` span with a duration of 0 ms when each execution or resumed segment starts. Optional: a write that omits it selects `false`, but an instance that sets this field to `true` with an environment variable rejects that write with 409. |
| `emitNodeStartSpan` | `boolean \| null` | No | Whether to emit a `node.execute.started` span with a duration of 0 ms when each node span starts. This doubles the number of node spans. Has no effect when `includeNodeSpans` is false. Optional: a write that omits it selects `false`, but an instance that sets this field to `true` with an environment variable rejects that write with 409. |
| `injectOutbound` | `boolean \| null` | No | Whether to inject trace context headers into outbound HTTP requests made by nodes. |
| `productionExecutionsOnly` | `boolean \| null` | No | When true, only production executions of published (active) workflows are traced, not manual/test runs. |

***

### rateLimits.get

`settings.rateLimits.get`

Retrieve the Public API rate-limit settings. Retrieve the Public API rate-limit settings. envManagedFields lists the fields that are set by environment variables and can't be changed through the API. Requests to this route count against the rate limits. Requires the securitySettings:manage API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.settings.rateLimits.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean \| null` | No | Whether Public API rate limiting is enabled. |
| `globalReadLimit` | `number \| null` | No | Read requests allowed for one API key across all endpoints. Set 0 for no limit. |
| `globalReadWindowSeconds` | `number \| null` | No | The window for the global read limit, in seconds. |
| `globalWriteLimit` | `number \| null` | No | Write requests allowed for one API key across all endpoints. Set 0 for no limit. |
| `globalWriteWindowSeconds` | `number \| null` | No | The window for the global write limit, in seconds. |
| `endpointReadLimit` | `number \| null` | No | Read requests allowed for one API key on one endpoint. Set 0 for no limit. |
| `endpointReadWindowSeconds` | `number \| null` | No | The window for the endpoint read limit, in seconds. |
| `endpointWriteLimit` | `number \| null` | No | Write requests allowed for one API key on one endpoint. Set 0 for no limit. |
| `endpointWriteWindowSeconds` | `number \| null` | No | The window for the endpoint write limit, in seconds. |
| `envManagedFields` | `string[] \| null` | No | Fields controlled by environment variables, including \_FILE variables. These fields return their effective values. A PUT can repeat these values but cannot change them. |

***

### rateLimits.update

`settings.rateLimits.update`

Set the Public API rate-limit settings. Set the Public API rate-limit settings. You can send a GET response back as the body, and envManagedFields is ignored. When rate limiting is enabled, at least one limit must be greater than 0.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.settings.rateLimits.update({
	enabled: true,
	globalReadLimit: 1,
	globalReadWindowSeconds: 2,
	globalWriteLimit: 1,
	globalWriteWindowSeconds: 2,
	endpointReadLimit: 1,
	endpointReadWindowSeconds: 2,
	endpointWriteLimit: 1,
	endpointWriteWindowSeconds: 2,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean` | Yes | Whether Public API rate limiting is enabled. |
| `globalReadLimit` | `number` | Yes | Read requests allowed for one API key across all endpoints. Set 0 for no limit. |
| `globalReadWindowSeconds` | `number` | Yes | The window for the global read limit, in seconds. |
| `globalWriteLimit` | `number` | Yes | Write requests allowed for one API key across all endpoints. Set 0 for no limit. |
| `globalWriteWindowSeconds` | `number` | Yes | The window for the global write limit, in seconds. |
| `endpointReadLimit` | `number` | Yes | Read requests allowed for one API key on one endpoint. Set 0 for no limit. |
| `endpointReadWindowSeconds` | `number` | Yes | The window for the endpoint read limit, in seconds. |
| `endpointWriteLimit` | `number` | Yes | Write requests allowed for one API key on one endpoint. Set 0 for no limit. |
| `endpointWriteWindowSeconds` | `number` | Yes | The window for the endpoint write limit, in seconds. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean \| null` | No | Whether Public API rate limiting is enabled. |
| `globalReadLimit` | `number \| null` | No | Read requests allowed for one API key across all endpoints. Set 0 for no limit. |
| `globalReadWindowSeconds` | `number \| null` | No | The window for the global read limit, in seconds. |
| `globalWriteLimit` | `number \| null` | No | Write requests allowed for one API key across all endpoints. Set 0 for no limit. |
| `globalWriteWindowSeconds` | `number \| null` | No | The window for the global write limit, in seconds. |
| `endpointReadLimit` | `number \| null` | No | Read requests allowed for one API key on one endpoint. Set 0 for no limit. |
| `endpointReadWindowSeconds` | `number \| null` | No | The window for the endpoint read limit, in seconds. |
| `endpointWriteLimit` | `number \| null` | No | Write requests allowed for one API key on one endpoint. Set 0 for no limit. |
| `endpointWriteWindowSeconds` | `number \| null` | No | The window for the endpoint write limit, in seconds. |
| `envManagedFields` | `string[] \| null` | No | Fields controlled by environment variables, including \_FILE variables. These fields return their effective values. A PUT can repeat these values but cannot change them. |

***

### saml.get

`settings.saml.get`

Retrieve the SAML SSO configuration. Retrieve the current SAML SSO configuration, including every field exposed in the UI plus the service provider entity ID and ACS return URL. Signing private keys, signing certificates, and identity provider metadata are redacted on read. Requires the SAML feature to be licensed. Needs a licence with feat:saml (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.settings.saml.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `entityID` | `string \| null` | No | Service provider entity ID (metadata URL). |
| `returnUrl` | `string \| null` | No | Assertion Consumer Service (ACS) return URL. |
| `mapping` | `object \| null` | No | Mapping of SAML attributes to n8n user fields. |
| `metadata` | `string \| null` | No | Identity provider metadata in XML format. Redacted on read when set because it contains IdP certificates; never echoed back in plaintext. Use an empty string when unset. |
| `metadataUrl` | `string \| null` | No | URL to fetch identity provider metadata from. Use an empty string when unset. |
| `ignoreSSL` | `boolean \| null` | No | Whether to ignore SSL certificate errors when fetching metadata from a URL. |
| `loginBinding` | `string \| null` | No | SAML login request binding. |
| `loginEnabled` | `boolean \| null` | No | Whether SAML login is enabled. |
| `loginLabel` | `string \| null` | No | Label shown on the SAML login button. |
| `authnRequestsSigned` | `boolean \| null` | No | Whether authentication requests are signed. |
| `wantAssertionsSigned` | `boolean \| null` | No | Whether signed assertions are required. |
| `wantMessageSigned` | `boolean \| null` | No | Whether signed SAML messages are required. |
| `emailVerifiedRequired` | `boolean \| null` | No | Whether the identity provider must assert that the user's email address is verified before a login is linked to an existing user by email. When disabled, only an explicit negative assertion is rejected. |
| `signingPrivateKey` | `string \| null` | No | PEM-encoded private key for signing SAML AuthnRequests. Redacted on read when set; never echoed back in plaintext. Use an empty string when unset. |
| `signingCertificate` | `string \| null` | No | PEM-encoded certificate containing the public key matching the signing private key. Redacted on read when set; never echoed back in plaintext. Use an empty string when unset. |
| `acsBinding` | `string \| null` | No | Assertion Consumer Service binding. |
| `signatureConfig` | `object \| null` | No | Configuration for the signature in SAML requests and responses. |
| `relayState` | `string \| null` | No | Default relay state value for SAML requests. Use an empty string when unset. |

> [accordion] mapping full type
>
> ```ts theme={null}
> {
>   email?: string | null,
>   firstName?: string | null,
>   lastName?: string | null,
>   userPrincipalName?: string | null,
>   emailVerified?: string | null,
>   n8nInstanceRole?: string | null,
>   n8nProjectRoles?: string[] | null
> } | null
> ```

> [accordion] signatureConfig full type
>
> ```ts theme={null}
> {
>   prefix?: string | null,
>   location?: {
>     reference?: string | null,
>     action?: string | null
>   } | null
> } | null
> ```

***

### saml.update

`settings.saml.update`

Set the SAML SSO configuration. Replace the SAML SSO configuration with the provided full object. Every writable field must be sent; use empty strings or empty arrays when a value is unset. Read-only entityID / returnUrl from GET are ignored if included, so a GET response can be sent back as a PUT body. Needs a licence with feat:saml (Business or Enterprise plans): without it n8n answers 403.

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

```ts theme={null}
await corsair.n8n.api.settings.saml.update({
	mapping: {
		email: 'ada@example.com',
		firstName: 'example',
		lastName: 'example',
		userPrincipalName: 'example',
		emailVerified: 'ada@example.com',
		n8nInstanceRole: 'example',
		n8nProjectRoles: ['example'],
	},
	metadata: 'example',
	metadataUrl: 'https://example.com/callback',
	ignoreSSL: true,
	loginBinding: 'redirect',
	loginEnabled: true,
	loginLabel: 'example',
	authnRequestsSigned: true,
	wantAssertionsSigned: true,
	wantMessageSigned: true,
	emailVerifiedRequired: true,
	signingPrivateKey: 'example',
	signingCertificate: 'example',
	acsBinding: 'redirect',
	signatureConfig: {
		prefix: 'example',
		location: { reference: 'example', action: 'before' },
	},
	relayState: 'example',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mapping` | `object` | Yes | Mapping of SAML attributes to n8n user fields. Use empty strings / empty arrays for unused attributes. |
| `metadata` | `string` | Yes | Identity provider metadata in XML format. Use an empty string to clear stored metadata (also clears metadataUrl when no URL is provided). Use the redaction placeholder from a prior GET to leave an existing value unchanged. |
| `metadataUrl` | `string` | Yes | URL to fetch identity provider metadata from. Use an empty string to clear a stored URL. |
| `ignoreSSL` | `boolean` | Yes | Whether to ignore SSL certificate errors when fetching metadata from a URL. |
| `loginBinding` | `redirect \| post` | Yes | SAML login request binding. |
| `loginEnabled` | `boolean` | Yes | Whether SAML login is enabled. |
| `loginLabel` | `string` | Yes | Label shown on the SAML login button. |
| `authnRequestsSigned` | `boolean` | Yes | Whether authentication requests are signed. |
| `wantAssertionsSigned` | `boolean` | Yes | Whether signed assertions are required. |
| `wantMessageSigned` | `boolean` | Yes | Whether signed SAML messages are required. |
| `emailVerifiedRequired` | `boolean` | Yes | Whether the identity provider must assert that the user's email address is verified before a login is linked to an existing user by email. When disabled, only an explicit negative assertion is rejected. |
| `signingPrivateKey` | `string` | Yes | PEM-encoded private key for signing SAML AuthnRequests. Use an empty string to clear an existing key, or the redaction placeholder from a prior GET to leave it unchanged. |
| `signingCertificate` | `string` | Yes | PEM-encoded certificate containing the public key matching the signing private key. Use an empty string when unused or to clear an existing certificate. |
| `acsBinding` | `redirect \| post` | Yes | Assertion Consumer Service binding. |
| `signatureConfig` | `object` | Yes | Configuration for the signature in SAML requests and responses. |
| `relayState` | `string` | Yes | Default relay state value for SAML requests. Use an empty string when unused. |
| `entityID` | `string` | No | Service provider entity ID. Returned by GET for convenience; ignored on write so a GET response can be sent back as a PUT body. |
| `returnUrl` | `string` | No | Assertion Consumer Service return URL. Returned by GET for convenience; ignored on write so a GET response can be sent back as a PUT body. |

> [accordion] mapping full type
>
> ```ts theme={null}
> {
>   email: string,
>   firstName: string,
>   lastName: string,
>   userPrincipalName: string,
>   emailVerified: string,
>   n8nInstanceRole: string,
>   n8nProjectRoles: string[]
> }
> ```

> [accordion] signatureConfig full type
>
> ```ts theme={null}
> {
>   prefix: string,
>   location: {
>     reference: string,
>     action: before | after | prepend | append
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `entityID` | `string \| null` | No | Service provider entity ID (metadata URL). |
| `returnUrl` | `string \| null` | No | Assertion Consumer Service (ACS) return URL. |
| `mapping` | `object \| null` | No | Mapping of SAML attributes to n8n user fields. |
| `metadata` | `string \| null` | No | Identity provider metadata in XML format. Redacted on read when set because it contains IdP certificates; never echoed back in plaintext. Use an empty string when unset. |
| `metadataUrl` | `string \| null` | No | URL to fetch identity provider metadata from. Use an empty string when unset. |
| `ignoreSSL` | `boolean \| null` | No | Whether to ignore SSL certificate errors when fetching metadata from a URL. |
| `loginBinding` | `string \| null` | No | SAML login request binding. |
| `loginEnabled` | `boolean \| null` | No | Whether SAML login is enabled. |
| `loginLabel` | `string \| null` | No | Label shown on the SAML login button. |
| `authnRequestsSigned` | `boolean \| null` | No | Whether authentication requests are signed. |
| `wantAssertionsSigned` | `boolean \| null` | No | Whether signed assertions are required. |
| `wantMessageSigned` | `boolean \| null` | No | Whether signed SAML messages are required. |
| `emailVerifiedRequired` | `boolean \| null` | No | Whether the identity provider must assert that the user's email address is verified before a login is linked to an existing user by email. When disabled, only an explicit negative assertion is rejected. |
| `signingPrivateKey` | `string \| null` | No | PEM-encoded private key for signing SAML AuthnRequests. Redacted on read when set; never echoed back in plaintext. Use an empty string when unset. |
| `signingCertificate` | `string \| null` | No | PEM-encoded certificate containing the public key matching the signing private key. Redacted on read when set; never echoed back in plaintext. Use an empty string when unset. |
| `acsBinding` | `string \| null` | No | Assertion Consumer Service binding. |
| `signatureConfig` | `object \| null` | No | Configuration for the signature in SAML requests and responses. |
| `relayState` | `string \| null` | No | Default relay state value for SAML requests. Use an empty string when unset. |

> [accordion] mapping full type
>
> ```ts theme={null}
> {
>   email?: string | null,
>   firstName?: string | null,
>   lastName?: string | null,
>   userPrincipalName?: string | null,
>   emailVerified?: string | null,
>   n8nInstanceRole?: string | null,
>   n8nProjectRoles?: string[] | null
> } | null
> ```

> [accordion] signatureConfig full type
>
> ```ts theme={null}
> {
>   prefix?: string | null,
>   location?: {
>     reference?: string | null,
>     action?: string | null
>   } | null
> } | null
> ```

***

### securityPolicy.get

`settings.securityPolicy.get`

Retrieve the security policy. Retrieve the instance security policy: personal-space publishing and sharing, the execution-data redaction enforcement floor, and the read-only usage counts shown in the UI. Requires the Personal Space Policy feature to be licensed. Requires the securitySettings:manage API key scope. Needs a licence with feat:personalSpacePolicy (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.settings.securityPolicy.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `personalSpacePublishing` | `boolean \| null` | No | Whether members may publish workflows and agents from their personal space. |
| `personalSpaceSharing` | `boolean \| null` | No | Whether members may share workflows and credentials from their personal space. |
| `publishedPersonalWorkflowsCount` | `number \| null` | No | Number of currently published personal workflows, shown for awareness before tightening the policy. |
| `sharedPersonalWorkflowsCount` | `number \| null` | No | Number of personal workflows currently shared with other users. |
| `sharedPersonalCredentialsCount` | `number \| null` | No | Number of personal credentials currently shared with other users. |
| `redactionEnforcement` | `object \| null` | No | — |

> [accordion] redactionEnforcement full type
>
> ```ts theme={null}
> {
>   floor?: string | null
> } | null
> ```

***

### securityPolicy.update

`settings.securityPolicy.update`

Set the security policy. Replace the instance security policy with the provided full object. Every writable field must be sent. Read-only usage counts from GET are ignored if included, so a GET response can be sent back as a PUT body. The update takes effect exactly as it would from the UI, using the same validation. Needs a licence with feat:personalSpacePolicy (Business or Enterprise plans): without it n8n answers 403.

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

```ts theme={null}
await corsair.n8n.api.settings.securityPolicy.update({
	personalSpacePublishing: true,
	personalSpaceSharing: true,
	redactionEnforcement: { floor: 'off' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `personalSpacePublishing` | `boolean` | Yes | Whether members may publish workflows and agents from their personal space. |
| `personalSpaceSharing` | `boolean` | Yes | Whether members may share workflows and credentials from their personal space. |
| `redactionEnforcement` | `object` | Yes | — |
| `publishedPersonalWorkflowsCount` | `number` | No | Read-only usage count returned by GET. Ignored on write so a GET response can be sent back as a PUT body. |
| `sharedPersonalWorkflowsCount` | `number` | No | Read-only usage count returned by GET. Ignored on write so a GET response can be sent back as a PUT body. |
| `sharedPersonalCredentialsCount` | `number` | No | Read-only usage count returned by GET. Ignored on write so a GET response can be sent back as a PUT body. |

> [accordion] redactionEnforcement full type
>
> ```ts theme={null}
> {
>   floor: off | production | all
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `personalSpacePublishing` | `boolean \| null` | No | Whether members may publish workflows and agents from their personal space. |
| `personalSpaceSharing` | `boolean \| null` | No | Whether members may share workflows and credentials from their personal space. |
| `publishedPersonalWorkflowsCount` | `number \| null` | No | Number of currently published personal workflows, shown for awareness before tightening the policy. |
| `sharedPersonalWorkflowsCount` | `number \| null` | No | Number of personal workflows currently shared with other users. |
| `sharedPersonalCredentialsCount` | `number \| null` | No | Number of personal credentials currently shared with other users. |
| `redactionEnforcement` | `object \| null` | No | — |

> [accordion] redactionEnforcement full type
>
> ```ts theme={null}
> {
>   floor?: string | null
> } | null
> ```

***

## Source Control

### getStatus

`sourceControl.getStatus`

Preview pending source control changes. Previews the pending changes between the instance and the connected Git branch in either the push or pull direction. Requires the sourceControl:read API key scope. Needs a licence with feat:sourceControl (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.sourceControl.getStatus({ direction: 'push' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `direction` | `push \| pull` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   file?: string | null,
>   id?: string | null,
>   name?: string | null,
>   type?: string | null,
>   status?: string | null,
>   location?: string | null,
>   conflict?: boolean | null,
>   updatedAt?: string | null,
>   pushed?: boolean | null,
>   isLocalPublished?: boolean | null,
>   isRemoteArchived?: boolean | null,
>   parentFolderId?: string | null | null,
>   folderPath?: string[] | null,
>   remoteFolderPath?: string[] | null,
>   owner?: {
>     type?: string | null,
>     projectId?: string | null,
>     projectName?: string | null
>   } | null,
>   publishingError?: string | null,
>   publishingErrorDetails?: {
>     reason?: string | null,
>     workflowReviewRequestId?: string | null,
>     versionId?: string | null
>   } | null,
>   contentImportPolicy?: {
>     violations?: {
>       kind?: string | null,
>       checkId?: string | null,
>       message?: string | null,
>       subject?: string | null,
>       subjectType?: string | null,
>       scope?: string | null,
>       matchedRuleId?: string | null,
>       projectId?: string | null,
>       optInAvailable?: boolean | null,
>       limit?: number | null,
>       usage?: number | null,
>       resetsAt?: string | null
>     }[] | null,
>     checkErrors?: {
>       checkId?: string | null,
>       correlationId?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

***

### pull

`sourceControl.pull`

Pull changes from the remote repository. Fetches changes from the connected Git branch into the instance. Requires the sourceControl:pull API key scope. Needs a licence with feat:sourceControl (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.sourceControl.pull({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `force` | `boolean` | No | Discard local changes and force the pull to complete. |
| `autoPublish` | `none \| all \| published` | No | Controls automatic workflow publishing after import: - `none`: Keep workflows in their local published state (default) - `all`: Publish all imported workflows - `published`: Publish only workflows that were published locally before import |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   file?: string | null,
>   id?: string | null,
>   name?: string | null,
>   type?: string | null,
>   status?: string | null,
>   location?: string | null,
>   conflict?: boolean | null,
>   updatedAt?: string | null,
>   pushed?: boolean | null,
>   isLocalPublished?: boolean | null,
>   isRemoteArchived?: boolean | null,
>   parentFolderId?: string | null | null,
>   folderPath?: string[] | null,
>   remoteFolderPath?: string[] | null,
>   owner?: {
>     type?: string | null,
>     projectId?: string | null,
>     projectName?: string | null
>   } | null,
>   publishingError?: string | null,
>   publishingErrorDetails?: {
>     reason?: string | null,
>     workflowReviewRequestId?: string | null,
>     versionId?: string | null
>   } | null,
>   contentImportPolicy?: {
>     violations?: {
>       kind?: string | null,
>       checkId?: string | null,
>       message?: string | null,
>       subject?: string | null,
>       subjectType?: string | null,
>       scope?: string | null,
>       matchedRuleId?: string | null,
>       projectId?: string | null,
>       optInAvailable?: boolean | null,
>       limit?: number | null,
>       usage?: number | null,
>       resetsAt?: string | null
>     }[] | null,
>     checkErrors?: {
>       checkId?: string | null,
>       correlationId?: string | null
>     }[] | null
>   } | null
> }[]
> ```

***

### push

`sourceControl.push`

Push local source control changes. Commits and pushes the selected files to the connected Git branch. Each entry in fileNames is resolved against a fresh preview of the pending changes. Requires the sourceControl:push API key scope. Needs a licence with feat:sourceControl (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.sourceControl.push({
	commitMessage: 'example',
	fileNames: [{ id: 'doc_8f2k1x9q', type: 'credential' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `commitMessage` | `string` | Yes | — |
| `fileNames` | `object[]` | Yes | — |
| `force` | `boolean` | No | — |

> [accordion] fileNames full type
>
> ```ts theme={null}
> {
>   id: string,
>   type: credential | workflow | tags | variables | file | folders | project | datatable
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   file?: string | null,
>   id?: string | null,
>   name?: string | null,
>   type?: string | null,
>   status?: string | null,
>   location?: string | null,
>   conflict?: boolean | null,
>   updatedAt?: string | null,
>   pushed?: boolean | null,
>   isLocalPublished?: boolean | null,
>   isRemoteArchived?: boolean | null,
>   parentFolderId?: string | null | null,
>   folderPath?: string[] | null,
>   remoteFolderPath?: string[] | null,
>   owner?: {
>     type?: string | null,
>     projectId?: string | null,
>     projectName?: string | null
>   } | null,
>   publishingError?: string | null,
>   publishingErrorDetails?: {
>     reason?: string | null,
>     workflowReviewRequestId?: string | null,
>     versionId?: string | null
>   } | null,
>   contentImportPolicy?: {
>     violations?: {
>       kind?: string | null,
>       checkId?: string | null,
>       message?: string | null,
>       subject?: string | null,
>       subjectType?: string | null,
>       scope?: string | null,
>       matchedRuleId?: string | null,
>       projectId?: string | null,
>       optInAvailable?: boolean | null,
>       limit?: number | null,
>       usage?: number | null,
>       resetsAt?: string | null
>     }[] | null,
>     checkErrors?: {
>       checkId?: string | null,
>       correlationId?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

***

## Tags

### create

`tags.create`

Create a tag. Create a tag in your instance. Requires the tag:create API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.tags.create({ name: 'reports' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### delete

`tags.delete`

Delete a tag. Deletes a tag. Requires the tag:delete API key scope. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.tags.delete({ tagId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tagId` | `string` | Yes | The ID of the tag. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### get

`tags.get`

Retrieves a tag. Retrieves a tag. Requires the tag:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.tags.get({ tagId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tagId` | `string` | Yes | The ID of the tag. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### list

`tags.list`

Retrieve all tags. Retrieve all tags from your instance. Requires the tag:list API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.tags.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### update

`tags.update`

Update a tag. Update a tag. Requires the tag:update API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.tags.update({ tagId: '2tUt1wbLX592XDdX', name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tagId` | `string` | Yes | The ID of the tag. |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

## Users

### changeRole

`users.changeRole`

Change a user's global role. Change a user's global role Requires the user:changeRole API key scope. Needs a licence with feat:advancedPermissions (Business or Enterprise plans): without it n8n answers 403.

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

```ts theme={null}
await corsair.n8n.api.users.changeRole({ userId: 'example', newRoleName: 'global:admin' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `userId` | `string` | Yes | The ID of the user. |
| `newRoleName` | `global:admin \| global:member \| global:chatUser \| string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### delete

`users.delete`

Delete user. Delete a user from your instance. Requires the user:delete API key scope. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.users.delete({ userId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `userId` | `string` | Yes | The ID of the user. |
| `transferId` | `string` | No | ID of the project to transfer the deleted user's workflows and credentials to. Omit to delete those resources instead of transferring them. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### get

`users.get`

Get user by ID/Email. Retrieve a user from your instance. Only available for the instance owner. Requires the user:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.users.get({ userId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `userId` | `string` | Yes | The ID or email of the user. |
| `includeRole` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `email` | `string \| null \| null` | No | — |
| `firstName` | `string \| null \| null` | No | — |
| `lastName` | `string \| null \| null` | No | — |
| `isPending` | `boolean \| null` | No | Whether the user finished setting up their account in response to the invitation (true) or not (false). |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `mfaEnabled` | `boolean \| null` | No | Whether the user has multi-factor authentication (MFA/2FA) enabled. |
| `role` | `string \| null` | No | — |

***

### invite

`users.invite`

Create multiple users. Create one or more users. Requires the user:create API key scope. Sends an invitation email to each address when the instance has email set up.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.users.invite({
	users: [{ email: 'ada@example.com' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `users` | `object[]` | Yes | — |

> [accordion] users full type
>
> ```ts theme={null}
> {
>   email: string,
>   role?: global:admin | global:member | global:chatUser | string
> }[]
> ```

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   user?: {
>     id?: string | null,
>     email?: string | null,
>     inviteAcceptUrl?: string | null,
>     emailSent?: boolean | null,
>     role?: string | null
>   } | null,
>   error?: string | null
> }[]
> ```

***

### list

`users.list`

Retrieve all users. Retrieve all users from your instance. Only available for the instance owner. Requires the user:list API key scope.

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `includeRole` | `boolean` | No | — |
| `projectId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | Paginate through users by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first page of the collection. |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   email?: string | null | null,
>   firstName?: string | null | null,
>   lastName?: string | null | null,
>   isPending?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   mfaEnabled?: boolean | null,
>   role?: string | null
> }[] | null
> ```

***

## Variables

### create

`variables.create`

Create a variable. Create a variable in your instance. Requires the variable:create API key scope. Needs a licence with feat:variables (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.variables.create({ key: 'example', value: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `key` | `string` | Yes | — |
| `value` | `string` | Yes | — |
| `projectId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### delete

`variables.delete`

Delete a variable. Delete a variable from your instance. Requires the variable:delete API key scope. Needs a licence with feat:variables (Business or Enterprise plans): without it n8n answers 403. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.variables.delete({ id: 'doc_8f2k1x9q' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The ID of the variable. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### list

`variables.list`

Retrieve variables. Retrieve variables from your instance. Requires the variable:list API key scope. Needs a licence with feat:variables (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.variables.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `projectId` | `string` | No | — |
| `state` | `empty` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   type?: string | null,
>   project?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     icon?: {
>       type?: string | null,
>       value?: string | null,
>       color?: string | null
>     } | null | null,
>     description?: string | null | null,
>     customTelemetryTags?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null,
>     creatorId?: string | null | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null | null
> }[] | null
> ```

***

### update

`variables.update`

Update a variable. Update a variable from your instance. Requires the variable:update API key scope. Needs a licence with feat:variables (Business or Enterprise plans): without it n8n answers 403.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.variables.update({ id: 'doc_8f2k1x9q', key: 'example', value: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The ID of the variable. |
| `key` | `string` | Yes | — |
| `value` | `string` | Yes | — |
| `projectId` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

## Workflows

### activate

`workflows.activate`

Publish a workflow. Deprecated: use POST /workflows/\{id}/publish instead. Publish a workflow. In n8n v1, this action was termed activating a workflow. Requires the workflow:activate API key scope. Turns the workflow on: its triggers start running it.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.workflows.activate({ workflowId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |
| `versionId` | `string` | No | The specific version ID to activate or publish. If not provided, the latest version is used. |
| `name` | `string` | No | Optional name for the workflow version during activation. |
| `description` | `string` | No | Optional description for the workflow version during activation. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `active` | `boolean \| null` | No | Deprecated. Check whether `activeVersionId` is not null instead. |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | — |
| `versionCounter` | `number \| null` | No | — |
| `sourceWorkflowId` | `string \| null \| null` | No | — |
| `triggerCount` | `number \| null` | No | — |
| `nodes` | `object[] \| null` | No | Nodes that make up the workflow |
| `connections` | `object \| null` | No | Connections between nodes, keyed by source node name |
| `nodeGroups` | `object[] \| null` | No | Visual groupings of nodes shown as frames on the canvas |
| `settings` | `object \| null` | No | Execution and behaviour settings for the workflow |
| `staticData` | `object \| null` | No | Data the workflow keeps between executions |
| `pinData` | `object \| null` | No | Pinned sample data for nodes, keyed by node name |
| `meta` | `object \| null` | No | Workflow metadata such as template information |
| `tags` | `object[] \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   webhookId?: string | null,
>   disabled?: boolean | null,
>   notesInFlow?: boolean | null,
>   notes?: string | null,
>   type?: string | null,
>   typeVersion?: number | null,
>   executeOnce?: boolean | null,
>   alwaysOutputData?: boolean | null,
>   retryOnFail?: boolean | null,
>   maxTries?: number | null,
>   waitBetweenTries?: number | null,
>   continueOnFail?: boolean | null,
>   onError?: string | null,
>   position?: number[] | null,
>   parameters?: {
>   } | null,
>   credentials?: {
>   } | null,
>   customTelemetryTags?: {
>     tag?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

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

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   nodeIds?: string[] | null
> }[] | null
> ```

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   saveExecutionProgress?: boolean | string | null,
>   saveManualExecutions?: boolean | string | null,
>   saveDataErrorExecution?: string | null,
>   saveDataSuccessExecution?: string | null,
>   executionTimeout?: number | null,
>   errorWorkflow?: string | null,
>   timezone?: string | null,
>   executionOrder?: string | null,
>   binaryMode?: string | null,
>   engineType?: string | null | null,
>   callerPolicy?: string | null,
>   callerIds?: string | null,
>   timeSavedMode?: string | null,
>   timeSavedPerExecution?: number | null,
>   redactionPolicy?: string | null,
>   redactCallerExecutions?: boolean | null,
>   availableInMCP?: boolean | null,
>   customTelemetryTags?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   credentialResolverId?: string | null
> } | null | null
> ```

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

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

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   onboardingId?: string | null,
>   templateId?: string | null,
>   instanceId?: string | null,
>   templateCredsSetupCompleted?: boolean | null
> } | null | null
> ```

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   workflowId?: string | null,
>   nodes?: {
>     id?: string | null,
>     name?: string | null,
>     webhookId?: string | null,
>     disabled?: boolean | null,
>     notesInFlow?: boolean | null,
>     notes?: string | null,
>     type?: string | null,
>     typeVersion?: number | null,
>     executeOnce?: boolean | null,
>     alwaysOutputData?: boolean | null,
>     retryOnFail?: boolean | null,
>     maxTries?: number | null,
>     waitBetweenTries?: number | null,
>     continueOnFail?: boolean | null,
>     onError?: string | null,
>     position?: number[] | null,
>     parameters?: {
>     } | null,
>     credentials?: {
>     } | null,
>     customTelemetryTags?: {
>       tag?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null
>   }[] | null,
>   connections?: {
>   } | null,
>   nodeGroups?: {
>     id?: string | null,
>     name?: string | null,
>     description?: string | null,
>     nodeIds?: string[] | null
>   }[] | null,
>   authors?: string | null,
>   name?: string | null | null,
>   description?: string | null | null,
>   autosaved?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   workflowPublishHistory?: {
>     id?: number | null,
>     workflowId?: string | null,
>     versionId?: string | null | null,
>     event?: string | null,
>     userId?: string | null | null,
>     createdAt?: string | null
>   }[] | null
> } | null | null
> ```

***

### archive

`workflows.archive`

Archive a workflow. Soft-deletes a workflow by archiving it. Idempotent: archiving an already archived workflow returns 200 with the current workflow. Requires the workflow:delete API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.workflows.archive({ workflowId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `active` | `boolean \| null` | No | Deprecated. Check whether `activeVersionId` is not null instead. |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | — |
| `versionCounter` | `number \| null` | No | — |
| `sourceWorkflowId` | `string \| null \| null` | No | — |
| `triggerCount` | `number \| null` | No | — |
| `nodes` | `object[] \| null` | No | Nodes that make up the workflow |
| `connections` | `object \| null` | No | Connections between nodes, keyed by source node name |
| `nodeGroups` | `object[] \| null` | No | Visual groupings of nodes shown as frames on the canvas |
| `settings` | `object \| null` | No | Execution and behaviour settings for the workflow |
| `staticData` | `object \| null` | No | Data the workflow keeps between executions |
| `pinData` | `object \| null` | No | Pinned sample data for nodes, keyed by node name |
| `meta` | `object \| null` | No | Workflow metadata such as template information |
| `tags` | `object[] \| null` | No | — |
| `shared` | `object[] \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   webhookId?: string | null,
>   disabled?: boolean | null,
>   notesInFlow?: boolean | null,
>   notes?: string | null,
>   type?: string | null,
>   typeVersion?: number | null,
>   executeOnce?: boolean | null,
>   alwaysOutputData?: boolean | null,
>   retryOnFail?: boolean | null,
>   maxTries?: number | null,
>   waitBetweenTries?: number | null,
>   continueOnFail?: boolean | null,
>   onError?: string | null,
>   position?: number[] | null,
>   parameters?: {
>   } | null,
>   credentials?: {
>   } | null,
>   customTelemetryTags?: {
>     tag?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

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

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   nodeIds?: string[] | null
> }[] | null
> ```

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   saveExecutionProgress?: boolean | string | null,
>   saveManualExecutions?: boolean | string | null,
>   saveDataErrorExecution?: string | null,
>   saveDataSuccessExecution?: string | null,
>   executionTimeout?: number | null,
>   errorWorkflow?: string | null,
>   timezone?: string | null,
>   executionOrder?: string | null,
>   binaryMode?: string | null,
>   engineType?: string | null | null,
>   callerPolicy?: string | null,
>   callerIds?: string | null,
>   timeSavedMode?: string | null,
>   timeSavedPerExecution?: number | null,
>   redactionPolicy?: string | null,
>   redactCallerExecutions?: boolean | null,
>   availableInMCP?: boolean | null,
>   customTelemetryTags?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   credentialResolverId?: string | null
> } | null | null
> ```

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

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

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   onboardingId?: string | null,
>   templateId?: string | null,
>   instanceId?: string | null,
>   templateCredsSetupCompleted?: boolean | null
> } | null | null
> ```

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] shared full type
>
> ```ts theme={null}
> {
>   role?: string | null,
>   workflowId?: string | null,
>   projectId?: string | null,
>   project?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     icon?: {
>       type?: string | null,
>       value?: string | null,
>       color?: string | null
>     } | null | null,
>     description?: string | null | null,
>     customTelemetryTags?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null,
>     creatorId?: string | null | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   workflowId?: string | null,
>   nodes?: {
>     id?: string | null,
>     name?: string | null,
>     webhookId?: string | null,
>     disabled?: boolean | null,
>     notesInFlow?: boolean | null,
>     notes?: string | null,
>     type?: string | null,
>     typeVersion?: number | null,
>     executeOnce?: boolean | null,
>     alwaysOutputData?: boolean | null,
>     retryOnFail?: boolean | null,
>     maxTries?: number | null,
>     waitBetweenTries?: number | null,
>     continueOnFail?: boolean | null,
>     onError?: string | null,
>     position?: number[] | null,
>     parameters?: {
>     } | null,
>     credentials?: {
>     } | null,
>     customTelemetryTags?: {
>       tag?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null
>   }[] | null,
>   connections?: {
>   } | null,
>   nodeGroups?: {
>     id?: string | null,
>     name?: string | null,
>     description?: string | null,
>     nodeIds?: string[] | null
>   }[] | null,
>   authors?: string | null,
>   name?: string | null | null,
>   description?: string | null | null,
>   autosaved?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   workflowPublishHistory?: {
>     id?: number | null,
>     workflowId?: string | null,
>     versionId?: string | null | null,
>     event?: string | null,
>     userId?: string | null | null,
>     createdAt?: string | null
>   }[] | null
> } | null | null
> ```

***

### create

`workflows.create`

Create a workflow. Create a workflow in your instance. Requires the workflow:create API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.workflows.create({
	name: 'Hello webhook',
	nodes: [{
		id: '1f2e3d4c-0000-4000-8000-000000000001',
		name: 'Webhook',
		type: 'n8n-nodes-base.webhook',
		typeVersion: 2,
		position: [0, 0],
		parameters: { path: 'hello', httpMethod: 'GET' },
	}],
	connections: {},
	settings: { executionOrder: 'v1' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `name` | `string` | Yes | — |
| `nodes` | `object[]` | Yes | Nodes that make up the workflow |
| `connections` | `object` | Yes | Connections between nodes, keyed by source node name |
| `settings` | `object` | Yes | — |
| `nodeGroups` | `object[]` | No | Visual groupings of nodes shown as frames on the canvas |
| `staticData` | `string \| Record<string, any> \| any` | No | Data the workflow keeps between executions |
| `pinData` | `Record<string, any> \| null` | No | Pinned sample data for nodes, keyed by node name |
| `projectId` | `string` | No | Target project to create the workflow in. Defaults to the user's personal project. |
| `parentFolderId` | `string \| null` | No | ID of the folder to place the workflow in. Omit or null to place at the project root. |
| `shared` | `object[]` | No | Accepted for compatibility and ignored. The owner share is derived from the target project. |
| `description` | `string` | No | Description of the workflow |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string,
>   name?: string,
>   webhookId?: string,
>   disabled?: boolean,
>   notesInFlow?: boolean,
>   notes?: string,
>   type?: string,
>   typeVersion?: number,
>   executeOnce?: boolean,
>   alwaysOutputData?: boolean,
>   retryOnFail?: boolean,
>   maxTries?: number,
>   waitBetweenTries?: number,
>   continueOnFail?: boolean,
>   onError?: string,
>   position?: number[],
>   parameters?: Record<string, any>,
>   credentials?: Record<string, any>,
>   customTelemetryTags?: {
>     tag?: {
>       key: string,
>       value: string
>     }[]
>   },
>   extendsCredential?: string
> }[]
> ```

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

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   saveExecutionProgress?: boolean,
>   saveManualExecutions?: boolean,
>   saveDataErrorExecution?: all | none,
>   saveDataSuccessExecution?: all | none,
>   executionTimeout?: number,
>   errorWorkflow?: string,
>   timezone?: string,
>   executionOrder?: string,
>   binaryMode?: separate | combined,
>   engineType?: string | null,
>   callerPolicy?: any | none | workflowsFromAList | workflowsFromSameOwner,
>   callerIds?: string,
>   timeSavedMode?: fixed | dynamic,
>   timeSavedPerExecution?: number,
>   redactionPolicy?: none | non-manual | manual-only | all,
>   redactCallerExecutions?: boolean,
>   availableInMCP?: boolean,
>   customTelemetryTags?: {
>     key: string,
>     value: string
>   }[],
>   credentialResolverId?: string
> }
> ```

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id: string,
>   name: string,
>   description?: string,
>   nodeIds: string[]
> }[]
> ```

> [accordion] shared full type
>
> ```ts theme={null}
> {
>   role?: string,
>   workflowId?: string,
>   projectId?: string,
>   project?: {
>     name?: string
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `active` | `boolean \| null` | No | Deprecated. Check whether `activeVersionId` is not null instead. |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | — |
| `versionCounter` | `number \| null` | No | — |
| `sourceWorkflowId` | `string \| null \| null` | No | — |
| `triggerCount` | `number \| null` | No | — |
| `nodes` | `object[] \| null` | No | Nodes that make up the workflow |
| `connections` | `object \| null` | No | Connections between nodes, keyed by source node name |
| `nodeGroups` | `object[] \| null` | No | Visual groupings of nodes shown as frames on the canvas |
| `settings` | `object \| null` | No | Execution and behaviour settings for the workflow |
| `staticData` | `object \| null` | No | Data the workflow keeps between executions |
| `pinData` | `object \| null` | No | Pinned sample data for nodes, keyed by node name |
| `meta` | `object \| null` | No | Workflow metadata such as template information |
| `tags` | `object[] \| null` | No | — |
| `shared` | `object[] \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |
| `parentFolder` | `object \| null` | No | Folder the workflow was placed in, or null at the project root |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   webhookId?: string | null,
>   disabled?: boolean | null,
>   notesInFlow?: boolean | null,
>   notes?: string | null,
>   type?: string | null,
>   typeVersion?: number | null,
>   executeOnce?: boolean | null,
>   alwaysOutputData?: boolean | null,
>   retryOnFail?: boolean | null,
>   maxTries?: number | null,
>   waitBetweenTries?: number | null,
>   continueOnFail?: boolean | null,
>   onError?: string | null,
>   position?: number[] | null,
>   parameters?: {
>   } | null,
>   credentials?: {
>   } | null,
>   customTelemetryTags?: {
>     tag?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

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

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   nodeIds?: string[] | null
> }[] | null
> ```

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   saveExecutionProgress?: boolean | string | null,
>   saveManualExecutions?: boolean | string | null,
>   saveDataErrorExecution?: string | null,
>   saveDataSuccessExecution?: string | null,
>   executionTimeout?: number | null,
>   errorWorkflow?: string | null,
>   timezone?: string | null,
>   executionOrder?: string | null,
>   binaryMode?: string | null,
>   engineType?: string | null | null,
>   callerPolicy?: string | null,
>   callerIds?: string | null,
>   timeSavedMode?: string | null,
>   timeSavedPerExecution?: number | null,
>   redactionPolicy?: string | null,
>   redactCallerExecutions?: boolean | null,
>   availableInMCP?: boolean | null,
>   customTelemetryTags?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   credentialResolverId?: string | null
> } | null | null
> ```

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

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

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   onboardingId?: string | null,
>   templateId?: string | null,
>   instanceId?: string | null,
>   templateCredsSetupCompleted?: boolean | null
> } | null | null
> ```

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] shared full type
>
> ```ts theme={null}
> {
>   role?: string | null,
>   workflowId?: string | null,
>   projectId?: string | null,
>   project?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     icon?: {
>       type?: string | null,
>       value?: string | null,
>       color?: string | null
>     } | null | null,
>     description?: string | null | null,
>     customTelemetryTags?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null,
>     creatorId?: string | null | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   workflowId?: string | null,
>   nodes?: {
>     id?: string | null,
>     name?: string | null,
>     webhookId?: string | null,
>     disabled?: boolean | null,
>     notesInFlow?: boolean | null,
>     notes?: string | null,
>     type?: string | null,
>     typeVersion?: number | null,
>     executeOnce?: boolean | null,
>     alwaysOutputData?: boolean | null,
>     retryOnFail?: boolean | null,
>     maxTries?: number | null,
>     waitBetweenTries?: number | null,
>     continueOnFail?: boolean | null,
>     onError?: string | null,
>     position?: number[] | null,
>     parameters?: {
>     } | null,
>     credentials?: {
>     } | null,
>     customTelemetryTags?: {
>       tag?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null
>   }[] | null,
>   connections?: {
>   } | null,
>   nodeGroups?: {
>     id?: string | null,
>     name?: string | null,
>     description?: string | null,
>     nodeIds?: string[] | null
>   }[] | null,
>   authors?: string | null,
>   name?: string | null | null,
>   description?: string | null | null,
>   autosaved?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   workflowPublishHistory?: {
>     id?: number | null,
>     workflowId?: string | null,
>     versionId?: string | null | null,
>     event?: string | null,
>     userId?: string | null | null,
>     createdAt?: string | null
>   }[] | null
> } | null | null
> ```

> [accordion] parentFolder full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   parentFolderId?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null | null
> ```

***

### deactivate

`workflows.deactivate`

Deactivate a workflow. Deprecated: use POST /workflows/\{id}/unpublish instead. Deactivate a workflow. Requires the workflow:deactivate API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.workflows.deactivate({ workflowId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `active` | `boolean \| null` | No | Deprecated. Check whether `activeVersionId` is not null instead. |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | — |
| `versionCounter` | `number \| null` | No | — |
| `sourceWorkflowId` | `string \| null \| null` | No | — |
| `triggerCount` | `number \| null` | No | — |
| `nodes` | `object[] \| null` | No | Nodes that make up the workflow |
| `connections` | `object \| null` | No | Connections between nodes, keyed by source node name |
| `nodeGroups` | `object[] \| null` | No | Visual groupings of nodes shown as frames on the canvas |
| `settings` | `object \| null` | No | Execution and behaviour settings for the workflow |
| `staticData` | `object \| null` | No | Data the workflow keeps between executions |
| `pinData` | `object \| null` | No | Pinned sample data for nodes, keyed by node name |
| `meta` | `object \| null` | No | Workflow metadata such as template information |
| `tags` | `object[] \| null` | No | — |
| `shared` | `object[] \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   webhookId?: string | null,
>   disabled?: boolean | null,
>   notesInFlow?: boolean | null,
>   notes?: string | null,
>   type?: string | null,
>   typeVersion?: number | null,
>   executeOnce?: boolean | null,
>   alwaysOutputData?: boolean | null,
>   retryOnFail?: boolean | null,
>   maxTries?: number | null,
>   waitBetweenTries?: number | null,
>   continueOnFail?: boolean | null,
>   onError?: string | null,
>   position?: number[] | null,
>   parameters?: {
>   } | null,
>   credentials?: {
>   } | null,
>   customTelemetryTags?: {
>     tag?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

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

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   nodeIds?: string[] | null
> }[] | null
> ```

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   saveExecutionProgress?: boolean | string | null,
>   saveManualExecutions?: boolean | string | null,
>   saveDataErrorExecution?: string | null,
>   saveDataSuccessExecution?: string | null,
>   executionTimeout?: number | null,
>   errorWorkflow?: string | null,
>   timezone?: string | null,
>   executionOrder?: string | null,
>   binaryMode?: string | null,
>   engineType?: string | null | null,
>   callerPolicy?: string | null,
>   callerIds?: string | null,
>   timeSavedMode?: string | null,
>   timeSavedPerExecution?: number | null,
>   redactionPolicy?: string | null,
>   redactCallerExecutions?: boolean | null,
>   availableInMCP?: boolean | null,
>   customTelemetryTags?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   credentialResolverId?: string | null
> } | null | null
> ```

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

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

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   onboardingId?: string | null,
>   templateId?: string | null,
>   instanceId?: string | null,
>   templateCredsSetupCompleted?: boolean | null
> } | null | null
> ```

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] shared full type
>
> ```ts theme={null}
> {
>   role?: string | null,
>   workflowId?: string | null,
>   projectId?: string | null,
>   project?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     icon?: {
>       type?: string | null,
>       value?: string | null,
>       color?: string | null
>     } | null | null,
>     description?: string | null | null,
>     customTelemetryTags?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null,
>     creatorId?: string | null | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   workflowId?: string | null,
>   nodes?: {
>     id?: string | null,
>     name?: string | null,
>     webhookId?: string | null,
>     disabled?: boolean | null,
>     notesInFlow?: boolean | null,
>     notes?: string | null,
>     type?: string | null,
>     typeVersion?: number | null,
>     executeOnce?: boolean | null,
>     alwaysOutputData?: boolean | null,
>     retryOnFail?: boolean | null,
>     maxTries?: number | null,
>     waitBetweenTries?: number | null,
>     continueOnFail?: boolean | null,
>     onError?: string | null,
>     position?: number[] | null,
>     parameters?: {
>     } | null,
>     credentials?: {
>     } | null,
>     customTelemetryTags?: {
>       tag?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null
>   }[] | null,
>   connections?: {
>   } | null,
>   nodeGroups?: {
>     id?: string | null,
>     name?: string | null,
>     description?: string | null,
>     nodeIds?: string[] | null
>   }[] | null,
>   authors?: string | null,
>   name?: string | null | null,
>   description?: string | null | null,
>   autosaved?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   workflowPublishHistory?: {
>     id?: number | null,
>     workflowId?: string | null,
>     versionId?: string | null | null,
>     event?: string | null,
>     userId?: string | null | null,
>     createdAt?: string | null
>   }[] | null
> } | null | null
> ```

***

### delete

`workflows.delete`

Delete a workflow. Delete a workflow. Requires the workflow:delete API key scope. Cannot be undone.

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

```ts theme={null}
await corsair.n8n.api.workflows.delete({ workflowId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `active` | `boolean \| null` | No | Deprecated. Check whether `activeVersionId` is not null instead. |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | — |
| `versionCounter` | `number \| null` | No | — |
| `sourceWorkflowId` | `string \| null \| null` | No | — |
| `triggerCount` | `number \| null` | No | — |
| `nodes` | `object[] \| null` | No | Nodes that make up the workflow |
| `connections` | `object \| null` | No | Connections between nodes, keyed by source node name |
| `nodeGroups` | `object[] \| null` | No | Visual groupings of nodes shown as frames on the canvas |
| `settings` | `object \| null` | No | Execution and behaviour settings for the workflow |
| `staticData` | `object \| null` | No | Data the workflow keeps between executions |
| `pinData` | `object \| null` | No | Pinned sample data for nodes, keyed by node name |
| `meta` | `object \| null` | No | Workflow metadata such as template information |
| `tags` | `object[] \| null` | No | — |
| `shared` | `object[] \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   webhookId?: string | null,
>   disabled?: boolean | null,
>   notesInFlow?: boolean | null,
>   notes?: string | null,
>   type?: string | null,
>   typeVersion?: number | null,
>   executeOnce?: boolean | null,
>   alwaysOutputData?: boolean | null,
>   retryOnFail?: boolean | null,
>   maxTries?: number | null,
>   waitBetweenTries?: number | null,
>   continueOnFail?: boolean | null,
>   onError?: string | null,
>   position?: number[] | null,
>   parameters?: {
>   } | null,
>   credentials?: {
>   } | null,
>   customTelemetryTags?: {
>     tag?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

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

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   nodeIds?: string[] | null
> }[] | null
> ```

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   saveExecutionProgress?: boolean | string | null,
>   saveManualExecutions?: boolean | string | null,
>   saveDataErrorExecution?: string | null,
>   saveDataSuccessExecution?: string | null,
>   executionTimeout?: number | null,
>   errorWorkflow?: string | null,
>   timezone?: string | null,
>   executionOrder?: string | null,
>   binaryMode?: string | null,
>   engineType?: string | null | null,
>   callerPolicy?: string | null,
>   callerIds?: string | null,
>   timeSavedMode?: string | null,
>   timeSavedPerExecution?: number | null,
>   redactionPolicy?: string | null,
>   redactCallerExecutions?: boolean | null,
>   availableInMCP?: boolean | null,
>   customTelemetryTags?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   credentialResolverId?: string | null
> } | null | null
> ```

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

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

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   onboardingId?: string | null,
>   templateId?: string | null,
>   instanceId?: string | null,
>   templateCredsSetupCompleted?: boolean | null
> } | null | null
> ```

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] shared full type
>
> ```ts theme={null}
> {
>   role?: string | null,
>   workflowId?: string | null,
>   projectId?: string | null,
>   project?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     icon?: {
>       type?: string | null,
>       value?: string | null,
>       color?: string | null
>     } | null | null,
>     description?: string | null | null,
>     customTelemetryTags?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null,
>     creatorId?: string | null | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   workflowId?: string | null,
>   nodes?: {
>     id?: string | null,
>     name?: string | null,
>     webhookId?: string | null,
>     disabled?: boolean | null,
>     notesInFlow?: boolean | null,
>     notes?: string | null,
>     type?: string | null,
>     typeVersion?: number | null,
>     executeOnce?: boolean | null,
>     alwaysOutputData?: boolean | null,
>     retryOnFail?: boolean | null,
>     maxTries?: number | null,
>     waitBetweenTries?: number | null,
>     continueOnFail?: boolean | null,
>     onError?: string | null,
>     position?: number[] | null,
>     parameters?: {
>     } | null,
>     credentials?: {
>     } | null,
>     customTelemetryTags?: {
>       tag?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null
>   }[] | null,
>   connections?: {
>   } | null,
>   nodeGroups?: {
>     id?: string | null,
>     name?: string | null,
>     description?: string | null,
>     nodeIds?: string[] | null
>   }[] | null,
>   authors?: string | null,
>   name?: string | null | null,
>   description?: string | null | null,
>   autosaved?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   workflowPublishHistory?: {
>     id?: number | null,
>     workflowId?: string | null,
>     versionId?: string | null | null,
>     event?: string | null,
>     userId?: string | null | null,
>     createdAt?: string | null
>   }[] | null
> } | null | null
> ```

***

### get

`workflows.get`

Retrieve a workflow. Retrieve a workflow. Requires the workflow:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.workflows.get({ workflowId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |
| `excludePinnedData` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `active` | `boolean \| null` | No | Deprecated. Check whether `activeVersionId` is not null instead. |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | — |
| `versionCounter` | `number \| null` | No | — |
| `sourceWorkflowId` | `string \| null \| null` | No | — |
| `triggerCount` | `number \| null` | No | — |
| `nodes` | `object[] \| null` | No | Nodes that make up the workflow |
| `connections` | `object \| null` | No | Connections between nodes, keyed by source node name |
| `nodeGroups` | `object[] \| null` | No | Visual groupings of nodes shown as frames on the canvas |
| `settings` | `object \| null` | No | Execution and behaviour settings for the workflow |
| `staticData` | `object \| null` | No | Data the workflow keeps between executions |
| `pinData` | `object \| null` | No | Pinned sample data for nodes, keyed by node name |
| `meta` | `object \| null` | No | Workflow metadata such as template information |
| `tags` | `object[] \| null` | No | — |
| `shared` | `object[] \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |
| `parentFolder` | `object \| null` | No | Folder that contains the workflow, or null at the project root |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   webhookId?: string | null,
>   disabled?: boolean | null,
>   notesInFlow?: boolean | null,
>   notes?: string | null,
>   type?: string | null,
>   typeVersion?: number | null,
>   executeOnce?: boolean | null,
>   alwaysOutputData?: boolean | null,
>   retryOnFail?: boolean | null,
>   maxTries?: number | null,
>   waitBetweenTries?: number | null,
>   continueOnFail?: boolean | null,
>   onError?: string | null,
>   position?: number[] | null,
>   parameters?: {
>   } | null,
>   credentials?: {
>   } | null,
>   customTelemetryTags?: {
>     tag?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

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

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   nodeIds?: string[] | null
> }[] | null
> ```

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   saveExecutionProgress?: boolean | string | null,
>   saveManualExecutions?: boolean | string | null,
>   saveDataErrorExecution?: string | null,
>   saveDataSuccessExecution?: string | null,
>   executionTimeout?: number | null,
>   errorWorkflow?: string | null,
>   timezone?: string | null,
>   executionOrder?: string | null,
>   binaryMode?: string | null,
>   engineType?: string | null | null,
>   callerPolicy?: string | null,
>   callerIds?: string | null,
>   timeSavedMode?: string | null,
>   timeSavedPerExecution?: number | null,
>   redactionPolicy?: string | null,
>   redactCallerExecutions?: boolean | null,
>   availableInMCP?: boolean | null,
>   customTelemetryTags?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   credentialResolverId?: string | null
> } | null | null
> ```

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

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

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   onboardingId?: string | null,
>   templateId?: string | null,
>   instanceId?: string | null,
>   templateCredsSetupCompleted?: boolean | null
> } | null | null
> ```

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] shared full type
>
> ```ts theme={null}
> {
>   role?: string | null,
>   workflowId?: string | null,
>   projectId?: string | null,
>   project?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     icon?: {
>       type?: string | null,
>       value?: string | null,
>       color?: string | null
>     } | null | null,
>     description?: string | null | null,
>     customTelemetryTags?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null,
>     creatorId?: string | null | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   workflowId?: string | null,
>   nodes?: {
>     id?: string | null,
>     name?: string | null,
>     webhookId?: string | null,
>     disabled?: boolean | null,
>     notesInFlow?: boolean | null,
>     notes?: string | null,
>     type?: string | null,
>     typeVersion?: number | null,
>     executeOnce?: boolean | null,
>     alwaysOutputData?: boolean | null,
>     retryOnFail?: boolean | null,
>     maxTries?: number | null,
>     waitBetweenTries?: number | null,
>     continueOnFail?: boolean | null,
>     onError?: string | null,
>     position?: number[] | null,
>     parameters?: {
>     } | null,
>     credentials?: {
>     } | null,
>     customTelemetryTags?: {
>       tag?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null
>   }[] | null,
>   connections?: {
>   } | null,
>   nodeGroups?: {
>     id?: string | null,
>     name?: string | null,
>     description?: string | null,
>     nodeIds?: string[] | null
>   }[] | null,
>   authors?: string | null,
>   name?: string | null | null,
>   description?: string | null | null,
>   autosaved?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   workflowPublishHistory?: {
>     id?: number | null,
>     workflowId?: string | null,
>     versionId?: string | null | null,
>     event?: string | null,
>     userId?: string | null | null,
>     createdAt?: string | null
>   }[] | null
> } | null | null
> ```

> [accordion] parentFolder full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   parentFolderId?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null | null
> ```

***

### getDependencies

`workflows.getDependencies`

List workflow dependencies. List the credentials, data tables, sub-workflows and error workflow that the workflow uses, and the workflows and agents that use the workflow. Requires the workflow:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.workflows.getDependencies({ workflowId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `workflowId` | `string` | Yes | The ID of the workflow |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |
| `inaccessibleCount` | `number \| null` | No | The number of dependencies that you do not have access to. They are not listed. |

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

***

### getTags

`workflows.getTags`

Get workflow tags. Get workflow tags. Requires the workflowTags:list API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.workflows.getTags({ workflowId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |

**Output:** `object[]`

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

***

### getVersion

`workflows.getVersion`

Retrieve a workflow version. Retrieve a single version of a workflow from its version history. Requires the workflow:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.workflows.getVersion({ workflowId: '2tUt1wbLX592XDdX', workflowVersionId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |
| `workflowVersionId` | `string` | Yes | The ID of the workflow version |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `versionId` | `string \| null` | No | — |
| `workflowId` | `string \| null` | No | — |
| `nodes` | `object[] \| null` | No | Nodes that make up the workflow |
| `connections` | `object \| null` | No | Connections between nodes, keyed by source node name |
| `nodeGroups` | `object[] \| null` | No | Visual groupings of nodes shown as frames on the canvas |
| `authors` | `string \| null` | No | — |
| `name` | `string \| null \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   webhookId?: string | null,
>   disabled?: boolean | null,
>   notesInFlow?: boolean | null,
>   notes?: string | null,
>   type?: string | null,
>   typeVersion?: number | null,
>   executeOnce?: boolean | null,
>   alwaysOutputData?: boolean | null,
>   retryOnFail?: boolean | null,
>   maxTries?: number | null,
>   waitBetweenTries?: number | null,
>   continueOnFail?: boolean | null,
>   onError?: string | null,
>   position?: number[] | null,
>   parameters?: {
>   } | null,
>   credentials?: {
>   } | null,
>   customTelemetryTags?: {
>     tag?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

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

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   nodeIds?: string[] | null
> }[] | null
> ```

***

### getVersionLegacy

`workflows.getVersionLegacy`

Retrieves a specific version of a workflow. Deprecated: use GET /workflows/\{workflowId}/versions/\{workflowVersionId} instead. Retrieves a specific version of a workflow from workflow history. Requires the workflow:read API key scope. The older route for workflows.getVersion.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.workflows.getVersionLegacy({ workflowId: '2tUt1wbLX592XDdX', workflowVersionId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |
| `workflowVersionId` | `string` | Yes | The ID of the workflow version |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `versionId` | `string \| null` | No | — |
| `workflowId` | `string \| null` | No | — |
| `nodes` | `object[] \| null` | No | Nodes that make up the workflow |
| `connections` | `object \| null` | No | Connections between nodes, keyed by source node name |
| `nodeGroups` | `object[] \| null` | No | Visual groupings of nodes shown as frames on the canvas |
| `authors` | `string \| null` | No | — |
| `name` | `string \| null \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   webhookId?: string | null,
>   disabled?: boolean | null,
>   notesInFlow?: boolean | null,
>   notes?: string | null,
>   type?: string | null,
>   typeVersion?: number | null,
>   executeOnce?: boolean | null,
>   alwaysOutputData?: boolean | null,
>   retryOnFail?: boolean | null,
>   maxTries?: number | null,
>   waitBetweenTries?: number | null,
>   continueOnFail?: boolean | null,
>   onError?: string | null,
>   position?: number[] | null,
>   parameters?: {
>   } | null,
>   credentials?: {
>   } | null,
>   customTelemetryTags?: {
>     tag?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

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

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   nodeIds?: string[] | null
> }[] | null
> ```

***

### list

`workflows.list`

Retrieve all workflows. Retrieve all workflows from your instance. Requires the workflow:list API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.workflows.list({ active: true, limit: 50 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `offset` | `number` | No | The number of items to skip before starting to collect the result set. |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `active` | `boolean` | No | — |
| `tags` | `string` | No | — |
| `name` | `string` | No | — |
| `projectId` | `string` | No | — |
| `excludePinnedData` | `boolean` | No | — |
| `includeParentFolder` | `boolean` | No | Whether to add `parentFolder` to each workflow. `parentFolder` holds the ID of the folder that contains the workflow, or is `null` at the project root. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   active?: boolean | null,
>   activeVersionId?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   isArchived?: boolean | null,
>   versionId?: string | null,
>   triggerCount?: number | null,
>   nodes?: {
>     id?: string | null,
>     name?: string | null,
>     webhookId?: string | null,
>     disabled?: boolean | null,
>     notesInFlow?: boolean | null,
>     notes?: string | null,
>     type?: string | null,
>     typeVersion?: number | null,
>     executeOnce?: boolean | null,
>     alwaysOutputData?: boolean | null,
>     retryOnFail?: boolean | null,
>     maxTries?: number | null,
>     waitBetweenTries?: number | null,
>     continueOnFail?: boolean | null,
>     onError?: string | null,
>     position?: number[] | null,
>     parameters?: {
>     } | null,
>     credentials?: {
>     } | null,
>     customTelemetryTags?: {
>       tag?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null
>   }[] | null,
>   connections?: {
>   } | null,
>   nodeGroups?: {
>     id?: string | null,
>     name?: string | null,
>     description?: string | null,
>     nodeIds?: string[] | null
>   }[] | null,
>   settings?: {
>     saveExecutionProgress?: boolean | string | null,
>     saveManualExecutions?: boolean | string | null,
>     saveDataErrorExecution?: string | null,
>     saveDataSuccessExecution?: string | null,
>     executionTimeout?: number | null,
>     errorWorkflow?: string | null,
>     timezone?: string | null,
>     executionOrder?: string | null,
>     binaryMode?: string | null,
>     engineType?: string | null | null,
>     callerPolicy?: string | null,
>     callerIds?: string | null,
>     timeSavedMode?: string | null,
>     timeSavedPerExecution?: number | null,
>     redactionPolicy?: string | null,
>     redactCallerExecutions?: boolean | null,
>     availableInMCP?: boolean | null,
>     customTelemetryTags?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null,
>     credentialResolverId?: string | null
>   } | null | null,
>   staticData?: {
>   } | null | null,
>   pinData?: {
>   } | null | null,
>   meta?: {
>     onboardingId?: string | null,
>     templateId?: string | null,
>     instanceId?: string | null,
>     templateCredsSetupCompleted?: boolean | null
>   } | null | null,
>   tags?: {
>     id?: string | null,
>     name?: string | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   }[] | null,
>   shared?: {
>     role?: string | null,
>     workflowId?: string | null,
>     projectId?: string | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   }[] | null,
>   activeVersion?: {
>     versionId?: string | null,
>     workflowId?: string | null,
>     nodes?: {
>       id?: string | null,
>       name?: string | null,
>       webhookId?: string | null,
>       disabled?: boolean | null,
>       notesInFlow?: boolean | null,
>       notes?: string | null,
>       type?: string | null,
>       typeVersion?: number | null,
>       executeOnce?: boolean | null,
>       alwaysOutputData?: boolean | null,
>       retryOnFail?: boolean | null,
>       maxTries?: number | null,
>       waitBetweenTries?: number | null,
>       continueOnFail?: boolean | null,
>       onError?: string | null,
>       position?: number[] | null,
>       parameters?: {
>       } | null,
>       credentials?: {
>       } | null,
>       customTelemetryTags?: {
>         tag?: {
>           key?: string | null,
>           value?: string | null
>         }[] | null
>       } | null
>     }[] | null,
>     connections?: {
>     } | null,
>     nodeGroups?: {
>       id?: string | null,
>       name?: string | null,
>       description?: string | null,
>       nodeIds?: string[] | null
>     }[] | null,
>     authors?: string | null,
>     name?: string | null | null,
>     description?: string | null | null,
>     autosaved?: boolean | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null | null,
>   parentFolder?: {
>     id?: string | null
>   } | null | null
> }[] | null
> ```

***

### listHistory

`workflows.listHistory`

Retrieve workflow version history. Returns a paginated list of workflow versions (version IDs and metadata) for a workflow. Requires the workflow:read API key scope.

**Risk:** `read`

```ts theme={null}
await corsair.n8n.api.workflows.listHistory({ workflowId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | The maximum number of items to return. |
| `cursor` | `string` | No | Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first "page" of the collection. See pagination for more detail. |
| `workflowId` | `string` | Yes | The ID of the workflow |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[] \| null` | No | — |
| `nextCursor` | `string \| null \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   workflowId?: string | null,
>   authors?: string | null,
>   name?: string | null | null,
>   description?: string | null | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### publish

`workflows.publish`

Publish a workflow. Publish a workflow. In n8n v1, this action was termed activating a workflow. Requires the workflow:activate API key scope. Publishes the current version: its triggers start running it.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.workflows.publish({ workflowId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |
| `versionId` | `string` | No | The specific version ID to publish. If not provided, the latest version is used. |
| `name` | `string` | No | Optional name for the workflow version during publication |
| `description` | `string` | No | Optional description for the workflow version during publication |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `active` | `boolean \| null` | No | Deprecated. Check whether `activeVersionId` is not null instead. |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | — |
| `versionCounter` | `number \| null` | No | — |
| `sourceWorkflowId` | `string \| null \| null` | No | — |
| `triggerCount` | `number \| null` | No | — |
| `nodes` | `object[] \| null` | No | Nodes that make up the workflow |
| `connections` | `object \| null` | No | Connections between nodes, keyed by source node name |
| `nodeGroups` | `object[] \| null` | No | Visual groupings of nodes shown as frames on the canvas |
| `settings` | `object \| null` | No | Execution and behaviour settings for the workflow |
| `staticData` | `object \| null` | No | Data the workflow keeps between executions |
| `pinData` | `object \| null` | No | Pinned sample data for nodes, keyed by node name |
| `meta` | `object \| null` | No | Workflow metadata such as template information |
| `tags` | `object[] \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   webhookId?: string | null,
>   disabled?: boolean | null,
>   notesInFlow?: boolean | null,
>   notes?: string | null,
>   type?: string | null,
>   typeVersion?: number | null,
>   executeOnce?: boolean | null,
>   alwaysOutputData?: boolean | null,
>   retryOnFail?: boolean | null,
>   maxTries?: number | null,
>   waitBetweenTries?: number | null,
>   continueOnFail?: boolean | null,
>   onError?: string | null,
>   position?: number[] | null,
>   parameters?: {
>   } | null,
>   credentials?: {
>   } | null,
>   customTelemetryTags?: {
>     tag?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

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

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   nodeIds?: string[] | null
> }[] | null
> ```

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   saveExecutionProgress?: boolean | string | null,
>   saveManualExecutions?: boolean | string | null,
>   saveDataErrorExecution?: string | null,
>   saveDataSuccessExecution?: string | null,
>   executionTimeout?: number | null,
>   errorWorkflow?: string | null,
>   timezone?: string | null,
>   executionOrder?: string | null,
>   binaryMode?: string | null,
>   engineType?: string | null | null,
>   callerPolicy?: string | null,
>   callerIds?: string | null,
>   timeSavedMode?: string | null,
>   timeSavedPerExecution?: number | null,
>   redactionPolicy?: string | null,
>   redactCallerExecutions?: boolean | null,
>   availableInMCP?: boolean | null,
>   customTelemetryTags?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   credentialResolverId?: string | null
> } | null | null
> ```

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

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

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   onboardingId?: string | null,
>   templateId?: string | null,
>   instanceId?: string | null,
>   templateCredsSetupCompleted?: boolean | null
> } | null | null
> ```

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   workflowId?: string | null,
>   nodes?: {
>     id?: string | null,
>     name?: string | null,
>     webhookId?: string | null,
>     disabled?: boolean | null,
>     notesInFlow?: boolean | null,
>     notes?: string | null,
>     type?: string | null,
>     typeVersion?: number | null,
>     executeOnce?: boolean | null,
>     alwaysOutputData?: boolean | null,
>     retryOnFail?: boolean | null,
>     maxTries?: number | null,
>     waitBetweenTries?: number | null,
>     continueOnFail?: boolean | null,
>     onError?: string | null,
>     position?: number[] | null,
>     parameters?: {
>     } | null,
>     credentials?: {
>     } | null,
>     customTelemetryTags?: {
>       tag?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null
>   }[] | null,
>   connections?: {
>   } | null,
>   nodeGroups?: {
>     id?: string | null,
>     name?: string | null,
>     description?: string | null,
>     nodeIds?: string[] | null
>   }[] | null,
>   authors?: string | null,
>   name?: string | null | null,
>   description?: string | null | null,
>   autosaved?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   workflowPublishHistory?: {
>     id?: number | null,
>     workflowId?: string | null,
>     versionId?: string | null | null,
>     event?: string | null,
>     userId?: string | null | null,
>     createdAt?: string | null
>   }[] | null
> } | null | null
> ```

***

### run

`workflows.run`

Run a workflow with existing run data. Start a manual execution of the latest saved version of a workflow. n8n reuses the given run data and runs the nodes up to the destination node. The call returns when the execution starts. It does not wait for the execution to finish. The user must also have the workflow:execute project scope. Runs the workflow now; its nodes may call outside services or spend credits there. Added in n8n 2.50; older instances answer 404.

**Risk:** `destructive`

```ts theme={null}
await corsair.n8n.api.workflows.run({
	workflowId: '2tUt1wbLX592XDdX',
	runData: {},
	destinationNode: { nodeName: 'example', mode: 'inclusive' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409. |
| `workflowId` | `string` | Yes | The ID of the workflow |
| `runData` | `object` | Yes | Run data to reuse, keyed by node name. Use `data.resultData.runData` from `GET /executions/{id}?includeData=true`. n8n reuses the output of these nodes and runs the other nodes up to the destination node. If the run data does not reach the destination node from a trigger, n8n runs the workflow from its trigger. If that trigger needs an external event to start, the API returns `409`. |
| `destinationNode` | `object` | Yes | The node where the run stops. |
| `dirtyNodeNames` | `string[]` | No | Names of nodes that changed since the run data was made. n8n runs these nodes again and does not reuse their run data. |

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

> [accordion] destinationNode full type
>
> ```ts theme={null}
> {
>   nodeName: string,
>   mode: inclusive | exclusive
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `executionId` | `string \| null` | No | ID of the new execution. Use `GET /executions/{id}` to read its status. |

***

### setTags

`workflows.setTags`

Update tags of a workflow. Update tags of a workflow. Requires the workflowTags:update API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.workflows.setTags({
	workflowId: '2tUt1wbLX592XDdX',
	tags: [{ id: 'doc_8f2k1x9q' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |
| `tags` | `object[]` | Yes | — |

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   id: string
> }[]
> ```

**Output:** `object[]`

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

***

### transfer

`workflows.transfer`

Transfer a workflow to another project. Transfer a workflow to another project. Requires the workflow:move API key scope.

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

```ts theme={null}
await corsair.n8n.api.workflows.transfer({ workflowId: '2tUt1wbLX592XDdX', destinationProjectId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |
| `destinationProjectId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | n8n accepted the call; it answered with no body. |

***

### unarchive

`workflows.unarchive`

Unarchive a workflow. Restores an archived workflow. Requires the workflow:delete API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.workflows.unarchive({ workflowId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `active` | `boolean \| null` | No | Deprecated. Check whether `activeVersionId` is not null instead. |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | — |
| `versionCounter` | `number \| null` | No | — |
| `sourceWorkflowId` | `string \| null \| null` | No | — |
| `triggerCount` | `number \| null` | No | — |
| `nodes` | `object[] \| null` | No | Nodes that make up the workflow |
| `connections` | `object \| null` | No | Connections between nodes, keyed by source node name |
| `nodeGroups` | `object[] \| null` | No | Visual groupings of nodes shown as frames on the canvas |
| `settings` | `object \| null` | No | Execution and behaviour settings for the workflow |
| `staticData` | `object \| null` | No | Data the workflow keeps between executions |
| `pinData` | `object \| null` | No | Pinned sample data for nodes, keyed by node name |
| `meta` | `object \| null` | No | Workflow metadata such as template information |
| `tags` | `object[] \| null` | No | — |
| `shared` | `object[] \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   webhookId?: string | null,
>   disabled?: boolean | null,
>   notesInFlow?: boolean | null,
>   notes?: string | null,
>   type?: string | null,
>   typeVersion?: number | null,
>   executeOnce?: boolean | null,
>   alwaysOutputData?: boolean | null,
>   retryOnFail?: boolean | null,
>   maxTries?: number | null,
>   waitBetweenTries?: number | null,
>   continueOnFail?: boolean | null,
>   onError?: string | null,
>   position?: number[] | null,
>   parameters?: {
>   } | null,
>   credentials?: {
>   } | null,
>   customTelemetryTags?: {
>     tag?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

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

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   nodeIds?: string[] | null
> }[] | null
> ```

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   saveExecutionProgress?: boolean | string | null,
>   saveManualExecutions?: boolean | string | null,
>   saveDataErrorExecution?: string | null,
>   saveDataSuccessExecution?: string | null,
>   executionTimeout?: number | null,
>   errorWorkflow?: string | null,
>   timezone?: string | null,
>   executionOrder?: string | null,
>   binaryMode?: string | null,
>   engineType?: string | null | null,
>   callerPolicy?: string | null,
>   callerIds?: string | null,
>   timeSavedMode?: string | null,
>   timeSavedPerExecution?: number | null,
>   redactionPolicy?: string | null,
>   redactCallerExecutions?: boolean | null,
>   availableInMCP?: boolean | null,
>   customTelemetryTags?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   credentialResolverId?: string | null
> } | null | null
> ```

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

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

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   onboardingId?: string | null,
>   templateId?: string | null,
>   instanceId?: string | null,
>   templateCredsSetupCompleted?: boolean | null
> } | null | null
> ```

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] shared full type
>
> ```ts theme={null}
> {
>   role?: string | null,
>   workflowId?: string | null,
>   projectId?: string | null,
>   project?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     icon?: {
>       type?: string | null,
>       value?: string | null,
>       color?: string | null
>     } | null | null,
>     description?: string | null | null,
>     customTelemetryTags?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null,
>     creatorId?: string | null | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   workflowId?: string | null,
>   nodes?: {
>     id?: string | null,
>     name?: string | null,
>     webhookId?: string | null,
>     disabled?: boolean | null,
>     notesInFlow?: boolean | null,
>     notes?: string | null,
>     type?: string | null,
>     typeVersion?: number | null,
>     executeOnce?: boolean | null,
>     alwaysOutputData?: boolean | null,
>     retryOnFail?: boolean | null,
>     maxTries?: number | null,
>     waitBetweenTries?: number | null,
>     continueOnFail?: boolean | null,
>     onError?: string | null,
>     position?: number[] | null,
>     parameters?: {
>     } | null,
>     credentials?: {
>     } | null,
>     customTelemetryTags?: {
>       tag?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null
>   }[] | null,
>   connections?: {
>   } | null,
>   nodeGroups?: {
>     id?: string | null,
>     name?: string | null,
>     description?: string | null,
>     nodeIds?: string[] | null
>   }[] | null,
>   authors?: string | null,
>   name?: string | null | null,
>   description?: string | null | null,
>   autosaved?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   workflowPublishHistory?: {
>     id?: number | null,
>     workflowId?: string | null,
>     versionId?: string | null | null,
>     event?: string | null,
>     userId?: string | null | null,
>     createdAt?: string | null
>   }[] | null
> } | null | null
> ```

***

### unpublish

`workflows.unpublish`

Unpublish a workflow. Unpublish a workflow. In n8n v1, this action was termed deactivating a workflow. Requires the workflow:deactivate API key scope.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.workflows.unpublish({ workflowId: '2tUt1wbLX592XDdX' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `active` | `boolean \| null` | No | Deprecated. Check whether `activeVersionId` is not null instead. |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | — |
| `versionCounter` | `number \| null` | No | — |
| `sourceWorkflowId` | `string \| null \| null` | No | — |
| `triggerCount` | `number \| null` | No | — |
| `nodes` | `object[] \| null` | No | Nodes that make up the workflow |
| `connections` | `object \| null` | No | Connections between nodes, keyed by source node name |
| `nodeGroups` | `object[] \| null` | No | Visual groupings of nodes shown as frames on the canvas |
| `settings` | `object \| null` | No | Execution and behaviour settings for the workflow |
| `staticData` | `object \| null` | No | Data the workflow keeps between executions |
| `pinData` | `object \| null` | No | Pinned sample data for nodes, keyed by node name |
| `meta` | `object \| null` | No | Workflow metadata such as template information |
| `tags` | `object[] \| null` | No | — |
| `shared` | `object[] \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   webhookId?: string | null,
>   disabled?: boolean | null,
>   notesInFlow?: boolean | null,
>   notes?: string | null,
>   type?: string | null,
>   typeVersion?: number | null,
>   executeOnce?: boolean | null,
>   alwaysOutputData?: boolean | null,
>   retryOnFail?: boolean | null,
>   maxTries?: number | null,
>   waitBetweenTries?: number | null,
>   continueOnFail?: boolean | null,
>   onError?: string | null,
>   position?: number[] | null,
>   parameters?: {
>   } | null,
>   credentials?: {
>   } | null,
>   customTelemetryTags?: {
>     tag?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

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

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   nodeIds?: string[] | null
> }[] | null
> ```

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   saveExecutionProgress?: boolean | string | null,
>   saveManualExecutions?: boolean | string | null,
>   saveDataErrorExecution?: string | null,
>   saveDataSuccessExecution?: string | null,
>   executionTimeout?: number | null,
>   errorWorkflow?: string | null,
>   timezone?: string | null,
>   executionOrder?: string | null,
>   binaryMode?: string | null,
>   engineType?: string | null | null,
>   callerPolicy?: string | null,
>   callerIds?: string | null,
>   timeSavedMode?: string | null,
>   timeSavedPerExecution?: number | null,
>   redactionPolicy?: string | null,
>   redactCallerExecutions?: boolean | null,
>   availableInMCP?: boolean | null,
>   customTelemetryTags?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   credentialResolverId?: string | null
> } | null | null
> ```

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

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

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   onboardingId?: string | null,
>   templateId?: string | null,
>   instanceId?: string | null,
>   templateCredsSetupCompleted?: boolean | null
> } | null | null
> ```

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] shared full type
>
> ```ts theme={null}
> {
>   role?: string | null,
>   workflowId?: string | null,
>   projectId?: string | null,
>   project?: {
>     id?: string | null,
>     name?: string | null,
>     type?: string | null,
>     icon?: {
>       type?: string | null,
>       value?: string | null,
>       color?: string | null
>     } | null | null,
>     description?: string | null | null,
>     customTelemetryTags?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null,
>     creatorId?: string | null | null,
>     createdAt?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   workflowId?: string | null,
>   nodes?: {
>     id?: string | null,
>     name?: string | null,
>     webhookId?: string | null,
>     disabled?: boolean | null,
>     notesInFlow?: boolean | null,
>     notes?: string | null,
>     type?: string | null,
>     typeVersion?: number | null,
>     executeOnce?: boolean | null,
>     alwaysOutputData?: boolean | null,
>     retryOnFail?: boolean | null,
>     maxTries?: number | null,
>     waitBetweenTries?: number | null,
>     continueOnFail?: boolean | null,
>     onError?: string | null,
>     position?: number[] | null,
>     parameters?: {
>     } | null,
>     credentials?: {
>     } | null,
>     customTelemetryTags?: {
>       tag?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null
>   }[] | null,
>   connections?: {
>   } | null,
>   nodeGroups?: {
>     id?: string | null,
>     name?: string | null,
>     description?: string | null,
>     nodeIds?: string[] | null
>   }[] | null,
>   authors?: string | null,
>   name?: string | null | null,
>   description?: string | null | null,
>   autosaved?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   workflowPublishHistory?: {
>     id?: number | null,
>     workflowId?: string | null,
>     versionId?: string | null | null,
>     event?: string | null,
>     userId?: string | null | null,
>     createdAt?: string | null
>   }[] | null
> } | null | null
> ```

***

### update

`workflows.update`

Update a workflow. Update a workflow. If the workflow is published, the updated version will be automatically re-published unless publishIfActive is set to false.

**Risk:** `write`

```ts theme={null}
await corsair.n8n.api.workflows.update({
	workflowId: '2tUt1wbLX592XDdX',
	name: 'example',
	nodes: [{}],
	connections: {},
	settings: {},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workflowId` | `string` | Yes | The ID of the workflow |
| `publishIfActive` | `boolean` | No | Whether to publish the update if the workflow is currently published. Set to `false` to save the change as a draft on the existing published version instead of releasing it. Has no effect on a workflow that isn't currently published. |
| `name` | `string` | Yes | — |
| `nodes` | `object[]` | Yes | Nodes that make up the workflow |
| `connections` | `object` | Yes | Connections between nodes, keyed by source node name |
| `settings` | `object` | Yes | — |
| `nodeGroups` | `object[]` | No | Visual groupings of nodes shown as frames on the canvas |
| `staticData` | `string \| Record<string, any> \| any` | No | Data the workflow keeps between executions |
| `pinData` | `Record<string, any> \| null` | No | Pinned sample data for nodes, keyed by node name |
| `parentFolderId` | `string \| null` | No | ID of the folder to move the workflow into. Pass null to move it to the project root; omit to leave its current folder unchanged. |
| `shared` | `object[]` | No | Accepted for compatibility and ignored. The owner share is derived from the target project. |
| `description` | `string` | No | Description of the workflow |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string,
>   name?: string,
>   webhookId?: string,
>   disabled?: boolean,
>   notesInFlow?: boolean,
>   notes?: string,
>   type?: string,
>   typeVersion?: number,
>   executeOnce?: boolean,
>   alwaysOutputData?: boolean,
>   retryOnFail?: boolean,
>   maxTries?: number,
>   waitBetweenTries?: number,
>   continueOnFail?: boolean,
>   onError?: string,
>   position?: number[],
>   parameters?: Record<string, any>,
>   credentials?: Record<string, any>,
>   customTelemetryTags?: {
>     tag?: {
>       key: string,
>       value: string
>     }[]
>   },
>   extendsCredential?: string
> }[]
> ```

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

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   saveExecutionProgress?: boolean,
>   saveManualExecutions?: boolean,
>   saveDataErrorExecution?: all | none,
>   saveDataSuccessExecution?: all | none,
>   executionTimeout?: number,
>   errorWorkflow?: string,
>   timezone?: string,
>   executionOrder?: string,
>   binaryMode?: separate | combined,
>   engineType?: string | null,
>   callerPolicy?: any | none | workflowsFromAList | workflowsFromSameOwner,
>   callerIds?: string,
>   timeSavedMode?: fixed | dynamic,
>   timeSavedPerExecution?: number,
>   redactionPolicy?: none | non-manual | manual-only | all,
>   redactCallerExecutions?: boolean,
>   availableInMCP?: boolean,
>   customTelemetryTags?: {
>     key: string,
>     value: string
>   }[],
>   credentialResolverId?: string
> }
> ```

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id: string,
>   name: string,
>   description?: string,
>   nodeIds: string[]
> }[]
> ```

> [accordion] shared full type
>
> ```ts theme={null}
> {
>   role?: string,
>   workflowId?: string,
>   projectId?: string,
>   project?: {
>     name?: string
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `description` | `string \| null \| null` | No | — |
| `active` | `boolean \| null` | No | Deprecated. Check whether `activeVersionId` is not null instead. |
| `activeVersionId` | `string \| null \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `isArchived` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | — |
| `versionCounter` | `number \| null` | No | — |
| `sourceWorkflowId` | `string \| null \| null` | No | — |
| `triggerCount` | `number \| null` | No | — |
| `nodes` | `object[] \| null` | No | Nodes that make up the workflow |
| `connections` | `object \| null` | No | Connections between nodes, keyed by source node name |
| `nodeGroups` | `object[] \| null` | No | Visual groupings of nodes shown as frames on the canvas |
| `settings` | `object \| null` | No | Execution and behaviour settings for the workflow |
| `staticData` | `object \| null` | No | Data the workflow keeps between executions |
| `pinData` | `object \| null` | No | Pinned sample data for nodes, keyed by node name |
| `meta` | `object \| null` | No | Workflow metadata such as template information |
| `tags` | `object[] \| null` | No | — |
| `activeVersion` | `object \| null` | No | — |

> [accordion] nodes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   webhookId?: string | null,
>   disabled?: boolean | null,
>   notesInFlow?: boolean | null,
>   notes?: string | null,
>   type?: string | null,
>   typeVersion?: number | null,
>   executeOnce?: boolean | null,
>   alwaysOutputData?: boolean | null,
>   retryOnFail?: boolean | null,
>   maxTries?: number | null,
>   waitBetweenTries?: number | null,
>   continueOnFail?: boolean | null,
>   onError?: string | null,
>   position?: number[] | null,
>   parameters?: {
>   } | null,
>   credentials?: {
>   } | null,
>   customTelemetryTags?: {
>     tag?: {
>       key?: string | null,
>       value?: string | null
>     }[] | null
>   } | null
> }[] | null
> ```

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

> [accordion] nodeGroups full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   nodeIds?: string[] | null
> }[] | null
> ```

> [accordion] settings full type
>
> ```ts theme={null}
> {
>   saveExecutionProgress?: boolean | string | null,
>   saveManualExecutions?: boolean | string | null,
>   saveDataErrorExecution?: string | null,
>   saveDataSuccessExecution?: string | null,
>   executionTimeout?: number | null,
>   errorWorkflow?: string | null,
>   timezone?: string | null,
>   executionOrder?: string | null,
>   binaryMode?: string | null,
>   engineType?: string | null | null,
>   callerPolicy?: string | null,
>   callerIds?: string | null,
>   timeSavedMode?: string | null,
>   timeSavedPerExecution?: number | null,
>   redactionPolicy?: string | null,
>   redactCallerExecutions?: boolean | null,
>   availableInMCP?: boolean | null,
>   customTelemetryTags?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   credentialResolverId?: string | null
> } | null | null
> ```

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

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

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   onboardingId?: string | null,
>   templateId?: string | null,
>   instanceId?: string | null,
>   templateCredsSetupCompleted?: boolean | null
> } | null | null
> ```

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] activeVersion full type
>
> ```ts theme={null}
> {
>   versionId?: string | null,
>   workflowId?: string | null,
>   nodes?: {
>     id?: string | null,
>     name?: string | null,
>     webhookId?: string | null,
>     disabled?: boolean | null,
>     notesInFlow?: boolean | null,
>     notes?: string | null,
>     type?: string | null,
>     typeVersion?: number | null,
>     executeOnce?: boolean | null,
>     alwaysOutputData?: boolean | null,
>     retryOnFail?: boolean | null,
>     maxTries?: number | null,
>     waitBetweenTries?: number | null,
>     continueOnFail?: boolean | null,
>     onError?: string | null,
>     position?: number[] | null,
>     parameters?: {
>     } | null,
>     credentials?: {
>     } | null,
>     customTelemetryTags?: {
>       tag?: {
>         key?: string | null,
>         value?: string | null
>       }[] | null
>     } | null
>   }[] | null,
>   connections?: {
>   } | null,
>   nodeGroups?: {
>     id?: string | null,
>     name?: string | null,
>     description?: string | null,
>     nodeIds?: string[] | null
>   }[] | null,
>   authors?: string | null,
>   name?: string | null | null,
>   description?: string | null | null,
>   autosaved?: boolean | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   workflowPublishHistory?: {
>     id?: number | null,
>     workflowId?: string | null,
>     versionId?: string | null | null,
>     event?: string | null,
>     userId?: string | null | null,
>     createdAt?: string | null
>   }[] | null
> } | null | null
> ```

***


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