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

# Railway API reference

> API reference for the Railway plugin in Corsair: every `railway.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Access Group Members

### add

`accessGroupMembers.add`

Add a workspace member to an access group

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.accessGroupMembers.add({
	input: { accessGroupId: 'example', userId: '00000009-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `accessGroup` | `object \| null` | No | — |
| `accessGroupId` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `user` | `object \| null` | No | — |
| `userId` | `string \| null` | No | — |

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

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

***

### remove

`accessGroupMembers.remove`

Remove a member from an access group

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.accessGroupMembers.remove({
	input: { accessGroupId: 'example', userId: '00000009-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

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

**Output:** `boolean`

***

## Access Group Projects

### attach

`accessGroupProjects.attach`

Attach a project to an access group

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.accessGroupProjects.attach({
	input: { accessGroupId: 'example', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   accessGroupId: string,
>   projectId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `accessGroup` | `object \| null` | No | — |
| `accessGroupId` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

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

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

***

### detach

`accessGroupProjects.detach`

Detach a project from an access group

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.accessGroupProjects.detach({
	input: { accessGroupId: 'example', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   accessGroupId: string,
>   projectId: string
> }
> ```

**Output:** `boolean`

***

## Access Groups

### create

`accessGroups.create`

Create an access group in a workspace

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.accessGroups.create({
	input: { name: 'api', role: 'MEMBER', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   name: string,
>   role: ADMIN | MEMBER | VIEWER,
>   workspaceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |
| `source` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `workspace` | `object \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] workspace full type
>
> ```ts theme={null}
> {
>   adoptionLevel?: number | null,
>   avatar?: string | null,
>   createdAt?: string | null,
>   discordRole?: string | null,
>   has2FAEnforcement?: boolean | null,
>   hasAutomaticDiagnosis?: boolean | null,
>   hasGuardrailsAccess?: boolean | null,
>   hasHipaaBAA?: boolean | null,
>   hasSAML?: boolean | null,
>   id?: string | null,
>   name?: string | null,
>   plan?: string | null,
>   preferredRegion?: string | null,
>   projectCount?: number | null,
>   redactedDueTo2FAPending?: boolean | null,
>   restrictProjectVisibilityToGroups?: boolean | null,
>   slackChannelId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   updatedAt?: string | null,
>   usersWithout2FA?: string[] | null
> } | null
> ```

***

### delete

`accessGroups.delete`

Delete an access group

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

```ts theme={null}
await corsair.railway.api.accessGroups.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### update

`accessGroups.update`

Update an access group's name or role

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.accessGroups.update({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   name?: string,
>   role?: ADMIN | MEMBER | VIEWER
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |
| `source` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `workspace` | `object \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] workspace full type
>
> ```ts theme={null}
> {
>   adoptionLevel?: number | null,
>   avatar?: string | null,
>   createdAt?: string | null,
>   discordRole?: string | null,
>   has2FAEnforcement?: boolean | null,
>   hasAutomaticDiagnosis?: boolean | null,
>   hasGuardrailsAccess?: boolean | null,
>   hasHipaaBAA?: boolean | null,
>   hasSAML?: boolean | null,
>   id?: string | null,
>   name?: string | null,
>   plan?: string | null,
>   preferredRegion?: string | null,
>   projectCount?: number | null,
>   redactedDueTo2FAPending?: boolean | null,
>   restrictProjectVisibilityToGroups?: boolean | null,
>   slackChannelId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   updatedAt?: string | null,
>   usersWithout2FA?: string[] | null
> } | null
> ```

***

## Agent Usage

### get

`agentUsage.get`

Get unified AI usage for a workspace

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.agentUsage.get({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `billingPeriodEnd` | `string \| null` | No | — |
| `hardLimitCents` | `number \| null` | No | — |
| `hasCustomHardLimit` | `boolean \| null` | No | — |
| `softLimitCents` | `number \| null` | No | — |
| `totalUsedCents` | `number \| null` | No | — |
| `usageRemaining` | `number \| null` | No | — |

***

### setLimit

`agentUsage.setLimit`

Set agent usage limit for a workspace

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.agentUsage.setLimit({
	input: { hardLimitCents: 1, workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   hardLimitCents: number,
>   softLimitCents?: number,
>   workspaceId: string
> }
> ```

**Output:** `boolean`

***

## Api Tokens

### create

`apiTokens.create`

Creates a new API token

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.apiTokens.create({
	input: { name: 'api' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   name: string,
>   workspaceId?: string
> }
> ```

**Output:** `string`

***

### current

`apiTokens.current`

Introspect the current API token and its accessible workspaces

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.apiTokens.current({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspaces` | `object[] \| null` | No | Workspaces this subject can operate on via this token or session. |

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

***

### delete

`apiTokens.delete`

Deletes an API token

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

```ts theme={null}
await corsair.railway.api.apiTokens.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### list

`apiTokens.list`

Gets all API tokens for the authenticated user, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.apiTokens.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   creator?: {
>     avatar?: string | null,
>     email?: string | null,
>     id?: string | null,
>     name?: string | null,
>     username?: string | null
>   } | null,
>   displayToken?: string | null,
>   expiresAt?: string | null,
>   id?: string | null,
>   name?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

## Audit Logs

### eventTypes

`auditLogs.eventTypes`

Get a list of all audit log event types and their description

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.auditLogs.eventTypes({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   description?: string | null,
>   eventType?: string | null
> }[]
> ```

***

### get

`auditLogs.get`

Get an audit log by ID

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.auditLogs.get({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The ID of the audit log entry |
| `workspaceId` | `string` | Yes | The ID of the workspace |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `context` | `any \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `environment` | `object \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `eventType` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `payload` | `any \| null` | No | — |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

***

### list

`auditLogs.list`

Gets audit logs for a workspace, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.auditLogs.list({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `filter` | `object` | No | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |
| `sort` | `asc \| desc` | No | — |
| `workspaceId` | `string` | Yes | — |

> [accordion] filter full type
>
> ```ts theme={null}
> {
>   endDate?: string,
>   environmentId?: string,
>   eventTypes?: string[],
>   projectId?: string,
>   startDate?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   context?: any | null,
>   createdAt?: string | null,
>   environment?: {
>     canAccess?: boolean | null,
>     canvasGroupRefs?: any | null,
>     clearanceCachingTurnedOff?: string[] | null,
>     clearanceDefault?: boolean | null,
>     clearanceDefaultUpdatedAt?: string | null,
>     clearancePropagatedAt?: string | null,
>     clearancePropagationError?: string | null,
>     config?: any | null,
>     configEtag?: string | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     iacPartials?: any | null,
>     id?: string | null,
>     isEphemeral?: boolean | null,
>     name?: string | null,
>     projectId?: string | null,
>     sourceEnvironmentName?: string | null,
>     unmergedChangesCount?: number | null,
>     updatedAt?: string | null
>   } | null,
>   environmentId?: string | null,
>   eventType?: string | null,
>   id?: string | null,
>   payload?: any | null,
>   project?: {
>     baseEnvironmentId?: string | null,
>     botPrEnvironments?: boolean | null,
>     clearanceDefaultForNewEnvironments?: boolean | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     description?: string | null,
>     expiredAt?: string | null,
>     featureFlags?: string[] | null,
>     focusedPrEnvironments?: boolean | null,
>     id?: string | null,
>     isPublic?: boolean | null,
>     isTempProject?: boolean | null,
>     name?: string | null,
>     prDeploys?: boolean | null,
>     primaryEnvironmentId?: string | null,
>     subscriptionPlanLimit?: any | null,
>     subscriptionType?: string | null,
>     updatedAt?: string | null,
>     viewerRole?: string | null,
>     workspaceId?: string | null
>   } | null,
>   projectId?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

## Billing

### createFreePlanSubscription

`billing.createFreePlanSubscription`

Create a free plan subscription for a customer

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.billing.createFreePlanSubscription({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### togglePayoutsToCredits

`billing.togglePayoutsToCredits`

Toggle whether a customer is automatically withdrawing to credits

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.billing.togglePayoutsToCredits({
	customerId: 'example',
	input: { isWithdrawingToCredits: true },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `customerId` | `string` | Yes | — |
| `input` | `object` | Yes | — |

> [accordion] input full type
>
> ```ts theme={null}
> {
>   isWithdrawingToCredits: boolean
> }
> ```

**Output:** `boolean`

***

## Bot Scope Bindings

### list

`botScopeBindings.list`

Railway agent chat bindings (Slack/Discord scope → workspace) across the caller's workspaces

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.botScopeBindings.list({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   canRemove?: boolean | null,
>   id?: string | null,
>   platform?: string | null,
>   scopeId?: string | null,
>   scopeName?: string | null,
>   scopeType?: string | null,
>   workspaceId?: string | null,
>   workspaceName?: string | null
> }[]
> ```

***

### remove

`botScopeBindings.remove`

Remove a Railway agent chat binding. Requires admin on the binding's workspace

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.botScopeBindings.remove({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

## Buckets

### create

`buckets.create`

Create a bucket in a project

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.buckets.create({
	input: { projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId?: string,
>   name?: string,
>   projectId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `groupId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `parentServiceId` | `string \| null` | No | — |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

***

### instanceDetails

`buckets.instanceDetails`

Get the S3-compatible credentials for a bucket

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.buckets.instanceDetails({ bucketId: '0000000a-5c1e-4d8a-9f43-2b6e1c0a9d17', environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `bucketId` | `string` | Yes | — |
| `environmentId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `objectCount` | `number \| string \| null` | No | — |
| `sizeBytes` | `number \| string \| null` | No | — |

***

### resetCredentials

`buckets.resetCredentials`

Reset the credentials for a bucket in an environment

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

```ts theme={null}
await corsair.railway.api.buckets.resetCredentials({ bucketId: '0000000a-5c1e-4d8a-9f43-2b6e1c0a9d17', environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `bucketId` | `string` | Yes | — |
| `environmentId` | `string` | Yes | — |
| `projectId` | `string` | Yes | — |
| `redeployDependents` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `accessKeyId` | `string \| null` | No | — |
| `bucketName` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `endpoint` | `string \| null` | No | — |
| `region` | `string \| null` | No | — |
| `secretAccessKey` | `string \| null` | No | — |
| `urlStyle` | `string \| null` | No | — |

***

### s3Credentials

`buckets.s3Credentials`

Get the S3-compatible credentials for a bucket

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.buckets.s3Credentials({ bucketId: '0000000a-5c1e-4d8a-9f43-2b6e1c0a9d17', environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `bucketId` | `string` | Yes | — |
| `environmentId` | `string` | Yes | — |
| `projectId` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   accessKeyId?: string | null,
>   bucketName?: string | null,
>   createdAt?: string | null,
>   endpoint?: string | null,
>   region?: string | null,
>   secretAccessKey?: string | null,
>   urlStyle?: string | null
> }[]
> ```

***

### update

`buckets.update`

Updates a bucket

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.buckets.update({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: { name: 'api' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   name: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `groupId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `parentServiceId` | `string \| null` | No | — |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

***

## Canvas Views

### merge

`canvasViews.merge`

Merge a canvas layout from one environment into another. Re-computes the merge from current state and applies mutations

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.canvasViews.merge({ sourceEnvironmentId: 'example', targetEnvironmentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sourceEnvironmentId` | `string` | Yes | — |
| `targetEnvironmentId` | `string` | Yes | — |

**Output:** `boolean`

***

### mergePreview

`canvasViews.mergePreview`

Preview a canvas layout merge from one environment to another. Returns the merged state and the mutations needed to reach it

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.canvasViews.mergePreview({ sourceEnvironmentId: 'example', targetEnvironmentId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sourceEnvironmentId` | `string` | Yes | — |
| `targetEnvironmentId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `mutations` | `any[] \| null` | No | — |
| `state` | `any \| null` | No | — |

***

## Clearance Tokens

### create

`clearanceTokens.create`

Creates a Railway Authentication token for a project's protected services and returns it once. Requires a workspace admin and the workspace's Railway Authentication entitlement

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.clearanceTokens.create({
	input: { name: 'api', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId?: string,
>   expiresInDays?: number,
>   name: string,
>   projectId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `clearanceToken` | `object \| null` | No | A Railway Authentication machine token: gets non-human callers past the sign-in on a project's protected services. The token itself is only returned when it's created. |
| `token` | `string \| null` | No | The token. Shown this once; it isn't stored. |

> [accordion] clearanceToken full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   environmentId?: string | null,
>   environmentName?: string | null,
>   expiresAt?: string | null,
>   id?: string | null,
>   name?: string | null
> } | null
> ```

***

### revoke

`clearanceTokens.revoke`

Revokes a Railway Authentication token. Requires a workspace admin; works without the entitlement. Revoking a revoked token succeeds

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.clearanceTokens.revoke({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

## Cloud Agent Checkpoints

### create

`cloudAgentCheckpoints.create`

Checkpoint the agent's disk. Poll cloudAgentCheckpoint until SUCCEEDED

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.cloudAgentCheckpoints.create({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `environmentId` | `string \| null` | No | Set when the checkpoint boots only in this environment. Null boots anywhere in the project. |
| `failureReason` | `string \| null` | No | Why the capture failed. |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `region` | `string \| null` | No | Region the checkpoint was captured in. |
| `status` | `string \| null` | No | Capture progress of a cloud agent checkpoint. |

***

### delete

`cloudAgentCheckpoints.delete`

Delete a checkpoint

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

```ts theme={null}
await corsair.railway.api.cloudAgentCheckpoints.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### get

`cloudAgentCheckpoints.get`

A cloud agent checkpoint by ID

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.cloudAgentCheckpoints.get({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `environmentId` | `string \| null` | No | Set when the checkpoint boots only in this environment. Null boots anywhere in the project. |
| `failureReason` | `string \| null` | No | Why the capture failed. |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `region` | `string \| null` | No | Region the checkpoint was captured in. |
| `status` | `string \| null` | No | Capture progress of a cloud agent checkpoint. |

***

### list

`cloudAgentCheckpoints.list`

Cloud agent checkpoints in an environment, newest first, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.cloudAgentCheckpoints.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `environmentId` | `string` | Yes | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   environmentId?: string | null,
>   failureReason?: string | null,
>   id?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   region?: string | null,
>   status?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

## Cloud Agent Console Sessions

### list

`cloudAgentConsoleSessions.list`

Shell and exec sessions running on a cloud agent's VM that you can reconnect to. Null if the agent has no running machine, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.cloudAgentConsoleSessions.list({ cloudAgentId: '0000000c-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `cloudAgentId` | `string` | Yes | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   attached?: boolean | null,
>   command?: string | null,
>   createdAt?: string | null,
>   foregroundActive?: boolean | null,
>   kind?: string | null,
>   name?: string | null,
>   runState?: {
>     exitCode?: number | null,
>     exitedAt?: string | null,
>     running?: boolean | null
>   } | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

## Cloud Agents

### archive

`cloudAgents.archive`

Archive a cloud agent, hiding it from lists of unarchived agents. Requires permission to manage the agent

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.cloudAgents.archive({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### create

`cloudAgents.create`

Create a cloud agent

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.cloudAgents.create({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   cloudAgentCheckpointId?: string,
>   codeEndpoint?: {
>     port?: number
>   },
>   environmentId: string,
>   name?: string,
>   region?: string,
>   source?: {
>     branch?: string,
>     repo?: string,
>     serviceId?: string
>   },
>   variables?: any
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentWsUrl` | `string \| null` | No | WebSocket endpoint of the in-VM harness gate, for the dashboard chat. Survives sleep: the domain is stable across sleep and wake. Prefers the machine observation; when that carries no gate domain it falls back to the domain network-cp actively serves, so an agent whose observation lagged still offers chat. Null on agents created before the gate existed, or asleep/absent machines. |
| `archivedAt` | `string \| null` | No | When the agent was archived; null if it isn't. |
| `consoleTargetId` | `string \| null` | No | Target ID for console or command execution. Null while unavailable. |
| `createdAt` | `string \| null` | No | — |
| `domain` | `string \| null` | No | The agent machine's public HTTP domain (port 8080) — the live preview. Prefers the observation (falling back to the first declared domain when 8080 was never requested); when the observation carries no domains it falls back to the domain network-cp actively serves on 8080, so a preview shows even when the observation lagged. Returns null while the machine sleeps. |
| `domains` | `object[] \| null` | No | Every public domain on the agent's machine, one per port, in the order the machine declared them. |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `previewDomain` | `string \| null` | No | The agent machine's own public HTTP domain (port 8080), known whether or not the machine is up: the observed one, else derived from the machine's id as the orchestrator names it. A fork's is its own machine's, never the source's. Null without a machine. |
| `privateDomain` | `string \| null` | No | Hostname on the environment's private network, e.g. \<name>.railway.internal, reachable on any port from services in that environment. Null when the VM is isolated or its private endpoint isn't registered yet. |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `region` | `string \| null` | No | Region the agent's machine runs in. Null briefly after creation, before the machine has been placed. |
| `sessions` | `object[] \| null` | No | Coding-agent sessions, one entry per session, newest first. Kept while the agent sleeps, so it still lists what it was doing. |
| `source` | `object \| null` | No | Workspace provenance: the GitHub repo cloned into the agent's workspace at create time. |
| `status` | `string \| null` | No | The current lifecycle state of a cloud agent. |
| `workStatus` | `object \| null` | No | Where work stands, computed on read from the native harness's run events, else the VM's session report. |

> [accordion] domains full type
>
> ```ts theme={null}
> {
>   domain?: string | null,
>   port?: number | null,
>   prefix?: string | null
> }[] | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

> [accordion] sessions full type
>
> ```ts theme={null}
> {
>   harness?: string | null,
>   lastEventKind?: string | null,
>   latestPrompt?: string | null,
>   prompt?: string | null,
>   sessionId?: string | null,
>   sessionName?: string | null,
>   state?: string | null,
>   taskId?: string | null,
>   terminal?: boolean | null,
>   title?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] source full type
>
> ```ts theme={null}
> {
>   branch?: string | null,
>   dir?: string | null,
>   repo?: string | null,
>   serviceId?: string | null,
>   status?: string | null
> } | null
> ```

> [accordion] workStatus full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   kind?: string | null,
>   message?: string | null,
>   state?: string | null,
>   unseen?: boolean | null
> } | null
> ```

***

### createDashboardFeedback

`cloudAgents.createDashboardFeedback`

Send feedback about the agent dashboard to the Railway team. True once delivered

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.cloudAgents.createDashboardFeedback({
	input: {},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   cloudAgentId?: string,
>   error?: string,
>   failure?: string,
>   kind?: feedback | problem,
>   message?: string,
>   path?: string,
>   replayUrl?: string,
>   runId?: string,
>   sentiment?: negative | neutral | positive,
>   userAgent?: string
> }
> ```

**Output:** `boolean`

***

### createFeedback

`cloudAgents.createFeedback`

Send lightweight agent feedback to Railway. Returns the report ID after delivery

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.cloudAgents.createFeedback({
	input: {
		activeTools: ['example'],
		agentVersion: 'example',
		cloudAgentId: '0000000c-5c1e-4d8a-9f43-2b6e1c0a9d17',
		description: 'Corsair example',
		model: 'example',
		reportId: 'example',
		reportedAtMs: 1,
		sessionId: 'example',
		state: 'example',
		steps: 1,
		tuiVersion: 'example',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   activeTools: string[],
>   agentVersion: string,
>   cloudAgentId: string,
>   description: string,
>   elapsedMs?: number,
>   lastProgressAgeMs?: number,
>   model: string,
>   reportId: string,
>   reportedAtMs: number,
>   runId?: string,
>   runStartedAtMs?: number,
>   sessionId: string,
>   sessionName?: string,
>   state: string,
>   steps: number,
>   tuiVersion: string
> }
> ```

**Output:** `string`

***

### delete

`cloudAgents.delete`

Delete a cloud agent

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

```ts theme={null}
await corsair.railway.api.cloudAgents.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### deploy

`cloudAgents.deploy`

Build the agent's code inside its own VM and deploy it. Creates the named service (default: the agent's name) or reuses it. Needs an agent booted with the builder

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.cloudAgents.deploy({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `path` | `string` | No | — |
| `regions` | `any` | No | Replicas per region, e.g. \{ "us-west2": 3 }. Saved on the service; omit to keep its current regions. |
| `serviceName` | `string` | No | — |

**Output**

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

***

### fork

`cloudAgents.fork`

Duplicate a running cloud agent. With sessionId, the new agent keeps that chat and its history; without it, it starts with no chats

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.cloudAgents.fork({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `name` | `string` | No | — |
| `sessionId` | `string` | No | The harness's session id of the chat to carry over. |
| `variables` | `any` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentWsUrl` | `string \| null` | No | WebSocket endpoint of the in-VM harness gate, for the dashboard chat. Survives sleep: the domain is stable across sleep and wake. Prefers the machine observation; when that carries no gate domain it falls back to the domain network-cp actively serves, so an agent whose observation lagged still offers chat. Null on agents created before the gate existed, or asleep/absent machines. |
| `archivedAt` | `string \| null` | No | When the agent was archived; null if it isn't. |
| `consoleTargetId` | `string \| null` | No | Target ID for console or command execution. Null while unavailable. |
| `createdAt` | `string \| null` | No | — |
| `domain` | `string \| null` | No | The agent machine's public HTTP domain (port 8080) — the live preview. Prefers the observation (falling back to the first declared domain when 8080 was never requested); when the observation carries no domains it falls back to the domain network-cp actively serves on 8080, so a preview shows even when the observation lagged. Returns null while the machine sleeps. |
| `domains` | `object[] \| null` | No | Every public domain on the agent's machine, one per port, in the order the machine declared them. |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `previewDomain` | `string \| null` | No | The agent machine's own public HTTP domain (port 8080), known whether or not the machine is up: the observed one, else derived from the machine's id as the orchestrator names it. A fork's is its own machine's, never the source's. Null without a machine. |
| `privateDomain` | `string \| null` | No | Hostname on the environment's private network, e.g. \<name>.railway.internal, reachable on any port from services in that environment. Null when the VM is isolated or its private endpoint isn't registered yet. |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `region` | `string \| null` | No | Region the agent's machine runs in. Null briefly after creation, before the machine has been placed. |
| `sessions` | `object[] \| null` | No | Coding-agent sessions, one entry per session, newest first. Kept while the agent sleeps, so it still lists what it was doing. |
| `source` | `object \| null` | No | Workspace provenance: the GitHub repo cloned into the agent's workspace at create time. |
| `status` | `string \| null` | No | The current lifecycle state of a cloud agent. |
| `workStatus` | `object \| null` | No | Where work stands, computed on read from the native harness's run events, else the VM's session report. |

> [accordion] domains full type
>
> ```ts theme={null}
> {
>   domain?: string | null,
>   port?: number | null,
>   prefix?: string | null
> }[] | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

> [accordion] sessions full type
>
> ```ts theme={null}
> {
>   harness?: string | null,
>   lastEventKind?: string | null,
>   latestPrompt?: string | null,
>   prompt?: string | null,
>   sessionId?: string | null,
>   sessionName?: string | null,
>   state?: string | null,
>   taskId?: string | null,
>   terminal?: boolean | null,
>   title?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] source full type
>
> ```ts theme={null}
> {
>   branch?: string | null,
>   dir?: string | null,
>   repo?: string | null,
>   serviceId?: string | null,
>   status?: string | null
> } | null
> ```

> [accordion] workStatus full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   kind?: string | null,
>   message?: string | null,
>   state?: string | null,
>   unseen?: boolean | null
> } | null
> ```

***

### get

`cloudAgents.get`

A cloud agent by ID, within an environment. Null when the agent belongs to another one, so a caller cannot render an agent it has switched away from

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.cloudAgents.get({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentWsUrl` | `string \| null` | No | WebSocket endpoint of the in-VM harness gate, for the dashboard chat. Survives sleep: the domain is stable across sleep and wake. Prefers the machine observation; when that carries no gate domain it falls back to the domain network-cp actively serves, so an agent whose observation lagged still offers chat. Null on agents created before the gate existed, or asleep/absent machines. |
| `archivedAt` | `string \| null` | No | When the agent was archived; null if it isn't. |
| `consoleTargetId` | `string \| null` | No | Target ID for console or command execution. Null while unavailable. |
| `createdAt` | `string \| null` | No | — |
| `domain` | `string \| null` | No | The agent machine's public HTTP domain (port 8080) — the live preview. Prefers the observation (falling back to the first declared domain when 8080 was never requested); when the observation carries no domains it falls back to the domain network-cp actively serves on 8080, so a preview shows even when the observation lagged. Returns null while the machine sleeps. |
| `domains` | `object[] \| null` | No | Every public domain on the agent's machine, one per port, in the order the machine declared them. |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `previewDomain` | `string \| null` | No | The agent machine's own public HTTP domain (port 8080), known whether or not the machine is up: the observed one, else derived from the machine's id as the orchestrator names it. A fork's is its own machine's, never the source's. Null without a machine. |
| `privateDomain` | `string \| null` | No | Hostname on the environment's private network, e.g. \<name>.railway.internal, reachable on any port from services in that environment. Null when the VM is isolated or its private endpoint isn't registered yet. |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `region` | `string \| null` | No | Region the agent's machine runs in. Null briefly after creation, before the machine has been placed. |
| `sessions` | `object[] \| null` | No | Coding-agent sessions, one entry per session, newest first. Kept while the agent sleeps, so it still lists what it was doing. |
| `source` | `object \| null` | No | Workspace provenance: the GitHub repo cloned into the agent's workspace at create time. |
| `status` | `string \| null` | No | The current lifecycle state of a cloud agent. |
| `workStatus` | `object \| null` | No | Where work stands, computed on read from the native harness's run events, else the VM's session report. |

> [accordion] domains full type
>
> ```ts theme={null}
> {
>   domain?: string | null,
>   port?: number | null,
>   prefix?: string | null
> }[] | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

> [accordion] sessions full type
>
> ```ts theme={null}
> {
>   harness?: string | null,
>   lastEventKind?: string | null,
>   latestPrompt?: string | null,
>   prompt?: string | null,
>   sessionId?: string | null,
>   sessionName?: string | null,
>   state?: string | null,
>   taskId?: string | null,
>   terminal?: boolean | null,
>   title?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] source full type
>
> ```ts theme={null}
> {
>   branch?: string | null,
>   dir?: string | null,
>   repo?: string | null,
>   serviceId?: string | null,
>   status?: string | null
> } | null
> ```

> [accordion] workStatus full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   kind?: string | null,
>   message?: string | null,
>   state?: string | null,
>   unseen?: boolean | null
> } | null
> ```

***

### list

`cloudAgents.list`

Cloud agents in an environment

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.cloudAgents.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `archived` | `boolean` | No | true: only archived agents; false: only unarchived ones. By default both. |
| `environmentId` | `string` | Yes | — |
| `mine` | `boolean` | No | Return only the agents that belong to you. By default every agent in the environment is returned, including your teammates'. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   agentWsUrl?: string | null,
>   archivedAt?: string | null,
>   consoleTargetId?: string | null,
>   createdAt?: string | null,
>   domain?: string | null,
>   domains?: {
>     domain?: string | null,
>     port?: number | null,
>     prefix?: string | null
>   }[] | null,
>   environmentId?: string | null,
>   id?: string | null,
>   name?: string | null,
>   previewDomain?: string | null,
>   privateDomain?: string | null,
>   project?: {
>     baseEnvironmentId?: string | null,
>     botPrEnvironments?: boolean | null,
>     clearanceDefaultForNewEnvironments?: boolean | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     description?: string | null,
>     expiredAt?: string | null,
>     featureFlags?: string[] | null,
>     focusedPrEnvironments?: boolean | null,
>     id?: string | null,
>     isPublic?: boolean | null,
>     isTempProject?: boolean | null,
>     name?: string | null,
>     prDeploys?: boolean | null,
>     primaryEnvironmentId?: string | null,
>     subscriptionPlanLimit?: any | null,
>     subscriptionType?: string | null,
>     updatedAt?: string | null,
>     viewerRole?: string | null,
>     workspaceId?: string | null
>   } | null,
>   projectId?: string | null,
>   region?: string | null,
>   sessions?: {
>     harness?: string | null,
>     lastEventKind?: string | null,
>     latestPrompt?: string | null,
>     prompt?: string | null,
>     sessionId?: string | null,
>     sessionName?: string | null,
>     state?: string | null,
>     taskId?: string | null,
>     terminal?: boolean | null,
>     title?: string | null,
>     updatedAt?: string | null
>   }[] | null,
>   source?: {
>     branch?: string | null,
>     dir?: string | null,
>     repo?: string | null,
>     serviceId?: string | null,
>     status?: string | null
>   } | null,
>   status?: string | null,
>   workStatus?: {
>     at?: string | null,
>     kind?: string | null,
>     message?: string | null,
>     state?: string | null,
>     unseen?: boolean | null
>   } | null
> }[]
> ```

***

### listMine

`cloudAgents.listMine`

Cloud agents you own, across every project and environment you can reach. Answers "where are my agents" in one request; `cloudAgents` needs one call per environment. Machine fields (`status`, `domain`, `domains`) read the last observed state in batched queries, so selecting them across many environments is fine

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.cloudAgents.listMine({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `archived` | `boolean` | No | true: only archived agents; false: only unarchived ones. By default both. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   agentWsUrl?: string | null,
>   archivedAt?: string | null,
>   consoleTargetId?: string | null,
>   createdAt?: string | null,
>   domain?: string | null,
>   domains?: {
>     domain?: string | null,
>     port?: number | null,
>     prefix?: string | null
>   }[] | null,
>   environmentId?: string | null,
>   id?: string | null,
>   name?: string | null,
>   previewDomain?: string | null,
>   privateDomain?: string | null,
>   project?: {
>     baseEnvironmentId?: string | null,
>     botPrEnvironments?: boolean | null,
>     clearanceDefaultForNewEnvironments?: boolean | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     description?: string | null,
>     expiredAt?: string | null,
>     featureFlags?: string[] | null,
>     focusedPrEnvironments?: boolean | null,
>     id?: string | null,
>     isPublic?: boolean | null,
>     isTempProject?: boolean | null,
>     name?: string | null,
>     prDeploys?: boolean | null,
>     primaryEnvironmentId?: string | null,
>     subscriptionPlanLimit?: any | null,
>     subscriptionType?: string | null,
>     updatedAt?: string | null,
>     viewerRole?: string | null,
>     workspaceId?: string | null
>   } | null,
>   projectId?: string | null,
>   region?: string | null,
>   sessions?: {
>     harness?: string | null,
>     lastEventKind?: string | null,
>     latestPrompt?: string | null,
>     prompt?: string | null,
>     sessionId?: string | null,
>     sessionName?: string | null,
>     state?: string | null,
>     taskId?: string | null,
>     terminal?: boolean | null,
>     title?: string | null,
>     updatedAt?: string | null
>   }[] | null,
>   source?: {
>     branch?: string | null,
>     dir?: string | null,
>     repo?: string | null,
>     serviceId?: string | null,
>     status?: string | null
>   } | null,
>   status?: string | null,
>   workStatus?: {
>     at?: string | null,
>     kind?: string | null,
>     message?: string | null,
>     state?: string | null,
>     unseen?: boolean | null
>   } | null
> }[]
> ```

***

### markSeen

`cloudAgents.markSeen`

Mark the agent's finished and failed sessions as seen, or only sessionId's. Requires permission to manage the agent

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.cloudAgents.markSeen({ cloudAgentId: '0000000c-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `cloudAgentId` | `string` | Yes | — |
| `sessionId` | `string` | No | The harness's session id. |

**Output:** `boolean`

***

### renameSession

`cloudAgents.renameSession`

Set a session's title, shown over its generated one. An empty title clears it

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.cloudAgents.renameSession({ cloudAgentId: '0000000c-5c1e-4d8a-9f43-2b6e1c0a9d17', sessionId: 'example', title: 'api' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `cloudAgentId` | `string` | Yes | — |
| `sessionId` | `string` | Yes | The harness's session id. |
| `title` | `string` | Yes | — |

**Output:** `boolean`

***

### sleep

`cloudAgents.sleep`

Sleep a running cloud agent, keeping its volume. Processes on the machine are terminated; waking re-runs its entrypoint

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.cloudAgents.sleep({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentWsUrl` | `string \| null` | No | WebSocket endpoint of the in-VM harness gate, for the dashboard chat. Survives sleep: the domain is stable across sleep and wake. Prefers the machine observation; when that carries no gate domain it falls back to the domain network-cp actively serves, so an agent whose observation lagged still offers chat. Null on agents created before the gate existed, or asleep/absent machines. |
| `archivedAt` | `string \| null` | No | When the agent was archived; null if it isn't. |
| `consoleTargetId` | `string \| null` | No | Target ID for console or command execution. Null while unavailable. |
| `createdAt` | `string \| null` | No | — |
| `domain` | `string \| null` | No | The agent machine's public HTTP domain (port 8080) — the live preview. Prefers the observation (falling back to the first declared domain when 8080 was never requested); when the observation carries no domains it falls back to the domain network-cp actively serves on 8080, so a preview shows even when the observation lagged. Returns null while the machine sleeps. |
| `domains` | `object[] \| null` | No | Every public domain on the agent's machine, one per port, in the order the machine declared them. |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `previewDomain` | `string \| null` | No | The agent machine's own public HTTP domain (port 8080), known whether or not the machine is up: the observed one, else derived from the machine's id as the orchestrator names it. A fork's is its own machine's, never the source's. Null without a machine. |
| `privateDomain` | `string \| null` | No | Hostname on the environment's private network, e.g. \<name>.railway.internal, reachable on any port from services in that environment. Null when the VM is isolated or its private endpoint isn't registered yet. |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `region` | `string \| null` | No | Region the agent's machine runs in. Null briefly after creation, before the machine has been placed. |
| `sessions` | `object[] \| null` | No | Coding-agent sessions, one entry per session, newest first. Kept while the agent sleeps, so it still lists what it was doing. |
| `source` | `object \| null` | No | Workspace provenance: the GitHub repo cloned into the agent's workspace at create time. |
| `status` | `string \| null` | No | The current lifecycle state of a cloud agent. |
| `workStatus` | `object \| null` | No | Where work stands, computed on read from the native harness's run events, else the VM's session report. |

> [accordion] domains full type
>
> ```ts theme={null}
> {
>   domain?: string | null,
>   port?: number | null,
>   prefix?: string | null
> }[] | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

> [accordion] sessions full type
>
> ```ts theme={null}
> {
>   harness?: string | null,
>   lastEventKind?: string | null,
>   latestPrompt?: string | null,
>   prompt?: string | null,
>   sessionId?: string | null,
>   sessionName?: string | null,
>   state?: string | null,
>   taskId?: string | null,
>   terminal?: boolean | null,
>   title?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] source full type
>
> ```ts theme={null}
> {
>   branch?: string | null,
>   dir?: string | null,
>   repo?: string | null,
>   serviceId?: string | null,
>   status?: string | null
> } | null
> ```

> [accordion] workStatus full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   kind?: string | null,
>   message?: string | null,
>   state?: string | null,
>   unseen?: boolean | null
> } | null
> ```

***

### unarchive

`cloudAgents.unarchive`

Restore an archived cloud agent. Requires permission to manage the agent

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.cloudAgents.unarchive({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### wake

`cloudAgents.wake`

Wake a sleeping cloud agent

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.cloudAgents.wake({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentWsUrl` | `string \| null` | No | WebSocket endpoint of the in-VM harness gate, for the dashboard chat. Survives sleep: the domain is stable across sleep and wake. Prefers the machine observation; when that carries no gate domain it falls back to the domain network-cp actively serves, so an agent whose observation lagged still offers chat. Null on agents created before the gate existed, or asleep/absent machines. |
| `archivedAt` | `string \| null` | No | When the agent was archived; null if it isn't. |
| `consoleTargetId` | `string \| null` | No | Target ID for console or command execution. Null while unavailable. |
| `createdAt` | `string \| null` | No | — |
| `domain` | `string \| null` | No | The agent machine's public HTTP domain (port 8080) — the live preview. Prefers the observation (falling back to the first declared domain when 8080 was never requested); when the observation carries no domains it falls back to the domain network-cp actively serves on 8080, so a preview shows even when the observation lagged. Returns null while the machine sleeps. |
| `domains` | `object[] \| null` | No | Every public domain on the agent's machine, one per port, in the order the machine declared them. |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `previewDomain` | `string \| null` | No | The agent machine's own public HTTP domain (port 8080), known whether or not the machine is up: the observed one, else derived from the machine's id as the orchestrator names it. A fork's is its own machine's, never the source's. Null without a machine. |
| `privateDomain` | `string \| null` | No | Hostname on the environment's private network, e.g. \<name>.railway.internal, reachable on any port from services in that environment. Null when the VM is isolated or its private endpoint isn't registered yet. |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `region` | `string \| null` | No | Region the agent's machine runs in. Null briefly after creation, before the machine has been placed. |
| `sessions` | `object[] \| null` | No | Coding-agent sessions, one entry per session, newest first. Kept while the agent sleeps, so it still lists what it was doing. |
| `source` | `object \| null` | No | Workspace provenance: the GitHub repo cloned into the agent's workspace at create time. |
| `status` | `string \| null` | No | The current lifecycle state of a cloud agent. |
| `workStatus` | `object \| null` | No | Where work stands, computed on read from the native harness's run events, else the VM's session report. |

> [accordion] domains full type
>
> ```ts theme={null}
> {
>   domain?: string | null,
>   port?: number | null,
>   prefix?: string | null
> }[] | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

> [accordion] sessions full type
>
> ```ts theme={null}
> {
>   harness?: string | null,
>   lastEventKind?: string | null,
>   latestPrompt?: string | null,
>   prompt?: string | null,
>   sessionId?: string | null,
>   sessionName?: string | null,
>   state?: string | null,
>   taskId?: string | null,
>   terminal?: boolean | null,
>   title?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] source full type
>
> ```ts theme={null}
> {
>   branch?: string | null,
>   dir?: string | null,
>   repo?: string | null,
>   serviceId?: string | null,
>   status?: string | null
> } | null
> ```

> [accordion] workStatus full type
>
> ```ts theme={null}
> {
>   at?: string | null,
>   kind?: string | null,
>   message?: string | null,
>   state?: string | null,
>   unseen?: boolean | null
> } | null
> ```

***

## Cloud Agent Tasks

### cancel

`cloudAgentTasks.cancel`

Stop a task. Before its prompt is sent it never starts; after, only its own run is aborted. The task ends CANCELLED, with "The task was cancelled" as its error. A finished task is left as is

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.cloudAgentTasks.cancel({ taskId: 'example' });
```

**Input**

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

**Output**

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

***

### dispatch

`cloudAgentTasks.dispatch`

Start a task and return its handle. Creates a fresh agent by default; replyToTaskId continues the original conversation

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.cloudAgentTasks.dispatch({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', prompt: 'example' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   agentName?: string,
>   allowCreate?: boolean,
>   cloudAgentId?: string,
>   context?: any,
>   conversationKey?: string,
>   dashboardHandoff?: boolean,
>   environmentId: string,
>   externalRef?: string,
>   idempotencyKey?: string,
>   images?: {
>     data?: string,
>     filename?: string,
>     mediaType?: string,
>     url?: string
>   }[],
>   interactive?: boolean,
>   metadata?: any,
>   mode?: FOLLOW_UP | PROMPT | STEER,
>   model?: string,
>   outputSchema?: any,
>   projectId: string,
>   prompt: string,
>   reasoningEffort?: string,
>   replyToTaskId?: string,
>   sessionId?: string,
>   source?: {
>     branch?: string,
>     repo?: string,
>     serviceId?: string
>   },
>   webhookProgress?: boolean,
>   webhookSecret?: string,
>   webhookUrl?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `cloudAgentId` | `string \| null` | No | — |
| `dashboardRunUrl` | `string \| null` | No | Set when dashboardHandoff moved the prompt to the agent dashboard: the task is a new run there, not a turn on the agent asked for, and this is its link. Follow it there; its questions and approvals wait on the dashboard. |
| `deliveredAsReply` | `boolean \| null` | No | The prompt answered the agent's open question on this session instead of starting a turn; taskId is the task that asked. |
| `replayed` | `boolean \| null` | No | — |
| `sessionId` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `taskId` | `string \| null` | No | — |

***

### get

`cloudAgentTasks.get`

Read a task turn without waking the VM: the latest on the agent/session, or taskId's

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.cloudAgentTasks.get({ cloudAgentId: '0000000c-5c1e-4d8a-9f43-2b6e1c0a9d17', sessionId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `cloudAgentId` | `string` | Yes | — |
| `sessionId` | `string` | Yes | — |
| `taskId` | `string` | No | An earlier turn on this session; default the latest. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `attachments` | `object[] \| null` | No | Files the agent linked in its result, once it ends. |
| `cloudAgentId` | `string \| null` | No | — |
| `completedAt` | `string \| null` | No | — |
| `error` | `string \| null` | No | — |
| `externalRef` | `string \| null` | No | — |
| `metadata` | `any \| null` | No | — |
| `model` | `string \| null` | No | The model the turn ran on, once it was submitted. |
| `pendingInteractions` | `object[] \| null` | No | Answer these with cloudAgentTaskRespond. |
| `progress` | `object \| null` | No | — |
| `reasoningEffort` | `string \| null` | No | — |
| `sessionId` | `string \| null` | No | — |
| `sessionState` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `structuredOutput` | `any \| null` | No | — |
| `taskId` | `string \| null` | No | — |
| `text` | `string \| null` | No | — |

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   bytes?: number | null,
>   contentType?: string | null,
>   expiresAt?: string | null,
>   filename?: string | null,
>   id?: string | null,
>   url?: string | null
> }[] | null
> ```

> [accordion] pendingInteractions full type
>
> ```ts theme={null}
> {
>   actions?: string[] | null,
>   expiresAt?: string | null,
>   fields?: any | null,
>   kind?: string | null,
>   message?: string | null,
>   requestId?: string | null,
>   requestedAt?: string | null,
>   server?: string | null,
>   summary?: any | null,
>   tool?: string | null
> }[] | null
> ```

> [accordion] progress full type
>
> ```ts theme={null}
> {
>   attempt?: number | null,
>   steps?: number | null,
>   todos?: any | null,
>   tools?: string[] | null,
>   updatedAt?: string | null
> } | null
> ```

***

### list

`cloudAgentTasks.list`

List task records in an environment, newest first. Filter to one agent, or with sessionId to one session's turns

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.cloudAgentTasks.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `cloudAgentId` | `string` | No | — |
| `cursor` | `string` | No | — |
| `environmentId` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `sessionId` | `string` | No | Requires cloudAgentId. |
| `status` | `AWAITING_INPUT \| CANCELLED \| COMPLETED \| FAILED \| PENDING \| RUNNING` | No | — |

**Output**

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

> [accordion] tasks full type
>
> ```ts theme={null}
> {
>   cloudAgentId?: string | null,
>   completedAt?: string | null,
>   createdAt?: string | null,
>   createdVia?: string | null,
>   error?: string | null,
>   externalRef?: string | null,
>   id?: string | null,
>   metadata?: any | null,
>   model?: string | null,
>   promptPreview?: string | null,
>   reasoningEffort?: string | null,
>   requestedByUserId?: string | null,
>   sessionId?: string | null,
>   startedAt?: string | null,
>   status?: string | null,
>   structuredOutput?: any | null,
>   text?: string | null
> }[] | null
> ```

***

### models

`cloudAgentTasks.models`

The models a task in this environment can run on, and the default a new conversation starts on

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.cloudAgentTasks.models({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `projectId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `defaultModel` | `string \| null` | No | — |
| `defaultReasoningEffort` | `string \| null` | No | — |
| `models` | `object[] \| null` | No | — |

> [accordion] models full type
>
> ```ts theme={null}
> {
>   displayName?: string | null,
>   id?: string | null,
>   isDefault?: boolean | null,
>   provider?: string | null,
>   reasoningEfforts?: string[] | null
> }[] | null
> ```

***

### recover

`cloudAgentTasks.recover`

Recover the latest task response from the agent. May wake the VM

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.cloudAgentTasks.recover({ cloudAgentId: '0000000c-5c1e-4d8a-9f43-2b6e1c0a9d17', sessionId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `cloudAgentId` | `string` | Yes | — |
| `sessionId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `attachments` | `object[] \| null` | No | Files the agent linked in its result, once it ends. |
| `cloudAgentId` | `string \| null` | No | — |
| `completedAt` | `string \| null` | No | — |
| `error` | `string \| null` | No | — |
| `externalRef` | `string \| null` | No | — |
| `metadata` | `any \| null` | No | — |
| `model` | `string \| null` | No | The model the turn ran on, once it was submitted. |
| `pendingInteractions` | `object[] \| null` | No | Answer these with cloudAgentTaskRespond. |
| `progress` | `object \| null` | No | — |
| `reasoningEffort` | `string \| null` | No | — |
| `sessionId` | `string \| null` | No | — |
| `sessionState` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `structuredOutput` | `any \| null` | No | — |
| `taskId` | `string \| null` | No | — |
| `text` | `string \| null` | No | — |

> [accordion] attachments full type
>
> ```ts theme={null}
> {
>   bytes?: number | null,
>   contentType?: string | null,
>   expiresAt?: string | null,
>   filename?: string | null,
>   id?: string | null,
>   url?: string | null
> }[] | null
> ```

> [accordion] pendingInteractions full type
>
> ```ts theme={null}
> {
>   actions?: string[] | null,
>   expiresAt?: string | null,
>   fields?: any | null,
>   kind?: string | null,
>   message?: string | null,
>   requestId?: string | null,
>   requestedAt?: string | null,
>   server?: string | null,
>   summary?: any | null,
>   tool?: string | null
> }[] | null
> ```

> [accordion] progress full type
>
> ```ts theme={null}
> {
>   attempt?: number | null,
>   steps?: number | null,
>   todos?: any | null,
>   tools?: string[] | null,
>   updatedAt?: string | null
> } | null
> ```

***

### respond

`cloudAgentTasks.respond`

Answer a question the task is waiting on. Wakes a sleeping VM to deliver it (the question survives sleep); poll cloudAgentTask for the outcome

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.cloudAgentTasks.respond({
	input: { action: 'ACCEPT', requestId: 'example', taskId: 'example' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   action: ACCEPT | ALLOW | APPROVE | CANCEL | DECLINE | DENY,
>   answeredBy?: string,
>   content?: any,
>   requestId: string,
>   taskId: string
> }
> ```

**Output**

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

***

## Custom Domains

### create

`customDomains.create`

Creates a new custom domain

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.customDomains.create({
	input: {
		domain: 'api.example.com',
		environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
		projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17',
		serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   domain: string,
>   environmentId: string,
>   projectId: string,
>   serviceId: string,
>   targetPort?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `edgeId` | `string \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isRailwayDomain` | `boolean \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `serviceId` | `string \| null` | No | — |
| `status` | `object \| null` | No | — |
| `syncStatus` | `string \| null` | No | — |
| `targetPort` | `number \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] status full type
>
> ```ts theme={null}
> {
>   cdnProvider?: string | null,
>   certificateErrorMessage?: string | null,
>   certificateErrorType?: string | null,
>   certificateRetryable?: boolean | null,
>   certificateStatus?: string | null,
>   certificateStatusDetailed?: string | null,
>   verificationDnsHost?: string | null,
>   verificationToken?: string | null,
>   verified?: boolean | null
> } | null
> ```

***

### delete

`customDomains.delete`

Deletes a custom domain

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

```ts theme={null}
await corsair.railway.api.customDomains.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### get

`customDomains.get`

Fetch details for a custom domain

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.customDomains.get({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `edgeId` | `string \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isRailwayDomain` | `boolean \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `serviceId` | `string \| null` | No | — |
| `status` | `object \| null` | No | — |
| `syncStatus` | `string \| null` | No | — |
| `targetPort` | `number \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] status full type
>
> ```ts theme={null}
> {
>   cdnProvider?: string | null,
>   certificateErrorMessage?: string | null,
>   certificateErrorType?: string | null,
>   certificateRetryable?: boolean | null,
>   certificateStatus?: string | null,
>   certificateStatusDetailed?: string | null,
>   verificationDnsHost?: string | null,
>   verificationToken?: string | null,
>   verified?: boolean | null
> } | null
> ```

***

### isAvailable

`customDomains.isAvailable`

Checks if a custom domain is available

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.customDomains.isAvailable({ domain: 'api.example.com' });
```

**Input**

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

**Output**

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

***

### issueCertificate

`customDomains.issueCertificate`

Issues a new certificate

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.customDomains.issueCertificate({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### update

`customDomains.update`

Updates a custom domain

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.customDomains.update({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `id` | `string` | Yes | — |
| `targetPort` | `number` | No | — |

**Output:** `boolean`

***

## Databases

### cancelPitrHaWorkflow

`databases.cancelPitrHaWorkflow`

Cancels an in-progress PITR enable/disable rollout on an HA database cluster and resets its progress so the UI re-reads from the live cluster. No-ops when nothing is running

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.databases.cancelPitrHaWorkflow({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', rootServiceId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `rootServiceId` | `string` | Yes | — |

**Output:** `boolean`

***

### clearPitrHaWorkflowProgress

`databases.clearPitrHaWorkflowProgress`

Clears the recorded progress of a finished PITR enable/disable rollout so the Backups page starts fresh. A rollout still in progress cannot be cleared

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.databases.clearPitrHaWorkflowProgress({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', rootServiceId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `rootServiceId` | `string` | Yes | — |

**Output:** `boolean`

***

### disablePitrForHaCluster

`databases.disablePitrForHaCluster`

Disables point-in-time recovery on an HA database cluster with the same rolling rollout as enable. The backup bucket is left intact, so existing backup history is preserved

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.databases.disablePitrForHaCluster({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', rootServiceId: 'example' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   projectId: string,
>   rootServiceId: string
> }
> ```

**Output**

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

***

### enablePitrForHaCluster

`databases.enablePitrForHaCluster`

Enables point-in-time recovery on an HA database cluster (Postgres HA, MySQL HA) with a rolling, near-zero-downtime rollout across its members. Safe to retry

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.databases.enablePitrForHaCluster({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', rootServiceId: 'example' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   projectId: string,
>   rootServiceId: string
> }
> ```

**Output**

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

***

### mysqlPitrRestorableWindow

`databases.mysqlPitrRestorableWindow`

The point-in-time window a MySQL service's binlog archive can restore to, resolved from the archive bucket: the oldest full backup (floor), the newest shipped binlog (ceiling) and every full backup's timestamp. archiveConfigured is false when the service carries no complete BINLOG\_ARCHIVE\_\* contract

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.databases.mysqlPitrRestorableWindow({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `archiveConfigured` | `boolean \| null` | No | — |
| `ceilingAt` | `string \| null` | No | — |
| `fetchedAt` | `string \| null` | No | — |
| `floorAt` | `string \| null` | No | — |
| `fullBackupCount` | `number \| null` | No | — |
| `fullBackupsTakenAt` | `string[] \| null` | No | — |
| `lineageCount` | `number \| null` | No | — |
| `listingTruncated` | `boolean \| null` | No | — |

***

### passwordRotationProgress

`databases.passwordRotationProgress`

Progress of the HA password rotation running for a cluster, or null when none is

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.databases.passwordRotationProgress({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `completedMembers` | `string[] \| null` | No | — |
| `error` | `string \| null` | No | — |
| `memberServiceId` | `string \| null` | No | — |
| `memberServiceName` | `string \| null` | No | — |
| `phase` | `string \| null` | No | — |

***

### pitrHaClusterReplicationHealth

`databases.pitrHaClusterReplicationHealth`

Live replication health for an HA database cluster (Postgres HA, MySQL HA). Use it to gate the Enable/Disable PITR buttons so a rollout can't start while a member is too far behind to rejoin. Returns null when the service isn't an HA root

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.databases.pitrHaClusterReplicationHealth({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', rootServiceId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `rootServiceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `allHealthy` | `boolean \| null` | No | — |
| `checkedAt` | `string \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `members` | `object[] \| null` | No | — |
| `reachable` | `boolean \| null` | No | — |
| `rootServiceId` | `string \| null` | No | — |

> [accordion] members full type
>
> ```ts theme={null}
> {
>   healthy?: boolean | null,
>   isLeader?: boolean | null,
>   lagMb?: number | null,
>   patroniName?: string | null,
>   serviceId?: string | null,
>   serviceName?: string | null,
>   state?: string | null
> }[] | null
> ```

***

### pitrHaWorkflowProgress

`databases.pitrHaWorkflowProgress`

One-shot read of the current progress of a PITR enable/disable rollout on an HA database cluster. Use it to rehydrate state on page load, then poll this field for updates. Returns null when no rollout has run recently

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.databases.pitrHaWorkflowProgress({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', rootServiceId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `rootServiceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `clusterMutated` | `boolean \| null` | No | — |
| `completedAt` | `string \| null` | No | — |
| `currentMemberServiceId` | `string \| null` | No | — |
| `direction` | `string \| null` | No | — |
| `engine` | `string \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `errorMessage` | `string \| null` | No | — |
| `failedAtPhase` | `string \| null` | No | — |
| `members` | `object[] \| null` | No | — |
| `newLeaderServiceId` | `string \| null` | No | — |
| `phase` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `rootServiceId` | `string \| null` | No | — |
| `startedAt` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `workflowId` | `string \| null` | No | — |

> [accordion] members full type
>
> ```ts theme={null}
> {
>   isLeader?: boolean | null,
>   serviceId?: string | null,
>   serviceName?: string | null,
>   status?: string | null
> }[] | null
> ```

***

### postgresHaClusterUptime

`databases.postgresHaClusterUptime`

One Postgres HA cluster's uptime SLI over the last N days: its row, its windows, its daily rollups. The cluster is named by any of its member services, since an environment can hold more than one. Errors when the service is not part of a Postgres HA cluster

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.databases.postgresHaClusterUptime({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `days` | `number` | No | — |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | Any member service of the cluster. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `cluster` | `object \| null` | No | — |
| `daily` | `object[] \| null` | No | — |
| `windows` | `object[] \| null` | No | — |

> [accordion] cluster full type
>
> ```ts theme={null}
> {
>   availability?: number | null,
>   degradedMinutes?: number | null,
>   downMinutes?: number | null,
>   environmentId?: string | null,
>   environmentName?: string | null,
>   excludedMinutes?: number | null,
>   lastRedundancyRound?: string | null,
>   measuredMinutes?: number | null,
>   platformDownMinutes?: number | null,
>   projectId?: string | null,
>   projectName?: string | null,
>   recent?: string | null,
>   redundancy?: number | null,
>   redundancyMeasuredMinutes?: number | null,
>   region?: string | null,
>   rootServiceId?: string | null,
>   rootServiceName?: string | null,
>   unknownMinutes?: number | null,
>   upMinutes?: number | null,
>   windows?: number | null,
>   workspaceName?: string | null
> } | null
> ```

> [accordion] daily full type
>
> ```ts theme={null}
> {
>   day?: string | null,
>   degradedMinutes?: number | null,
>   downMinutes?: number | null,
>   excludedMinutes?: number | null,
>   measuredMinutes?: number | null,
>   redundancyMeasuredMinutes?: number | null,
>   unknownMinutes?: number | null,
>   upMinutes?: number | null
> }[] | null
> ```

> [accordion] windows full type
>
> ```ts theme={null}
> {
>   customerInitiated?: boolean | null,
>   endedAt?: string | null,
>   environmentId?: string | null,
>   environmentName?: string | null,
>   evidence?: string | null,
>   failureClass?: string | null,
>   id?: string | null,
>   minutes?: number | null,
>   projectId?: string | null,
>   projectName?: string | null,
>   redundancyClass?: string | null,
>   rootServiceId?: string | null,
>   sli?: string | null,
>   startedAt?: string | null
> }[] | null
> ```

***

### resetPassword

`databases.resetPassword`

Reset database credentials, coordinating all members for an HA cluster. On an HA cluster the rotation keeps running after this returns (`rotationInProgress`); follow `databasePasswordRotationProgress` until it reports DONE

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

```ts theme={null}
await corsair.railway.api.databases.resetPassword({
	input: { databaseType: 'example', environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   databaseType: string,
>   environmentId: string,
>   serviceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `newPassword` | `string \| null` | No | — |
| `rotationInProgress` | `boolean \| null` | No | True when an HA cluster's rotation is still running: `newPassword` is live only once `databasePasswordRotationProgress` reports DONE, and `updatedVariables` is empty until then. |
| `updatedVariables` | `any \| null` | No | — |

***

## Deployments

### approve

`deployments.approve`

Approves a deployment

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.deployments.approve({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### buildLogs

`deployments.buildLogs`

Get the build log lines of a deployment

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.deployments.buildLogs({ deploymentId: '00000005-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `deploymentId` | `string` | Yes | — |
| `endDate` | `string` | No | — |
| `filter` | `string` | No | Filter logs by a string. Providing an empty value will match all logs. |
| `limit` | `number` | No | Limit the number of logs returned (defaults 100, max 5000) |
| `startDate` | `string` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   attributes?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   message?: string | null,
>   severity?: string | null,
>   tags?: {
>     deploymentId?: string | null,
>     deploymentInstanceId?: string | null,
>     environmentId?: string | null,
>     projectId?: string | null,
>     serviceId?: string | null,
>     snapshotId?: string | null
>   } | null,
>   timestamp?: string | null
> }[]
> ```

***

### cancel

`deployments.cancel`

Cancels a deployment

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.deployments.cancel({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### createInstanceExecution

`deployments.createInstanceExecution`

Invoke a deployment instance execution

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.deployments.createInstanceExecution({
	input: { serviceInstanceId: 'example' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   serviceInstanceId: string
> }
> ```

**Output:** `boolean`

***

### events

`deployments.events`

Get the deployment events for a deployment, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.deployments.events({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `id` | `string` | Yes | — |
| `last` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   completedAt?: string | null,
>   createdAt?: string | null,
>   id?: string | null,
>   payload?: {
>     attempt?: number | null,
>     detail?: string | null,
>     durationMs?: number | null,
>     error?: string | null,
>     maxAttempts?: number | null,
>     reason?: string | null,
>     skipped?: boolean | null
>   } | null,
>   step?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### get

`deployments.get`

Find a single deployment

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.deployments.get({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `canRedeploy` | `boolean \| null` | No | — |
| `canRollback` | `boolean \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `creator` | `object \| null` | No | — |
| `deploymentStopped` | `boolean \| null` | No | Check if a deployment's instances have all stopped |
| `diagnosis` | `any \| null` | No | — |
| `environment` | `object \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `instances` | `object[] \| null` | No | — |
| `isArchived` | `boolean \| null` | No | Older terminal deployment kept as history only: it can be redeployed but not rolled back to. Whether its snapshot's variables are still returned is DeploymentSnapshot.variablesRedacted. |
| `meta` | `any \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `service` | `object \| null` | No | — |
| `serviceId` | `string \| null` | No | — |
| `snapshotId` | `string \| null` | No | — |
| `sockets` | `object[] \| null` | No | — |
| `staticUrl` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `statusUpdatedAt` | `string \| null` | No | — |
| `suggestAddServiceDomain` | `boolean \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |

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

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

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

> [accordion] service full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   featureFlags?: string[] | null,
>   groupId?: string | null,
>   hasHiddenRegistryCredentialsFromTemplate?: boolean | null,
>   icon?: string | null,
>   id?: string | null,
>   isRestricted?: boolean | null,
>   kind?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   templateId?: string | null,
>   templateServiceId?: string | null,
>   templateThreadSlug?: string | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] sockets full type
>
> ```ts theme={null}
> {
>   ipv6?: boolean | null,
>   port?: number | null,
>   processName?: string | null,
>   updatedAt?: number | null
> }[] | null
> ```

***

### instanceExecutions

`deployments.instanceExecutions`

Get the deployment instance executions for a deployment, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.deployments.instanceExecutions({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `input` | `object` | Yes | — |
| `last` | `number` | No | — |

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   serviceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   completedAt?: string | null,
>   createdAt?: string | null,
>   deploymentId?: string | null,
>   deploymentMeta?: any | null,
>   id?: string | null,
>   status?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### list

`deployments.list`

Get all deployments, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.deployments.list({
	input: { projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
	first: 10,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `input` | `object` | Yes | — |
| `last` | `number` | No | — |

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId?: string,
>   includeDeleted?: boolean,
>   projectId?: string,
>   serviceId?: string,
>   status?: {
>     in?: (BUILDING | CRASHED | DEPLOYING | FAILED | INITIALIZING | NEEDS_APPROVAL | QUEUED | REMOVED | REMOVING | SKIPPED | SLEEPING | SUCCESS | WAITING)[],
>     notIn?: (BUILDING | CRASHED | DEPLOYING | FAILED | INITIALIZING | NEEDS_APPROVAL | QUEUED | REMOVED | REMOVING | SKIPPED | SLEEPING | SUCCESS | WAITING)[]
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   canRedeploy?: boolean | null,
>   canRollback?: boolean | null,
>   createdAt?: string | null,
>   creator?: {
>     avatar?: string | null,
>     email?: string | null,
>     id?: string | null,
>     name?: string | null
>   } | null,
>   deploymentStopped?: boolean | null,
>   diagnosis?: any | null,
>   environment?: {
>     canAccess?: boolean | null,
>     canvasGroupRefs?: any | null,
>     clearanceCachingTurnedOff?: string[] | null,
>     clearanceDefault?: boolean | null,
>     clearanceDefaultUpdatedAt?: string | null,
>     clearancePropagatedAt?: string | null,
>     clearancePropagationError?: string | null,
>     config?: any | null,
>     configEtag?: string | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     iacPartials?: any | null,
>     id?: string | null,
>     isEphemeral?: boolean | null,
>     name?: string | null,
>     projectId?: string | null,
>     sourceEnvironmentName?: string | null,
>     unmergedChangesCount?: number | null,
>     updatedAt?: string | null
>   } | null,
>   environmentId?: string | null,
>   id?: string | null,
>   instances?: {
>     id?: string | null,
>     status?: string | null
>   }[] | null,
>   isArchived?: boolean | null,
>   meta?: any | null,
>   projectId?: string | null,
>   service?: {
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     featureFlags?: string[] | null,
>     groupId?: string | null,
>     hasHiddenRegistryCredentialsFromTemplate?: boolean | null,
>     icon?: string | null,
>     id?: string | null,
>     isRestricted?: boolean | null,
>     kind?: string | null,
>     name?: string | null,
>     projectId?: string | null,
>     templateId?: string | null,
>     templateServiceId?: string | null,
>     templateThreadSlug?: string | null,
>     updatedAt?: string | null
>   } | null,
>   serviceId?: string | null,
>   snapshotId?: string | null,
>   sockets?: {
>     ipv6?: boolean | null,
>     port?: number | null,
>     processName?: string | null,
>     updatedAt?: number | null
>   }[] | null,
>   staticUrl?: string | null,
>   status?: string | null,
>   statusUpdatedAt?: string | null,
>   suggestAddServiceDomain?: boolean | null,
>   updatedAt?: string | null,
>   url?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### logs

`deployments.logs`

Get the runtime log lines of a deployment, optionally filtered and between two dates

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.deployments.logs({ deploymentId: '00000005-5c1e-4d8a-9f43-2b6e1c0a9d17', limit: 100 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `deploymentId` | `string` | Yes | — |
| `endDate` | `string` | No | — |
| `filter` | `string` | No | Filter logs by a string. Providing an empty value will match all logs. |
| `limit` | `number` | No | Limit the number of logs returned (defaults 100, max 5000) |
| `startDate` | `string` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   attributes?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   message?: string | null,
>   severity?: string | null,
>   tags?: {
>     deploymentId?: string | null,
>     deploymentInstanceId?: string | null,
>     environmentId?: string | null,
>     projectId?: string | null,
>     serviceId?: string | null,
>     snapshotId?: string | null
>   } | null,
>   timestamp?: string | null
> }[]
> ```

***

### redeploy

`deployments.redeploy`

Redeploys a deployment

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.deployments.redeploy({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `usePreviousImageTag` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `canRedeploy` | `boolean \| null` | No | — |
| `canRollback` | `boolean \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `creator` | `object \| null` | No | — |
| `deploymentStopped` | `boolean \| null` | No | Check if a deployment's instances have all stopped |
| `diagnosis` | `any \| null` | No | — |
| `environment` | `object \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `instances` | `object[] \| null` | No | — |
| `isArchived` | `boolean \| null` | No | Older terminal deployment kept as history only: it can be redeployed but not rolled back to. Whether its snapshot's variables are still returned is DeploymentSnapshot.variablesRedacted. |
| `meta` | `any \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `service` | `object \| null` | No | — |
| `serviceId` | `string \| null` | No | — |
| `snapshotId` | `string \| null` | No | — |
| `sockets` | `object[] \| null` | No | — |
| `staticUrl` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `statusUpdatedAt` | `string \| null` | No | — |
| `suggestAddServiceDomain` | `boolean \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |

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

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

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

> [accordion] service full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   featureFlags?: string[] | null,
>   groupId?: string | null,
>   hasHiddenRegistryCredentialsFromTemplate?: boolean | null,
>   icon?: string | null,
>   id?: string | null,
>   isRestricted?: boolean | null,
>   kind?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   templateId?: string | null,
>   templateServiceId?: string | null,
>   templateThreadSlug?: string | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] sockets full type
>
> ```ts theme={null}
> {
>   ipv6?: boolean | null,
>   port?: number | null,
>   processName?: string | null,
>   updatedAt?: number | null
> }[] | null
> ```

***

### remove

`deployments.remove`

Removes a deployment

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.deployments.remove({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### restart

`deployments.restart`

Restarts a deployment

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.deployments.restart({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### rollback

`deployments.rollback`

Rolls back to a deployment

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.deployments.rollback({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### snapshot

`deployments.snapshot`

Find a single DeploymentSnapshot

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.deployments.snapshot({ deploymentId: '00000005-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `variables` | `Record<string, string> \| null` | No | Empty for archived deployments, whose variables are not kept (see variablesRedacted). |
| `variablesRedacted` | `boolean \| null` | No | True when the snapshot belongs only to archived deployments, so its variables are not returned. |

***

### stop

`deployments.stop`

Stops a deployment

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.deployments.stop({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

## Deployment Triggers

### create

`deploymentTriggers.create`

Creates a deployment trigger

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.deploymentTriggers.create({
	input: {
		branch: 'main',
		environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
		projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17',
		provider: 'example',
		repository: 'example',
		serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   branch: string,
>   checkSuites?: boolean,
>   environmentId: string,
>   projectId: string,
>   provider: string,
>   repository: string,
>   rootDirectory?: string,
>   serviceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseEnvironmentOverrideId` | `string \| null` | No | — |
| `branch` | `string \| null` | No | — |
| `checkSuites` | `boolean \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `provider` | `string \| null` | No | — |
| `repository` | `string \| null` | No | — |
| `serviceId` | `string \| null` | No | — |
| `validCheckSuites` | `number \| null` | No | — |

***

### delete

`deploymentTriggers.delete`

Deletes a deployment trigger

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

```ts theme={null}
await corsair.railway.api.deploymentTriggers.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### list

`deploymentTriggers.list`

All deployment triggers, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.deploymentTriggers.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `environmentId` | `string` | Yes | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |
| `projectId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   baseEnvironmentOverrideId?: string | null,
>   branch?: string | null,
>   checkSuites?: boolean | null,
>   environmentId?: string | null,
>   id?: string | null,
>   projectId?: string | null,
>   provider?: string | null,
>   repository?: string | null,
>   serviceId?: string | null,
>   validCheckSuites?: number | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### update

`deploymentTriggers.update`

Updates a deployment trigger

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.deploymentTriggers.update({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   branch?: string,
>   checkSuites?: boolean,
>   repository?: string,
>   rootDirectory?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseEnvironmentOverrideId` | `string \| null` | No | — |
| `branch` | `string \| null` | No | — |
| `checkSuites` | `boolean \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `provider` | `string \| null` | No | — |
| `repository` | `string \| null` | No | — |
| `serviceId` | `string \| null` | No | — |
| `validCheckSuites` | `number \| null` | No | — |

***

## Dns Query Logs

### list

`dnsQueryLogs.list`

Fetch individual DNS query logs for an environment

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.dnsQueryLogs.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `afterDate` | `string` | No | Latest date to look for logs after the anchor |
| `afterLimit` | `number` | No | Limit logs returned after the anchor |
| `anchorDate` | `string` | No | Target date time to look for logs |
| `beforeDate` | `string` | No | Oldest date to look for logs before the anchor |
| `beforeLimit` | `number` | No | Limit logs returned before the anchor |
| `deploymentInstanceId` | `string` | No | Filter by deployment instance / sandbox ID (optional) |
| `environmentId` | `string` | Yes | — |
| `filter` | `string` | No | Filter expression (e.g., @rcode:NXDOMAIN @qtype:A @domain:example.com @status:failed). Prefix a term with - to exclude it; repeat a key to match any of its values |
| `serviceId` | `string` | No | Filter by service ID (optional) |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   answers?: string[] | null,
>   cnameChain?: string[] | null,
>   deploymentId?: string | null,
>   deploymentInstanceId?: string | null,
>   qname?: string | null,
>   qtype?: string | null,
>   queriedAt?: string | null,
>   queryZone?: string | null,
>   rcode?: string | null,
>   serviceId?: string | null
> }[]
> ```

***

## Docker Compose

### import

`dockerCompose.import`

Create services and volumes from docker compose

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.dockerCompose.import({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', yaml: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `projectId` | `string` | Yes | — |
| `skipStagingPatch` | `boolean` | No | — |
| `yaml` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `errors` | `string[] \| null` | No | — |
| `patch` | `any \| null` | No | — |

***

## Domains

### list

`domains.list`

All domains for a service instance

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.domains.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `projectId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `customDomains` | `object[] \| null` | No | — |
| `serviceDomains` | `object[] \| null` | No | — |

> [accordion] customDomains full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   domain?: string | null,
>   edgeId?: string | null,
>   environmentId?: string | null,
>   id?: string | null,
>   isRailwayDomain?: boolean | null,
>   projectId?: string | null,
>   serviceId?: string | null,
>   syncStatus?: string | null,
>   targetPort?: number | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] serviceDomains full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   domain?: string | null,
>   edgeId?: string | null,
>   environmentId?: string | null,
>   id?: string | null,
>   newDomainName?: string | null,
>   newHostLabel?: string | null,
>   projectId?: string | null,
>   serviceId?: string | null,
>   suffix?: string | null,
>   syncStatus?: string | null,
>   targetPort?: number | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

## Egress Gateways

### clearAssociations

`egressGateways.clearAssociations`

Clear all egress gateway associations for a service instance

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.egressGateways.clearAssociations({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   allEnvironments?: boolean,
>   environmentId: string,
>   serviceId: string
> }
> ```

**Output:** `boolean`

***

### createAssociation

`egressGateways.createAssociation`

Create a new egress gateway association for a service instance

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.egressGateways.createAssociation({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   region?: string,
>   serviceId: string
> }
> ```

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   ipv4?: string | null,
>   region?: string | null,
>   zone?: string | null
> }[]
> ```

***

### haMigrationPreview

`egressGateways.haMigrationPreview`

Preview the HA static egress IPs that would be assigned, without applying them. Set allEnvironments to cover all of the service's environments

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.egressGateways.haMigrationPreview({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   allEnvironments?: boolean,
>   environmentId: string,
>   serviceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `environments` | `object[] \| null` | No | — |
| `ips` | `object[] \| null` | No | — |

> [accordion] environments full type
>
> ```ts theme={null}
> {
>   environmentId?: string | null,
>   environmentName?: string | null,
>   error?: string | null,
>   success?: boolean | null
> }[] | null
> ```

> [accordion] ips full type
>
> ```ts theme={null}
> {
>   ipv4?: string | null,
>   region?: string | null,
>   zone?: string | null
> }[] | null
> ```

***

### haPreview

`egressGateways.haPreview`

Preview HA static egress IPs that would be assigned without persisting

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.egressGateways.haPreview({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   ipv4?: string | null,
>   region?: string | null,
>   zone?: string | null
> }[]
> ```

***

### legacyPreview

`egressGateways.legacyPreview`

Preview legacy static egress IP that would be assigned without persisting

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.egressGateways.legacyPreview({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   ipv4?: string | null,
>   region?: string | null,
>   zone?: string | null
> }[]
> ```

***

### list

`egressGateways.list`

All egress gateways assigned to a service instance

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.egressGateways.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   ipv4?: string | null,
>   region?: string | null,
>   zone?: string | null
> }[]
> ```

***

### rollbackFromHa

`egressGateways.rollbackFromHa`

Switch a service from HA static egress IPs back to a standard static IP. Set allEnvironments to apply to all of the service's environments

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.egressGateways.rollbackFromHa({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   allEnvironments?: boolean,
>   environmentId: string,
>   serviceId: string
> }
> ```

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   ipv4?: string | null,
>   region?: string | null,
>   zone?: string | null
> }[]
> ```

***

### upgradeToHa

`egressGateways.upgradeToHa`

Enable HA static egress IPs for a service. Set allEnvironments to apply to all of the service's environments

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.egressGateways.upgradeToHa({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   allEnvironments?: boolean,
>   environmentId: string,
>   serviceId: string
> }
> ```

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   ipv4?: string | null,
>   region?: string | null,
>   zone?: string | null
> }[]
> ```

***

## Environment Patches

### commit

`environmentPatches.commit`

Commit the provided patch to the environment

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.environmentPatches.commit({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `commitMessage` | `string` | No | — |
| `environmentId` | `string` | Yes | — |
| `patch` | `any` | No | — |
| `skipDeploys` | `boolean` | No | Skip deploys for services affected by this patch. |

**Output:** `string`

***

### commitStaged

`environmentPatches.commitStaged`

Commits the staged changes for a single environment

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.environmentPatches.commitStaged({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `commitMessage` | `string` | No | — |
| `environmentId` | `string` | Yes | — |
| `skipDeploys` | `boolean` | No | Skip deploys for services affected by this patch. |

**Output:** `string`

***

### dismissFailure

`environmentPatches.dismissFailure`

Acknowledge a FAILED patch so it no longer shows as the environment's latest failure. The patch is left untouched

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.environmentPatches.dismissFailure({ patchId: 'example' });
```

**Input**

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

**Output:** `boolean`

***

### get

`environmentPatches.get`

Get a single environment patch by ID

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.environmentPatches.get({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | No | The patch's environment, when known. Speeds up lookups of archived patches. |
| `id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `appliedAt` | `string \| null` | No | — |
| `appliedBy` | `object \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `environment` | `object \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `lastAppliedError` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |
| `patch` | `any \| null` | No | — |
| `status` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `variablesRedacted` | `boolean \| null` | No | True when this patch is served from the long-term archive: variable names are kept, values are not. |

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

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

***

### list

`environmentPatches.list`

Get the patches for an environment, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.environmentPatches.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `environmentId` | `string` | Yes | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   appliedAt?: string | null,
>   appliedBy?: {
>     avatar?: string | null,
>     email?: string | null,
>     id?: string | null,
>     name?: string | null,
>     username?: string | null
>   } | null,
>   createdAt?: string | null,
>   environment?: {
>     canAccess?: boolean | null,
>     canvasGroupRefs?: any | null,
>     clearanceCachingTurnedOff?: string[] | null,
>     clearanceDefault?: boolean | null,
>     clearanceDefaultUpdatedAt?: string | null,
>     clearancePropagatedAt?: string | null,
>     clearancePropagationError?: string | null,
>     config?: any | null,
>     configEtag?: string | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     iacPartials?: any | null,
>     id?: string | null,
>     isEphemeral?: boolean | null,
>     name?: string | null,
>     projectId?: string | null,
>     sourceEnvironmentName?: string | null,
>     unmergedChangesCount?: number | null,
>     updatedAt?: string | null
>   } | null,
>   environmentId?: string | null,
>   id?: string | null,
>   lastAppliedError?: string | null,
>   message?: string | null,
>   patch?: any | null,
>   status?: string | null,
>   updatedAt?: string | null,
>   variablesRedacted?: boolean | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### restage

`environmentPatches.restage`

Copy a FAILED patch's changes into the environment's staged patch (creating one if needed). The FAILED patch is left untouched

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.environmentPatches.restage({ patchId: 'example' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `appliedAt` | `string \| null` | No | — |
| `appliedBy` | `object \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `environment` | `object \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `lastAppliedError` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |
| `patch` | `any \| null` | No | — |
| `status` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `variablesRedacted` | `boolean \| null` | No | True when this patch is served from the long-term archive: variable names are kept, values are not. |

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

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

***

## Environments

### applyChangeSet

`environments.applyChangeSet`

Experimental: applies an intent-level RailwayChangeSet and returns operation results

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.environments.applyChangeSet({
	environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseConfigEtag` | `string` | No | Snapshot token from Environment.configEtag the plan was computed against. When set, the apply is rejected if the environment has changed since. |
| `commitMessage` | `string` | No | — |
| `environmentId` | `string` | Yes | — |
| `input` | `object \| any[] \| string \| number \| boolean` | Yes | — |
| `waitForCompletion` | `boolean` | No | Defaults to true for compatibility. Async-capable clients set false and poll environmentChangeSetApply. |

> [accordion] input full type
>
> ```ts theme={null}
> {
> } | any[] | string | number | boolean
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `changes` | `object[] \| null` | No | — |
| `deploymentId` | `string \| null` | No | — |
| `diagnostics` | `any \| null` | No | — |
| `id` | `string \| null` | No | — |
| `operationId` | `string \| null` | No | — |
| `stagedPatchId` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |

> [accordion] changes full type
>
> ```ts theme={null}
> {
>   kind?: string | null,
>   outputs?: any | null,
>   path?: string | null,
>   status?: string | null,
>   summary?: string | null
> }[] | null
> ```

***

### changeSetApplyStatus

`environments.changeSetApplyStatus`

Returns the status or completed result of an asynchronous RailwayChangeSet apply

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.environments.changeSetApplyStatus({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `changes` | `object[] \| null` | No | — |
| `deploymentId` | `string \| null` | No | — |
| `diagnostics` | `any \| null` | No | — |
| `id` | `string \| null` | No | — |
| `operationId` | `string \| null` | No | — |
| `stagedPatchId` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |

> [accordion] changes full type
>
> ```ts theme={null}
> {
>   kind?: string | null,
>   outputs?: any | null,
>   path?: string | null,
>   status?: string | null,
>   summary?: string | null
> }[] | null
> ```

***

### create

`environments.create`

Creates a new environment

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.environments.create({
	input: { name: 'api', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   applyChangesInBackground?: boolean,
>   ephemeral?: boolean,
>   name: string,
>   projectId: string,
>   skipInitialDeploys?: boolean,
>   sourceEnvironmentId?: string,
>   stageInitialChanges?: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `canAccess` | `boolean \| null` | No | — |
| `canvasGroupRefs` | `any \| null` | No | — |
| `clearanceCachingTurnedOff` | `string[] \| null` | No | Services whose edge caching was turned off when the Railway Authentication default last turned on. |
| `clearanceDefault` | `boolean \| null` | No | Whether Railway Authentication protects this environment's services that have no setting of their own. |
| `clearanceDefaultUpdatedAt` | `string \| null` | No | — |
| `clearancePropagatedAt` | `string \| null` | No | When the current Railway Authentication default last finished reaching every service that inherits it. |
| `clearancePropagationError` | `string \| null` | No | — |
| `clearanceServiceCounts` | `object \| null` | No | — |
| `config` | `any \| null` | No | — |
| `configEtag` | `string \| null` | No | Opaque snapshot token of the environment's IaC-relevant config. Echo it back as baseConfigEtag on environmentApplyChangeSet for optimistic concurrency. |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `iacPartials` | `any \| null` | No | IaC resource address → partial name for this environment. '\*' is the whole-project owner. Used so omit=delete only applies to resources this file already owns. |
| `id` | `string \| null` | No | — |
| `isEphemeral` | `boolean \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `sourceEnvironment` | `object \| null` | No | — |
| `sourceEnvironmentName` | `string \| null` | No | Name of the environment this one was copied from. A project token can read this on its own environment. It does not grant access to the source environment. |
| `unmergedChangesCount` | `number \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] clearanceServiceCounts full type
>
> ```ts theme={null}
> {
>   inheriting?: number | null,
>   off?: number | null,
>   on?: number | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   baseBranch?: string | null,
>   branch?: string | null,
>   latestSuccessfulGitHubDeploymentId?: number | null,
>   prCommentId?: number | null,
>   prNumber?: number | null,
>   prRepo?: string | null,
>   prTitle?: string | null,
>   skippedResourceIds?: any | null
> } | null
> ```

> [accordion] sourceEnvironment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

***

### delete

`environments.delete`

Deletes an environment

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

```ts theme={null}
await corsair.railway.api.environments.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### get

`environments.get`

Find a single environment

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.environments.get({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `canAccess` | `boolean \| null` | No | — |
| `canvasGroupRefs` | `any \| null` | No | — |
| `clearanceCachingTurnedOff` | `string[] \| null` | No | Services whose edge caching was turned off when the Railway Authentication default last turned on. |
| `clearanceDefault` | `boolean \| null` | No | Whether Railway Authentication protects this environment's services that have no setting of their own. |
| `clearanceDefaultUpdatedAt` | `string \| null` | No | — |
| `clearancePropagatedAt` | `string \| null` | No | When the current Railway Authentication default last finished reaching every service that inherits it. |
| `clearancePropagationError` | `string \| null` | No | — |
| `clearanceServiceCounts` | `object \| null` | No | — |
| `config` | `any \| null` | No | — |
| `configEtag` | `string \| null` | No | Opaque snapshot token of the environment's IaC-relevant config. Echo it back as baseConfigEtag on environmentApplyChangeSet for optimistic concurrency. |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `iacPartials` | `any \| null` | No | IaC resource address → partial name for this environment. '\*' is the whole-project owner. Used so omit=delete only applies to resources this file already owns. |
| `id` | `string \| null` | No | — |
| `isEphemeral` | `boolean \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `sourceEnvironment` | `object \| null` | No | — |
| `sourceEnvironmentName` | `string \| null` | No | Name of the environment this one was copied from. A project token can read this on its own environment. It does not grant access to the source environment. |
| `unmergedChangesCount` | `number \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] clearanceServiceCounts full type
>
> ```ts theme={null}
> {
>   inheriting?: number | null,
>   off?: number | null,
>   on?: number | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   baseBranch?: string | null,
>   branch?: string | null,
>   latestSuccessfulGitHubDeploymentId?: number | null,
>   prCommentId?: number | null,
>   prNumber?: number | null,
>   prRepo?: string | null,
>   prTitle?: string | null,
>   skippedResourceIds?: any | null
> } | null
> ```

> [accordion] sourceEnvironment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

***

### hasLegacyStaticEgress

`environments.hasLegacyStaticEgress`

Whether any service in the environment is on legacy static egress (not HA). Used to surface the HA migration banner

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.environments.hasLegacyStaticEgress({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### history

`environments.history`

Settled history for an environment (system events + terminal operations), newest first. Cursor-paginated, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.environments.history({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `environmentId` | `string` | Yes | — |
| `filter` | `object` | No | — |
| `first` | `number` | No | — |

> [accordion] filter full type
>
> ```ts theme={null}
> {
>   actions?: string[],
>   mode?: ACTIVITY_FEED,
>   objects?: string[],
>   outcomes?: string[],
>   serviceIds?: string[],
>   since?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   action?: string | null,
>   activityPayload?: any | null,
>   actor?: {
>     onBehalfOf?: string | null,
>     principal?: string | null,
>     surface?: string | null
>   } | null,
>   changes?: any | null,
>   createdAt?: string | null,
>   id?: string | null,
>   object?: string | null,
>   operationKind?: string | null,
>   outcome?: string | null,
>   parentRef?: string | null,
>   payload?: any | null,
>   serviceIds?: string[] | null,
>   severity?: string | null,
>   source?: string | null,
>   workflowId?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   endCursor?: string | null
> } | null
> ```

***

### iacPartialRelease

`environments.iacPartialRelease`

Release resources from a named IaC partial without deleting, redeploying, or changing them. Omit resources to release the entire partial. Whole-project management is possible once no named partials remain. A later named-partial apply can claim released resources again

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.environments.iacPartialRelease({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', partial: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseConfigEtag` | `string` | No | Snapshot token from Environment.configEtag the ownership preview was computed against. When set, the release is rejected if the environment has changed since. |
| `environmentId` | `string` | Yes | — |
| `partial` | `string` | Yes | — |
| `resources` | `string[]` | No | Resource addresses to release (for example service.api). Every address must belong to the named partial. Omit to release all of its resources; an empty list is rejected. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `affectedResources` | `string[] \| null` | No | Resource addresses whose ownership changed. |
| `iacPartials` | `any \| null` | No | The environment's complete ownership map after the change. |

***

### iacPartialTransfer

`environments.iacPartialTransfer`

Transfer resources between named IaC partials without deleting, redeploying, or changing them. Omit resources to transfer the entire source partial. The destination may be a new or existing partial

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

```ts theme={null}
await corsair.railway.api.environments.iacPartialTransfer({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', fromPartial: 'example', toPartial: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseConfigEtag` | `string` | No | Snapshot token from Environment.configEtag the ownership preview was computed against. When set, the transfer is rejected if the environment has changed since. |
| `environmentId` | `string` | Yes | — |
| `fromPartial` | `string` | Yes | — |
| `resources` | `string[]` | No | Resource addresses to transfer (for example service.api). Every address must belong to fromPartial. Omit to transfer all of its resources; an empty list is rejected. |
| `toPartial` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `affectedResources` | `string[] \| null` | No | Resource addresses whose ownership changed. |
| `iacPartials` | `any \| null` | No | The environment's complete ownership map after the change. |

***

### list

`environments.list`

Gets all environments for a project, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.environments.list({ projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `isEphemeral` | `boolean` | No | — |
| `last` | `number` | No | — |
| `projectId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   clearanceServiceCounts?: {
>     inheriting?: number | null,
>     off?: number | null,
>     on?: number | null
>   } | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   meta?: {
>     baseBranch?: string | null,
>     branch?: string | null,
>     latestSuccessfulGitHubDeploymentId?: number | null,
>     prCommentId?: number | null,
>     prNumber?: number | null,
>     prRepo?: string | null,
>     prTitle?: string | null,
>     skippedResourceIds?: any | null
>   } | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironment?: {
>     canAccess?: boolean | null,
>     canvasGroupRefs?: any | null,
>     clearanceCachingTurnedOff?: string[] | null,
>     clearanceDefault?: boolean | null,
>     clearanceDefaultUpdatedAt?: string | null,
>     clearancePropagatedAt?: string | null,
>     clearancePropagationError?: string | null,
>     config?: any | null,
>     configEtag?: string | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     iacPartials?: any | null,
>     id?: string | null,
>     isEphemeral?: boolean | null,
>     name?: string | null,
>     projectId?: string | null,
>     sourceEnvironmentName?: string | null,
>     unmergedChangesCount?: number | null,
>     updatedAt?: string | null
>   } | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### logs

`environments.logs`

Fetch logs for a project environment. Build logs are excluded unless a snapshot ID is explicitly provided in the filter

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.environments.logs({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `afterDate` | `string` | No | Latest date to look for logs after the anchor |
| `afterLimit` | `number` | No | Limit the number of logs returned after the anchor |
| `anchorDate` | `string` | No | Target date time to look for logs |
| `beforeDate` | `string` | No | Oldest date to look for logs before the anchor |
| `beforeLimit` | `number` | No | Limit the number of logs returned before the anchor |
| `environmentId` | `string` | Yes | — |
| `filter` | `string` | No | Filter logs using a query syntax |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   attributes?: {
>     key?: string | null,
>     value?: string | null
>   }[] | null,
>   message?: string | null,
>   severity?: string | null,
>   tags?: {
>     deploymentId?: string | null,
>     deploymentInstanceId?: string | null,
>     environmentId?: string | null,
>     projectId?: string | null,
>     serviceId?: string | null,
>     snapshotId?: string | null
>   } | null,
>   timestamp?: string | null
> }[]
> ```

***

### overrideBase

`environments.overrideBase`

Sets the base environment override for a deployment trigger

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.environments.overrideBase({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   baseEnvironmentOverrideId?: string
> }
> ```

**Output:** `boolean`

***

### pendingWork

`environments.pendingWork`

Pending project-mutating work for an environment. Unions registered OperationSources (patches, standalone deploys) and returns parent rows only — not a stored inbox

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.environments.pendingWork({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   actor?: {
>     onBehalfOf?: string | null,
>     principal?: string | null,
>     surface?: string | null
>   } | null,
>   changes?: any | null,
>   children?: {
>     changes?: any | null,
>     environmentId?: string | null,
>     finishedAt?: string | null,
>     id?: string | null,
>     kind?: string | null,
>     parentRef?: string | null,
>     startedAt?: string | null,
>     status?: string | null,
>     workflowId?: string | null
>   }[] | null,
>   environmentId?: string | null,
>   finishedAt?: string | null,
>   id?: string | null,
>   kind?: string | null,
>   parentRef?: string | null,
>   startedAt?: string | null,
>   status?: string | null,
>   workflowId?: string | null
> }[]
> ```

***

### previewChangeSet

`environments.previewChangeSet`

Experimental: previews an intent-level RailwayChangeSet without side effects

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.environments.previewChangeSet({
	environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `input` | `object \| any[] \| string \| number \| boolean` | Yes | — |

> [accordion] input full type
>
> ```ts theme={null}
> {
> } | any[] | string | number | boolean
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `changeSet` | `any \| null` | No | — |
| `diagnostics` | `any \| null` | No | — |
| `effects` | `any \| null` | No | — |

***

### rename

`environments.rename`

Renames an environment

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.environments.rename({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: { name: 'api' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   name: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `canAccess` | `boolean \| null` | No | — |
| `canvasGroupRefs` | `any \| null` | No | — |
| `clearanceCachingTurnedOff` | `string[] \| null` | No | Services whose edge caching was turned off when the Railway Authentication default last turned on. |
| `clearanceDefault` | `boolean \| null` | No | Whether Railway Authentication protects this environment's services that have no setting of their own. |
| `clearanceDefaultUpdatedAt` | `string \| null` | No | — |
| `clearancePropagatedAt` | `string \| null` | No | When the current Railway Authentication default last finished reaching every service that inherits it. |
| `clearancePropagationError` | `string \| null` | No | — |
| `clearanceServiceCounts` | `object \| null` | No | — |
| `config` | `any \| null` | No | — |
| `configEtag` | `string \| null` | No | Opaque snapshot token of the environment's IaC-relevant config. Echo it back as baseConfigEtag on environmentApplyChangeSet for optimistic concurrency. |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `iacPartials` | `any \| null` | No | IaC resource address → partial name for this environment. '\*' is the whole-project owner. Used so omit=delete only applies to resources this file already owns. |
| `id` | `string \| null` | No | — |
| `isEphemeral` | `boolean \| null` | No | — |
| `meta` | `object \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `sourceEnvironment` | `object \| null` | No | — |
| `sourceEnvironmentName` | `string \| null` | No | Name of the environment this one was copied from. A project token can read this on its own environment. It does not grant access to the source environment. |
| `unmergedChangesCount` | `number \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] clearanceServiceCounts full type
>
> ```ts theme={null}
> {
>   inheriting?: number | null,
>   off?: number | null,
>   on?: number | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   baseBranch?: string | null,
>   branch?: string | null,
>   latestSuccessfulGitHubDeploymentId?: number | null,
>   prCommentId?: number | null,
>   prNumber?: number | null,
>   prRepo?: string | null,
>   prTitle?: string | null,
>   skippedResourceIds?: any | null
> } | null
> ```

> [accordion] sourceEnvironment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

***

### stageChanges

`environments.stageChanges`

Sets the staged patch for a single environment

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.environments.stageChanges({
	environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `input` | `object \| any[] \| string \| number \| boolean` | Yes | — |
| `merge` | `boolean` | No | Merge the input patch into the existing staged patch. |

> [accordion] input full type
>
> ```ts theme={null}
> {
> } | any[] | string | number | boolean
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `appliedAt` | `string \| null` | No | — |
| `appliedBy` | `object \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `environment` | `object \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `lastAppliedError` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |
| `patch` | `any \| null` | No | — |
| `status` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `variablesRedacted` | `boolean \| null` | No | True when this patch is served from the long-term archive: variable names are kept, values are not. |

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

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

***

### stagedChanges

`environments.stagedChanges`

Get the latest staged commit for a single environment

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.environments.stagedChanges({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `appliedAt` | `string \| null` | No | — |
| `appliedBy` | `object \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `environment` | `object \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `lastAppliedError` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |
| `patch` | `any \| null` | No | — |
| `status` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `variablesRedacted` | `boolean \| null` | No | True when this patch is served from the long-term archive: variable names are kept, values are not. |

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

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

***

### triggerDeploys

`environments.triggerDeploys`

Deploys all connected triggers for an environment

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.environments.triggerDeploys({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   projectId: string,
>   serviceId: string
> }
> ```

**Output:** `boolean`

***

### unskipService

`environments.unskipService`

Deploy a service that was skipped when its environment was created, along with its skipped transitive dependencies

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.environments.unskipService({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `boolean`

***

### updateClearanceDefault

`environments.updateClearanceDefault`

Sets whether Railway Authentication protects an environment's services that have no setting of their own, and pushes it to them. Requires a workspace admin; turning it on also requires the workspace's Railway Authentication entitlement. Services with edge caching on that it protects have their caching turned off

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.environments.updateClearanceDefault({
	input: { enabled: true, environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   enabled: boolean,
>   environmentId: string,
>   projectId: string
> }
> ```

**Output:** `boolean`

***

### upsertConfigPlanComment

`environments.upsertConfigPlanComment`

Posts or updates a `railway config plan` comment on a GitHub pull request under the Railway app identity. The caller proves it runs in the target repo with a GitHub Actions OIDC token; the comment body is composed server-side from the structured plan

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.environments.upsertConfigPlanComment({
	input: {
		environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
		githubOidcToken: 'example',
		plan: 'example',
		prNumber: 1,
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   githubOidcToken: string,
>   plan: any,
>   prNumber: number
> }
> ```

**Output**

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

***

## Events

### list

`events.list`

Gets the events for a project, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.events.list({ projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `environmentId` | `string` | No | — |
| `filter` | `object` | No | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |
| `projectId` | `string` | Yes | — |

> [accordion] filter full type
>
> ```ts theme={null}
> {
>   action?: {
>     in?: string[],
>     notIn?: string[]
>   },
>   object?: {
>     in?: string[],
>     notIn?: string[]
>   },
>   serviceId?: {
>     in?: string[],
>     notIn?: string[]
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   action?: string | null,
>   activityPayload?: any | null,
>   createdAt?: string | null,
>   environment?: {
>     canAccess?: boolean | null,
>     canvasGroupRefs?: any | null,
>     clearanceCachingTurnedOff?: string[] | null,
>     clearanceDefault?: boolean | null,
>     clearanceDefaultUpdatedAt?: string | null,
>     clearancePropagatedAt?: string | null,
>     clearancePropagationError?: string | null,
>     config?: any | null,
>     configEtag?: string | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     iacPartials?: any | null,
>     id?: string | null,
>     isEphemeral?: boolean | null,
>     name?: string | null,
>     projectId?: string | null,
>     sourceEnvironmentName?: string | null,
>     unmergedChangesCount?: number | null,
>     updatedAt?: string | null
>   } | null,
>   environmentId?: string | null,
>   id?: string | null,
>   object?: string | null,
>   payload?: any | null,
>   project?: {
>     baseEnvironmentId?: string | null,
>     botPrEnvironments?: boolean | null,
>     clearanceDefaultForNewEnvironments?: boolean | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     description?: string | null,
>     expiredAt?: string | null,
>     featureFlags?: string[] | null,
>     focusedPrEnvironments?: boolean | null,
>     id?: string | null,
>     isPublic?: boolean | null,
>     isTempProject?: boolean | null,
>     name?: string | null,
>     prDeploys?: boolean | null,
>     primaryEnvironmentId?: string | null,
>     subscriptionPlanLimit?: any | null,
>     subscriptionType?: string | null,
>     updatedAt?: string | null,
>     viewerRole?: string | null,
>     workspaceId?: string | null
>   } | null,
>   projectId?: string | null,
>   severity?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

## Feature Flags

### add

`featureFlags.add`

Add a feature flag for a user

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.featureFlags.add({
	input: { flag: 'AGENT_BYOK' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   flag: AGENT_BYOK | AGENT_BYOK_FIREWORKS | AGENT_FORK_TASKS | CHAT_SANDBOX | CLEARANCE | CLOUD_AGENTS | CLOUD_AGENT_BUILDER | CLOUD_AGENT_CHAT | CLOUD_AGENT_ROOTFS_SIZE | CONNECTOR_TUNNELS | CS_MCP_EXPRESS | DATABASE_AGENT_TOOLS | HA_FOR_MONGO | IN_DASHBOARD_SUPPORT | MAGIC_CONFIG | MANAGED_DATABASE_EDIT_WARNING | MANAGED_DATABASE_SETUP | PRIORITY_BOARDING | RAILQL | RAILWAY_AGENT_DASHBOARD | RAILWAY_AUTOMATIONS | TRACING | VERIFIERS | VM_STORAGE_TRACES
> }
> ```

**Output:** `boolean`

***

### listPlatform

`featureFlags.listPlatform`

Returns the platform feature flags enabled for the current user

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.featureFlags.listPlatform({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   flag?: string | null,
>   rolloutPercentage?: number | null,
>   status?: boolean | null,
>   type?: string | null
> }[]
> ```

***

### remove

`featureFlags.remove`

Remove a feature flag for a user

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.featureFlags.remove({
	input: { flag: 'AGENT_BYOK' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   flag: AGENT_BYOK | AGENT_BYOK_FIREWORKS | AGENT_FORK_TASKS | CHAT_SANDBOX | CLEARANCE | CLOUD_AGENTS | CLOUD_AGENT_BUILDER | CLOUD_AGENT_CHAT | CLOUD_AGENT_ROOTFS_SIZE | CONNECTOR_TUNNELS | CS_MCP_EXPRESS | DATABASE_AGENT_TOOLS | HA_FOR_MONGO | IN_DASHBOARD_SUPPORT | MAGIC_CONFIG | MANAGED_DATABASE_EDIT_WARNING | MANAGED_DATABASE_SETUP | PRIORITY_BOARDING | RAILQL | RAILWAY_AGENT_DASHBOARD | RAILWAY_AUTOMATIONS | TRACING | VERIFIERS | VM_STORAGE_TRACES
> }
> ```

**Output:** `boolean`

***

## Function Runtimes

### get

`functionRuntimes.get`

Get information about a specific function runtime

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.functionRuntimes.get({ name: 'bun' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `bun` | Yes | Supported function runtime environments |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `image` | `string \| null` | No | The image of the function runtime |
| `latestVersion` | `object \| null` | No | — |
| `name` | `string \| null` | No | Supported function runtime environments |
| `versions` | `object[] \| null` | No | The versions of the function runtime |

> [accordion] latestVersion full type
>
> ```ts theme={null}
> {
>   image?: string | null,
>   tag?: string | null
> } | null
> ```

> [accordion] versions full type
>
> ```ts theme={null}
> {
>   image?: string | null,
>   tag?: string | null
> }[] | null
> ```

***

### list

`functionRuntimes.list`

List available function runtimes

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.functionRuntimes.list({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   image?: string | null,
>   latestVersion?: {
>     image?: string | null,
>     tag?: string | null
>   } | null,
>   name?: string | null,
>   versions?: {
>     image?: string | null,
>     tag?: string | null
>   }[] | null
> }[]
> ```

***

## Github

### prInfo

`github.prInfo`

Get info for a GitHub pull request

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.github.prInfo({ prNumber: 1, serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `prNumber` | `number` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `additions` | `number \| null` | No | — |
| `author` | `string \| null` | No | — |
| `body` | `string \| null` | No | — |
| `changedFiles` | `number \| null` | No | — |
| `checks` | `object[] \| null` | No | — |
| `deletions` | `number \| null` | No | — |
| `mergeable` | `boolean \| null` | No | — |
| `state` | `string \| null` | No | — |
| `title` | `string \| null` | No | — |

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

***

### prInfoResult

`github.prInfoResult`

Get info for a GitHub pull request, including fetch errors

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.github.prInfoResult({ prNumber: 1, serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `prNumber` | `number` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `error` | `string \| null` | No | — |
| `prInfo` | `object \| null` | No | — |

> [accordion] prInfo full type
>
> ```ts theme={null}
> {
>   additions?: number | null,
>   author?: string | null,
>   body?: string | null,
>   changedFiles?: number | null,
>   deletions?: number | null,
>   mergeable?: boolean | null,
>   state?: string | null,
>   title?: string | null
> } | null
> ```

***

### repoAccessAvailable

`github.repoAccessAvailable`

Checks if user has access to GitHub repository

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.github.repoAccessAvailable({ fullRepoName: 'example' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `hasAccess` | `boolean \| null` | No | — |
| `isPublic` | `boolean \| null` | No | — |

***

### repos.branches

`github.repos.branches`

Get branches for a GitHub repo that the authenticated user has access to

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.github.repos.branches({ owner: 'example', repo: 'acme/api' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `owner` | `string` | Yes | — |
| `repo` | `string` | Yes | — |

**Output:** `object[]`

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

***

### repos.deploy

`github.repos.deploy`

Deploys a GitHub repo

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.github.repos.deploy({
	input: { projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', repo: 'acme/api' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   branch?: string,
>   environmentId?: string,
>   projectId: string,
>   repo: string
> }
> ```

**Output:** `string`

***

### repos.get

`github.repos.get`

Checks if user has access to GitHub repository

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.github.repos.get({ fullRepoName: 'example' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `defaultBranch` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `fullName` | `string \| null` | No | — |
| `id` | `number \| null` | No | — |
| `isPrivate` | `boolean \| null` | No | — |
| `name` | `string \| null` | No | — |

***

### repos.isNameAvailable

`github.repos.isNameAvailable`

Check if a repo name is available

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.github.repos.isNameAvailable({ fullRepoName: 'example' });
```

**Input**

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

**Output:** `boolean`

***

### repos.list

`github.repos.list`

Get a list of repos for a user that Railway has access to

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.github.repos.list({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   defaultBranch?: string | null,
>   description?: string | null,
>   fullName?: string | null,
>   id?: number | null,
>   installationId?: string | null,
>   isPrivate?: boolean | null,
>   name?: string | null,
>   ownerAvatarUrl?: string | null
> }[]
> ```

***

### repos.update

`github.repos.update`

Updates a GitHub repo through the linked template

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.github.repos.update({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   projectId: string,
>   serviceId: string
> }
> ```

**Output:** `boolean`

***

### sshKeys

`github.sshKeys`

Gets SSH public keys from the authenticated user's GitHub account

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.github.sshKeys({});
```

**Input:** *empty object*

**Output:** `object[]`

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

***

### writableScopes

`github.writableScopes`

Get a list of scopes the user has installed the installation to

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.github.writableScopes({});
```

**Input:** *empty object*

**Output:** `string[]`

***

## Http Logs

### list

`httpLogs.list`

Fetch HTTP logs for a deployment

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.httpLogs.list({ deploymentId: '00000005-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `afterDate` | `string` | No | Latest date to look for logs after the anchor |
| `afterLimit` | `number` | No | Limit the number of logs returned after the anchor |
| `anchorDate` | `string` | No | Target date time to look for logs |
| `beforeDate` | `string` | No | Oldest date to look for logs before the anchor |
| `beforeLimit` | `number` | No | Limit the number of logs returned before the anchor |
| `deploymentId` | `string` | Yes | — |
| `filter` | `string` | No | Filter logs using a query syntax |
| `limit` | `number` | No | Limit the number of logs returned (defaults 100, max 5000) |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   clientUa?: string | null,
>   deploymentId?: string | null,
>   deploymentInstanceId?: string | null,
>   downstreamProto?: string | null,
>   edgeRegion?: string | null,
>   host?: string | null,
>   httpStatus?: number | null,
>   method?: string | null,
>   path?: string | null,
>   requestId?: string | null,
>   responseDetails?: string | null,
>   rxBytes?: number | null,
>   srcIp?: string | null,
>   timestamp?: string | null,
>   totalDuration?: number | null,
>   txBytes?: number | null,
>   upstreamAddress?: string | null,
>   upstreamErrors?: string | null,
>   upstreamProto?: string | null,
>   upstreamRqDuration?: number | null
> }[]
> ```

***

## Http Metrics

### duration

`httpMetrics.duration`

Get HTTP request duration metrics for a service (avg, p50, p90, p95, p99)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.httpMetrics.duration({
	endDate: '2026-04-09T10:00:00Z',
	environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
	serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17',
	startDate: '2026-04-09T10:00:00Z',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `endDate` | `string` | Yes | The end of the period to get metrics for. |
| `environmentId` | `string` | Yes | — |
| `method` | `string` | No | Filter by HTTP method (e.g., GET, POST) |
| `path` | `string` | No | Filter by request path |
| `serviceId` | `string` | Yes | — |
| `startDate` | `string` | Yes | The start of the period to get metrics for. |
| `statusCode` | `number` | No | Filter by HTTP status code (e.g., 200, 404, 500) |
| `stepSeconds` | `number` | No | The frequency of data points in the response. If the `stepSeconds` is 60, then the response will contain one data point per minute. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `samples` | `object[] \| null` | No | The samples of HTTP duration metrics. |

> [accordion] samples full type
>
> ```ts theme={null}
> {
>   p50?: number | null,
>   p90?: number | null,
>   p95?: number | null,
>   p99?: number | null,
>   ts?: number | null
> }[] | null
> ```

***

### get

`httpMetrics.get`

Get HTTP request metrics for a service

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.httpMetrics.get({
	endDate: '2026-04-09T10:00:00Z',
	environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
	serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17',
	startDate: '2026-04-09T10:00:00Z',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `endDate` | `string` | Yes | The end of the period to get metrics for. |
| `environmentId` | `string` | Yes | — |
| `method` | `string` | No | Filter by HTTP method (e.g., GET, POST) |
| `path` | `string` | No | Filter by request path |
| `serviceId` | `string` | Yes | — |
| `startDate` | `string` | Yes | The start of the period to get metrics for. |
| `statusCode` | `number` | No | Filter by HTTP status code (e.g., 200, 404, 500) |
| `stepSeconds` | `number` | No | The frequency of data points in the response. If the `stepSeconds` is 60, then the response will contain one data point per minute. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `samples` | `object[] \| null` | No | The samples of HTTP metrics. |

> [accordion] samples full type
>
> ```ts theme={null}
> {
>   ts?: number | null,
>   value?: number | null
> }[] | null
> ```

***

### groupedByStatus

`httpMetrics.groupedByStatus`

Get HTTP request metrics for a service, grouped by status code

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.httpMetrics.groupedByStatus({
	endDate: '2026-04-09T10:00:00Z',
	environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
	serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17',
	startDate: '2026-04-09T10:00:00Z',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `endDate` | `string` | Yes | The end of the period to get metrics for. |
| `environmentId` | `string` | Yes | — |
| `method` | `string` | No | Filter by HTTP method (e.g., GET, POST) |
| `path` | `string` | No | Filter by request path |
| `serviceId` | `string` | Yes | — |
| `startDate` | `string` | Yes | The start of the period to get metrics for. |
| `stepSeconds` | `number` | No | The frequency of data points in the response. If the `stepSeconds` is 60, then the response will contain one data point per minute. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   samples?: {
>     ts?: number | null,
>     value?: number | null
>   }[] | null,
>   statusCode?: number | null
> }[]
> ```

***

## Invite Codes

### get

`inviteCodes.get`

Get an invite code by the code

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.inviteCodes.get({ code: 'postgres' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `expiresAt` | `string \| null` | No | When this invite link expires. |
| `id` | `string \| null` | No | — |
| `isExpired` | `boolean \| null` | No | — |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

***

### use

`inviteCodes.use`

Join a project using an invite code

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.inviteCodes.use({ code: 'postgres' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseEnvironment` | `object \| null` | No | — |
| `baseEnvironmentId` | `string \| null` | No | — |
| `botPrEnvironments` | `boolean \| null` | No | — |
| `clearanceDefaultForNewEnvironments` | `boolean \| null` | No | Whether environments created from now on start with Railway Authentication protecting services that have no setting of their own. Existing environments keep their own default. |
| `clearanceTokens` | `object[] \| null` | No | The project's Railway Authentication tokens that still work (not revoked, not expired), newest first. |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `expiredAt` | `string \| null` | No | — |
| `featureFlags` | `string[] \| null` | No | — |
| `focusedPrEnvironments` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isPublic` | `boolean \| null` | No | — |
| `isTempProject` | `boolean \| null` | No | — |
| `members` | `object[] \| null` | No | — |
| `name` | `string \| null` | No | — |
| `prDeploys` | `boolean \| null` | No | — |
| `primaryEnvironmentId` | `string \| null` | No | The id of the oldest non-ephemeral environment for this project (typically production). Used by the dashboard to render project cards without fetching the full environments connection. |
| `subscriptionPlanLimit` | `any \| null` | No | — |
| `subscriptionType` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `viewerRole` | `string \| null` | No | — |
| `workspace` | `object \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] baseEnvironment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] clearanceTokens full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   environmentId?: string | null,
>   environmentName?: string | null,
>   expiresAt?: string | null,
>   id?: string | null,
>   name?: string | null
> }[] | null
> ```

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

> [accordion] workspace full type
>
> ```ts theme={null}
> {
>   adoptionLevel?: number | null,
>   avatar?: string | null,
>   createdAt?: string | null,
>   discordRole?: string | null,
>   has2FAEnforcement?: boolean | null,
>   hasAutomaticDiagnosis?: boolean | null,
>   hasGuardrailsAccess?: boolean | null,
>   hasHipaaBAA?: boolean | null,
>   hasSAML?: boolean | null,
>   id?: string | null,
>   name?: string | null,
>   plan?: string | null,
>   preferredRegion?: string | null,
>   projectCount?: number | null,
>   redactedDueTo2FAPending?: boolean | null,
>   restrictProjectVisibilityToGroups?: boolean | null,
>   slackChannelId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   updatedAt?: string | null,
>   usersWithout2FA?: string[] | null
> } | null
> ```

***

## Me

### get

`me.get`

Get the user the token belongs to, with their workspaces

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.me.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agreedFairUse` | `boolean \| null` | No | — |
| `apiTokenRateLimit` | `object \| null` | No | — |
| `avatar` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `featureFlags` | `string[] \| null` | No | — |
| `githubProviderId` | `string \| null` | No | — |
| `githubUsername` | `string \| null` | No | — |
| `has2FA` | `boolean \| null` | No | — |
| `hasPasskeys` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isAdmin` | `boolean \| null` | No | — |
| `isConductor` | `boolean \| null` | No | — |
| `isVerified` | `boolean \| null` | No | — |
| `lastLogin` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `profile` | `object \| null` | No | — |
| `registrationStatus` | `string \| null` | No | — |
| `riskLevel` | `number \| null` | No | — |
| `termsAgreedOn` | `string \| null` | No | — |
| `username` | `string \| null` | No | — |
| `workspaces` | `object[] \| null` | No | Workspaces user is member of |

> [accordion] apiTokenRateLimit full type
>
> ```ts theme={null}
> {
>   remainingPoints?: number | null,
>   resetsAt?: string | null
> } | null
> ```

> [accordion] profile full type
>
> ```ts theme={null}
> {
>   bio?: string | null,
>   isPublic?: boolean | null,
>   website?: string | null
> } | null
> ```

> [accordion] workspaces full type
>
> ```ts theme={null}
> {
>   adoptionLevel?: number | null,
>   avatar?: string | null,
>   createdAt?: string | null,
>   discordRole?: string | null,
>   has2FAEnforcement?: boolean | null,
>   hasAutomaticDiagnosis?: boolean | null,
>   hasGuardrailsAccess?: boolean | null,
>   hasHipaaBAA?: boolean | null,
>   hasSAML?: boolean | null,
>   id?: string | null,
>   name?: string | null,
>   plan?: string | null,
>   preferredRegion?: string | null,
>   projectCount?: number | null,
>   redactedDueTo2FAPending?: boolean | null,
>   restrictProjectVisibilityToGroups?: boolean | null,
>   slackChannelId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   updatedAt?: string | null,
>   usersWithout2FA?: string[] | null
> }[] | null
> ```

***

## Metrics

### get

`metrics.get`

Get metrics for a project, environment, and service

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.metrics.get({
	measurements: ['AGENT_CACHE_READ_TOKENS'],
	startDate: '2026-04-09T10:00:00Z',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `averagingWindowSeconds` | `number` | No | The averaging window when computing CPU usage. By default, it is the same as the `sampleRateSeconds`. |
| `endDate` | `string` | No | The end of the period to get metrics for. If not provided, the current datetime is used. |
| `environmentId` | `string` | No | — |
| `groupBy` | `(BILLABLE \| DEPLOYMENT_ID \| DEPLOYMENT_INSTANCE_ID \| ENVIRONMENT_ID \| FEATURE \| HOST_TYPE \| KEY_UNSPECIFIED \| MODEL \| PLUGIN_ID \| PROJECT_ID \| REGION \| SERVICE_ID \| UNRECOGNIZED \| VM_ID \| VOLUME_ID \| VOLUME_INSTANCE_ID \| WORKLOAD_KIND)[]` | No | What to group the aggregated usage by. By default, it is grouped over the entire project. |
| `includeDeleted` | `boolean` | No | Whether or not to include deleted projects in the results |
| `measurements` | `(AGENT_CACHE_READ_TOKENS \| AGENT_CACHE_WRITE_TOKENS \| AGENT_INPUT_TOKENS \| AGENT_OUTPUT_TOKENS \| AGENT_SPEND_USD \| BACKUP_USAGE_GB \| CPU_LIMIT \| CPU_USAGE \| CPU_USAGE_2 \| DISK_USAGE_GB \| EPHEMERAL_DISK_USAGE_GB \| MEASUREMENT_UNSPECIFIED \| MEMORY_LIMIT_GB \| MEMORY_USAGE_GB \| NETWORK_RX_GB \| NETWORK_TX_GB \| UNRECOGNIZED)[]` | Yes | — |
| `projectId` | `string` | No | — |
| `sampleRateSeconds` | `number` | No | The frequency of data points in the response. If the `sampleRateSeconds` is 60, then the response will contain one data point per minute. |
| `serviceId` | `string` | No | — |
| `startDate` | `string` | Yes | The start of the period to get metrics for. |
| `volumeId` | `string` | No | — |
| `volumeInstanceExternalId` | `string` | No | — |
| `workspaceId` | `string` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   measurement?: string | null,
>   tags?: {
>     deploymentId?: string | null,
>     deploymentInstanceId?: string | null,
>     environmentId?: string | null,
>     projectId?: string | null,
>     region?: string | null,
>     serviceId?: string | null,
>     volumeId?: string | null,
>     volumeInstanceId?: string | null
>   } | null,
>   values?: {
>     ts?: number | null,
>     value?: number | null
>   }[] | null
> }[]
> ```

***

## Network Flow Logs

### list

`networkFlowLogs.list`

Fetch individual network flow logs for an environment

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.networkFlowLogs.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `afterDate` | `string` | No | Latest date to look for logs after the anchor |
| `afterLimit` | `number` | No | Limit logs returned after the anchor |
| `anchorDate` | `string` | No | Target date time to look for logs |
| `beforeDate` | `string` | No | Oldest date to look for logs before the anchor |
| `beforeLimit` | `number` | No | Limit logs returned before the anchor |
| `deploymentInstanceId` | `string` | No | Filter by deployment instance / sandbox ID (optional) |
| `environmentId` | `string` | Yes | — |
| `filter` | `string` | No | Filter expression (e.g., @protocol:tcp @direction:egress @dropped:true) |
| `serviceId` | `string` | No | Filter by service ID (optional) |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   byteCount?: number | null,
>   captureEnd?: string | null,
>   captureStart?: string | null,
>   deploymentId?: string | null,
>   deploymentInstanceId?: string | null,
>   direction?: string | null,
>   dropCause?: string | null,
>   dstAddr?: string | null,
>   dstPort?: number | null,
>   flowId?: string | null,
>   flowState?: string | null,
>   l4LatencyMs?: number | null,
>   l4Protocol?: string | null,
>   packetCount?: number | null,
>   peerKind?: string | null,
>   peerServiceId?: string | null,
>   serviceId?: string | null,
>   srcAddr?: string | null,
>   srcPort?: number | null
> }[]
> ```

***

## Notification Deliveries

### get

`notificationDeliveries.get`

Gets a notification delivery by ID for the authenticated user

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.notificationDeliveries.get({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `notificationInstance` | `object \| null` | No | — |
| `readAt` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `userId` | `string \| null` | No | — |

> [accordion] notificationInstance full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   environmentId?: string | null,
>   eventId?: string | null,
>   eventType?: string | null,
>   id?: string | null,
>   payload?: any | null,
>   projectId?: string | null,
>   resolvedAt?: string | null,
>   resourceId?: string | null,
>   resourceType?: string | null,
>   serviceId?: string | null,
>   severity?: string | null,
>   status?: string | null,
>   updatedAt?: string | null,
>   volumeId?: string | null,
>   workspaceId?: string | null
> } | null
> ```

***

### list

`notificationDeliveries.list`

Gets notification deliveries for the authenticated user, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.notificationDeliveries.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `filter` | `object` | No | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |

> [accordion] filter full type
>
> ```ts theme={null}
> {
>   environmentId?: string,
>   onlyUnread?: boolean,
>   projectId?: string,
>   status?: ACTIVE | RESOLVED,
>   type?: EMAIL | INAPP | WEBHOOK,
>   workspaceId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   id?: string | null,
>   notificationInstance?: {
>     createdAt?: string | null,
>     environmentId?: string | null,
>     eventId?: string | null,
>     eventType?: string | null,
>     id?: string | null,
>     payload?: any | null,
>     projectId?: string | null,
>     resolvedAt?: string | null,
>     resourceId?: string | null,
>     resourceType?: string | null,
>     serviceId?: string | null,
>     severity?: string | null,
>     status?: string | null,
>     updatedAt?: string | null,
>     volumeId?: string | null,
>     workspaceId?: string | null
>   } | null,
>   readAt?: string | null,
>   status?: string | null,
>   type?: string | null,
>   updatedAt?: string | null,
>   userId?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### markAsRead

`notificationDeliveries.markAsRead`

Marks notification deliveries as read

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.notificationDeliveries.markAsRead({
	deliveryIds: ['example'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `deliveryIds` | `string[]` | Yes | — |

**Output:** `boolean`

***

## Notification Rules

### create

`notificationRules.create`

Create a new notification rule

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.notificationRules.create({
	input: {
		channelConfigs: ['example'],
		eventTypes: ['example'],
		workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   channelConfigs: any[],
>   ephemeralEnvironments?: boolean,
>   eventTypes: string[],
>   projectId?: string,
>   severities?: (CRITICAL | INFO | NOTICE | WARNING)[],
>   workspaceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `channels` | `object[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `ephemeralEnvironments` | `boolean \| null` | No | — |
| `eventTypes` | `string[] \| null` | No | — |
| `id` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `serviceId` | `string \| null` | No | — |
| `severities` | `string[] \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] channels full type
>
> ```ts theme={null}
> {
>   config?: any | null,
>   createdAt?: string | null,
>   id?: string | null,
>   updatedAt?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

***

### delete

`notificationRules.delete`

Delete a notification rule

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

```ts theme={null}
await corsair.railway.api.notificationRules.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### list

`notificationRules.list`

Get all notification rules for a workspace and project

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.notificationRules.list({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | No | — |
| `workspaceId` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   channels?: {
>     config?: any | null,
>     createdAt?: string | null,
>     id?: string | null,
>     updatedAt?: string | null,
>     workspaceId?: string | null
>   }[] | null,
>   createdAt?: string | null,
>   environmentId?: string | null,
>   ephemeralEnvironments?: boolean | null,
>   eventTypes?: string[] | null,
>   id?: string | null,
>   projectId?: string | null,
>   serviceId?: string | null,
>   severities?: string[] | null,
>   updatedAt?: string | null,
>   workspaceId?: string | null
> }[]
> ```

***

### update

`notificationRules.update`

Update a notification rule

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.notificationRules.update({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   channelConfigs?: any[],
>   ephemeralEnvironments?: boolean,
>   eventTypes?: string[],
>   severities?: (CRITICAL | INFO | NOTICE | WARNING)[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `channels` | `object[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `ephemeralEnvironments` | `boolean \| null` | No | — |
| `eventTypes` | `string[] \| null` | No | — |
| `id` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `serviceId` | `string \| null` | No | — |
| `severities` | `string[] \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] channels full type
>
> ```ts theme={null}
> {
>   config?: any | null,
>   createdAt?: string | null,
>   id?: string | null,
>   updatedAt?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

***

### upsertSlackChannel

`notificationRules.upsertSlackChannel`

Generate a Slack channel for a workspace

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.notificationRules.upsertSlackChannel({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

## Observability Dashboard Monitors

### create

`observabilityDashboardMonitors.create`

Create an observability monitor for a dashboard item

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.observabilityDashboardMonitors.create({
	dashboardItemId: 'example',
	input: {
		config: { type: 'threshold' },
	},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `dashboardItemId` | `string` | Yes | — |
| `input` | `object` | Yes | — |

> [accordion] input full type
>
> ```ts theme={null}
> {
>   config: {
>     threshold?: {
>       condition: above | below,
>       threshold: number
>     },
>     type: threshold
>   }
> }
> ```

**Output:** `boolean`

***

### remove

`observabilityDashboardMonitors.remove`

Remove an observability monitor from a dashboard item

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.observabilityDashboardMonitors.remove({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### update

`observabilityDashboardMonitors.update`

Update an observability monitor for a dashboard item

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.observabilityDashboardMonitors.update({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {
		config: { type: 'threshold' },
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   config: {
>     threshold?: {
>       condition: above | below,
>       threshold: number
>     },
>     type: threshold
>   }
> }
> ```

**Output:** `boolean`

***

## Observability Dashboards

### create

`observabilityDashboards.create`

Create an observability dashboard

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.observabilityDashboards.create({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   items?: {
>     dashboardItem: {
>       config: {
>         httpMetric?: LATENCY | REQUESTS | STATUS_RATIO,
>         logsFilter?: string,
>         measurements?: (AGENT_CACHE_READ_TOKENS | AGENT_CACHE_WRITE_TOKENS | AGENT_INPUT_TOKENS | AGENT_OUTPUT_TOKENS | AGENT_SPEND_USD | BACKUP_USAGE_GB | CPU_LIMIT | CPU_USAGE | CPU_USAGE_2 | DISK_USAGE_GB | EPHEMERAL_DISK_USAGE_GB | MEASUREMENT_UNSPECIFIED | MEMORY_LIMIT_GB | MEMORY_USAGE_GB | NETWORK_RX_GB | NETWORK_TX_GB | UNRECOGNIZED)[],
>         projectUsageProperties?: (BACKUP_USAGE | CPU_USAGE | CURRENT_USAGE | DISK_USAGE | ESTIMATED_USAGE | MEMORY_USAGE | NETWORK_USAGE)[],
>         query?: string,
>         resourceIds?: string[],
>         visualization?: string
>       },
>       description?: string,
>       id: string,
>       name: string,
>       type: DNS_LOGS_ITEM | HTTP_LOGS_ITEM | HTTP_METRICS_ITEM | NETWORK_LOGS_ITEM | PROJECT_USAGE_ITEM | RAILQL_ITEM | SERVICE_LOGS_ITEM | SERVICE_METRICS_ITEM | VOLUME_METRICS_ITEM
>     },
>     displayConfig: any,
>     id: string
>   }[]
> }
> ```

**Output:** `boolean`

***

### list

`observabilityDashboards.list`

Get all observability dashboards for an environment, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.observabilityDashboards.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `environmentId` | `string` | Yes | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

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

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### reset

`observabilityDashboards.reset`

Reset an observability dashboard to default dashboard items

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.observabilityDashboards.reset({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### update

`observabilityDashboards.update`

Update an observability dashboard

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.observabilityDashboards.update({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: [{
		dashboardItem: {
			config: {},
			id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
			name: 'api',
			type: 'DNS_LOGS_ITEM',
		},
		displayConfig: 'example',
		id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	}],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `input` | `object[]` | Yes | — |
| `revision` | `string` | No | The dashboard's revision when it was read. Given, a save based on an older one is refused with DASHBOARD\_CHANGED. |

> [accordion] input full type
>
> ```ts theme={null}
> {
>   dashboardItem: {
>     config: {
>       httpMetric?: LATENCY | REQUESTS | STATUS_RATIO,
>       logsFilter?: string,
>       measurements?: (AGENT_CACHE_READ_TOKENS | AGENT_CACHE_WRITE_TOKENS | AGENT_INPUT_TOKENS | AGENT_OUTPUT_TOKENS | AGENT_SPEND_USD | BACKUP_USAGE_GB | CPU_LIMIT | CPU_USAGE | CPU_USAGE_2 | DISK_USAGE_GB | EPHEMERAL_DISK_USAGE_GB | MEASUREMENT_UNSPECIFIED | MEMORY_LIMIT_GB | MEMORY_USAGE_GB | NETWORK_RX_GB | NETWORK_TX_GB | UNRECOGNIZED)[],
>       projectUsageProperties?: (BACKUP_USAGE | CPU_USAGE | CURRENT_USAGE | DISK_USAGE | ESTIMATED_USAGE | MEMORY_USAGE | NETWORK_USAGE)[],
>       query?: string,
>       resourceIds?: string[],
>       visualization?: string
>     },
>     description?: string,
>     id: string,
>     name: string,
>     type: DNS_LOGS_ITEM | HTTP_LOGS_ITEM | HTTP_METRICS_ITEM | NETWORK_LOGS_ITEM | PROJECT_USAGE_ITEM | RAILQL_ITEM | SERVICE_LOGS_ITEM | SERVICE_METRICS_ITEM | VOLUME_METRICS_ITEM
>   },
>   displayConfig: any,
>   id: string
> }[]
> ```

**Output:** `boolean`

***

## Passkeys

### list

`passkeys.list`

Gets all passkeys for the authenticated user, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.passkeys.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   aaguid?: string | null,
>   backedUp?: boolean | null,
>   createdAt?: string | null,
>   credentialId?: string | null,
>   deviceName?: string | null,
>   deviceType?: string | null,
>   displayName?: string | null,
>   id?: string | null,
>   lastUsedAt?: string | null,
>   lastUsedDevice?: string | null,
>   transports?: string[] | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

## Platform

### stats

`platform.stats`

Get public Railway stats

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.platform.stats({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `totalDeploymentsLastMonth` | `number \| null` | No | — |
| `totalLogsLastMonth` | `number \| string \| null` | No | — |
| `totalProjects` | `number \| null` | No | — |
| `totalRequestsLastMonth` | `number \| string \| null` | No | — |
| `totalServices` | `number \| null` | No | — |
| `totalUsers` | `number \| null` | No | — |

***

### status

`platform.status`

Get the current status of the platform

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.platform.status({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `incident` | `object \| null` | No | — |
| `isStable` | `boolean \| null` | No | — |
| `maintenance` | `object \| null` | No | — |

> [accordion] incident full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   id?: string | null,
>   message?: string | null,
>   status?: string | null,
>   url?: string | null
> } | null
> ```

> [accordion] maintenance full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   message?: string | null,
>   start?: string | null,
>   status?: string | null,
>   url?: string | null
> } | null
> ```

***

## Preferences

### get

`preferences.get`

Get the email preferences for a user

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.preferences.get({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `buildFailedEmail` | `boolean \| null` | No | — |
| `changelogEmail` | `boolean \| null` | No | — |
| `communityEmail` | `boolean \| null` | No | — |
| `deployCrashedEmail` | `boolean \| null` | No | — |
| `ephemeralEnvironmentEmail` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `marketingEmail` | `boolean \| null` | No | — |
| `subprocessorUpdatesEmail` | `boolean \| null` | No | — |
| `templateQueueEmail` | `boolean \| null` | No | — |
| `usageEmail` | `boolean \| null` | No | — |

***

### update

`preferences.update`

Update the email preferences for a user

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.preferences.update({
	input: {},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   buildFailedEmail?: boolean,
>   changelogEmail?: boolean,
>   communityEmail?: boolean,
>   deployCrashedEmail?: boolean,
>   ephemeralEnvironmentEmail?: boolean,
>   marketingEmail?: boolean,
>   subprocessorUpdatesEmail?: boolean,
>   templateQueueEmail?: boolean,
>   token?: string,
>   usageEmail?: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `buildFailedEmail` | `boolean \| null` | No | — |
| `changelogEmail` | `boolean \| null` | No | — |
| `communityEmail` | `boolean \| null` | No | — |
| `deployCrashedEmail` | `boolean \| null` | No | — |
| `ephemeralEnvironmentEmail` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `marketingEmail` | `boolean \| null` | No | — |
| `subprocessorUpdatesEmail` | `boolean \| null` | No | — |
| `templateQueueEmail` | `boolean \| null` | No | — |
| `usageEmail` | `boolean \| null` | No | — |

***

## Private Network Endpoints

### get

`privateNetworkEndpoints.get`

Get a private network endpoint for a service instance

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.privateNetworkEndpoints.get({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', privateNetworkId: 'example', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `privateNetworkId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `dnsName` | `string \| null` | No | — |
| `newDnsName` | `string \| null` | No | — |
| `privateIps` | `string[] \| null` | No | — |
| `publicId` | `string \| null` | No | — |
| `serviceInstanceId` | `string \| null` | No | — |
| `syncStatus` | `string \| null` | No | — |
| `tags` | `string[] \| null` | No | — |

***

### isNameAvailable

`privateNetworkEndpoints.isNameAvailable`

Check if an endpoint name is available

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.privateNetworkEndpoints.isNameAvailable({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', prefix: 'example', privateNetworkId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `prefix` | `string` | Yes | — |
| `privateNetworkId` | `string` | Yes | — |

**Output:** `boolean`

***

### rename

`privateNetworkEndpoints.rename`

Rename a private network endpoint

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.privateNetworkEndpoints.rename({ dnsName: 'example', id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17', privateNetworkId: 'example' });
```

**Input**

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

**Output:** `boolean`

***

## Private Networks

### list

`privateNetworks.list`

List private networks for an environment

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.privateNetworks.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   dnsName?: string | null,
>   environmentId?: string | null,
>   name?: string | null,
>   networkId?: number | string | null,
>   projectId?: string | null,
>   publicId?: string | null,
>   tags?: string[] | null
> }[]
> ```

***

## Project Favorites

### list

`projectFavorites.list`

The authenticated user's favorited project ids in a workspace, in the order the Favorites row should render them. Defaults to the order they were starred in

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projectFavorites.list({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `orderBy` | `CREATED_AT_DESC \| NAME_ASC \| UPDATED_AT_DESC` | No | — |
| `workspaceId` | `string` | Yes | — |

**Output:** `string[]`

***

### set

`projectFavorites.set`

Star or unstar a project for the authenticated user. Returns the resulting state

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.projectFavorites.set({ favorite: true, projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `favorite` | `boolean` | Yes | — |
| `projectId` | `string` | Yes | — |

**Output:** `boolean`

***

## Project Invitations

### accept

`projectInvitations.accept`

Accept a project invitation using the invite code

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.projectInvitations.accept({ code: 'postgres' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |
| `userId` | `string \| null` | No | — |

***

### create

`projectInvitations.create`

Create an invitation for a project

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.projectInvitations.create({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: { email: 'ada@example.com', role: 'MEMBER' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   email: string,
>   role: ADMIN | MEMBER | VIEWER
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `email` | `string \| null` | No | — |
| `expiresAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `inviter` | `object \| null` | No | — |
| `isExpired` | `boolean \| null` | No | — |
| `project` | `object \| null` | No | — |

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

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

***

### createInviteCode

`projectInvitations.createInviteCode`

Create a 24-hour project invite link, reusing a link created within the last hour

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.projectInvitations.createInviteCode({ projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', role: 'MEMBER' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | — |
| `role` | `ADMIN \| MEMBER \| VIEWER` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `expiresAt` | `string \| null` | No | When this invite link expires. |
| `id` | `string \| null` | No | — |
| `isExpired` | `boolean \| null` | No | — |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

***

### delete

`projectInvitations.delete`

Delete an invitation for a project

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

```ts theme={null}
await corsair.railway.api.projectInvitations.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### get

`projectInvitations.get`

Get a project invitation by code

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projectInvitations.get({ code: 'postgres' });
```

**Input**

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

**Output**

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

***

### inviteCode

`projectInvitations.inviteCode`

Get an invite code for a project for a specifc role

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projectInvitations.inviteCode({ projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', role: 'MEMBER' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | — |
| `role` | `ADMIN \| MEMBER \| VIEWER` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `expiresAt` | `string \| null` | No | When this invite link expires. |
| `id` | `string \| null` | No | — |
| `isExpired` | `boolean \| null` | No | — |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

***

### list

`projectInvitations.list`

Get invitations for a project

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projectInvitations.list({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   email?: string | null,
>   expiresAt?: string | null,
>   id?: string | null,
>   inviter?: {
>     email?: string | null,
>     name?: string | null
>   } | null,
>   isExpired?: boolean | null,
>   project?: {
>     id?: string | null,
>     name?: string | null
>   } | null
> }[]
> ```

***

### resend

`projectInvitations.resend`

Resend an invitation for a project

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.projectInvitations.resend({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `email` | `string \| null` | No | — |
| `expiresAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `inviter` | `object \| null` | No | — |
| `isExpired` | `boolean \| null` | No | — |
| `project` | `object \| null` | No | — |

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

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

***

## Project Members

### add

`projectMembers.add`

Add a workspace member to a project with a specific role. The user must already be a member of the project's workspace

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.projectMembers.add({
	input: { projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', role: 'MEMBER', userId: '00000009-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   projectId: string,
>   role: ADMIN | MEMBER | VIEWER,
>   userId: string
> }
> ```

**Output**

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

***

### list

`projectMembers.list`

Gets users who belong to a project along with their role

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projectMembers.list({ projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `object[]`

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

***

### remove

`projectMembers.remove`

Remove user from a project

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.projectMembers.remove({
	input: { projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', userId: '00000009-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

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

**Output:** `object[]`

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

***

### update

`projectMembers.update`

Change the role for a user within a project

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.projectMembers.update({
	input: { projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', role: 'MEMBER', userId: '00000009-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   projectId: string,
>   role: ADMIN | MEMBER | VIEWER,
>   userId: string
> }
> ```

**Output**

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

***

## Projects

### addFeatureFlag

`projects.addFeatureFlag`

Add a feature flag for a project

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.projects.addFeatureFlag({
	input: { flag: 'LEGACY_CONFIG_AS_CODE', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   flag: LEGACY_CONFIG_AS_CODE | PLACEHOLDER | RBS_VOLUMES | TRACING_AUTO_INSTRUMENTATION | VM_NEW_SERVICES | VM_VOLUMES | VOLUME_AUTO_GROW | WEBSITES,
>   projectId: string
> }
> ```

**Output:** `boolean`

***

### cancelScheduledDelete

`projects.cancelScheduledDelete`

Cancel scheduled deletion of a project

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.projects.cancelScheduledDelete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### claim

`projects.claim`

Claims a project

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.projects.claim({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseEnvironment` | `object \| null` | No | — |
| `baseEnvironmentId` | `string \| null` | No | — |
| `botPrEnvironments` | `boolean \| null` | No | — |
| `clearanceDefaultForNewEnvironments` | `boolean \| null` | No | Whether environments created from now on start with Railway Authentication protecting services that have no setting of their own. Existing environments keep their own default. |
| `clearanceTokens` | `object[] \| null` | No | The project's Railway Authentication tokens that still work (not revoked, not expired), newest first. |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `expiredAt` | `string \| null` | No | — |
| `featureFlags` | `string[] \| null` | No | — |
| `focusedPrEnvironments` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isPublic` | `boolean \| null` | No | — |
| `isTempProject` | `boolean \| null` | No | — |
| `members` | `object[] \| null` | No | — |
| `name` | `string \| null` | No | — |
| `prDeploys` | `boolean \| null` | No | — |
| `primaryEnvironmentId` | `string \| null` | No | The id of the oldest non-ephemeral environment for this project (typically production). Used by the dashboard to render project cards without fetching the full environments connection. |
| `subscriptionPlanLimit` | `any \| null` | No | — |
| `subscriptionType` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `viewerRole` | `string \| null` | No | — |
| `workspace` | `object \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] baseEnvironment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] clearanceTokens full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   environmentId?: string | null,
>   environmentName?: string | null,
>   expiresAt?: string | null,
>   id?: string | null,
>   name?: string | null
> }[] | null
> ```

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

> [accordion] workspace full type
>
> ```ts theme={null}
> {
>   adoptionLevel?: number | null,
>   avatar?: string | null,
>   createdAt?: string | null,
>   discordRole?: string | null,
>   has2FAEnforcement?: boolean | null,
>   hasAutomaticDiagnosis?: boolean | null,
>   hasGuardrailsAccess?: boolean | null,
>   hasHipaaBAA?: boolean | null,
>   hasSAML?: boolean | null,
>   id?: string | null,
>   name?: string | null,
>   plan?: string | null,
>   preferredRegion?: string | null,
>   projectCount?: number | null,
>   redactedDueTo2FAPending?: boolean | null,
>   restrictProjectVisibilityToGroups?: boolean | null,
>   slackChannelId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   updatedAt?: string | null,
>   usersWithout2FA?: string[] | null
> } | null
> ```

***

### compliance

`projects.compliance`

Get comprehensive compliance information for a project including 2FA status, member permissions, backup schedules, and compliance agreements. Requires workspace API token with admin access

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projects.compliance({ projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `memberPermissions` | `object[] \| null` | No | Permissions for each project member |
| `projectId` | `string \| null` | No | — |
| `projectName` | `string \| null` | No | — |
| `serviceBackups` | `object[] \| null` | No | Backup schedules for database services |
| `twoFactorMembers` | `object[] \| null` | No | 2FA status for each project member |
| `workspaceId` | `string \| null` | No | — |

> [accordion] memberPermissions full type
>
> ```ts theme={null}
> {
>   email?: string | null,
>   name?: string | null,
>   role?: string | null
> }[] | null
> ```

> [accordion] serviceBackups full type
>
> ```ts theme={null}
> {
>   schedules?: string[] | null,
>   serviceId?: string | null,
>   serviceName?: string | null
> }[] | null
> ```

> [accordion] twoFactorMembers full type
>
> ```ts theme={null}
> {
>   email?: string | null,
>   enabledMethods?: string[] | null,
>   name?: string | null,
>   twoFactorAuthEnabled?: boolean | null
> }[] | null
> ```

***

### confirmTransfer

`projects.confirmTransfer`

Confirm the transfer of project ownership

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

```ts theme={null}
await corsair.railway.api.projects.confirmTransfer({
	input: { ownershipTransferId: 'example', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   destinationWorkspaceId?: string,
>   ownershipTransferId: string,
>   projectId: string
> }
> ```

**Output:** `boolean`

***

### create

`projects.create`

Create a project in a workspace (workspaceId), with an optional description and default environment name

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.projects.create({
	input: { name: 'acme-api', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   defaultEnvironmentName?: string,
>   description?: string,
>   isMonorepo?: boolean,
>   isPublic?: boolean,
>   name?: string,
>   prDeploys?: boolean,
>   repo?: {
>     branch: string,
>     fullRepoName: string
>   },
>   runtime?: LEGACY | UNSPECIFIED | V2,
>   workspaceId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseEnvironment` | `object \| null` | No | — |
| `baseEnvironmentId` | `string \| null` | No | — |
| `botPrEnvironments` | `boolean \| null` | No | — |
| `clearanceDefaultForNewEnvironments` | `boolean \| null` | No | Whether environments created from now on start with Railway Authentication protecting services that have no setting of their own. Existing environments keep their own default. |
| `clearanceTokens` | `object[] \| null` | No | The project's Railway Authentication tokens that still work (not revoked, not expired), newest first. |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `expiredAt` | `string \| null` | No | — |
| `featureFlags` | `string[] \| null` | No | — |
| `focusedPrEnvironments` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isPublic` | `boolean \| null` | No | — |
| `isTempProject` | `boolean \| null` | No | — |
| `members` | `object[] \| null` | No | — |
| `name` | `string \| null` | No | — |
| `prDeploys` | `boolean \| null` | No | — |
| `primaryEnvironmentId` | `string \| null` | No | The id of the oldest non-ephemeral environment for this project (typically production). Used by the dashboard to render project cards without fetching the full environments connection. |
| `subscriptionPlanLimit` | `any \| null` | No | — |
| `subscriptionType` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `viewerRole` | `string \| null` | No | — |
| `workspace` | `object \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] baseEnvironment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] clearanceTokens full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   environmentId?: string | null,
>   environmentName?: string | null,
>   expiresAt?: string | null,
>   id?: string | null,
>   name?: string | null
> }[] | null
> ```

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

> [accordion] workspace full type
>
> ```ts theme={null}
> {
>   adoptionLevel?: number | null,
>   avatar?: string | null,
>   createdAt?: string | null,
>   discordRole?: string | null,
>   has2FAEnforcement?: boolean | null,
>   hasAutomaticDiagnosis?: boolean | null,
>   hasGuardrailsAccess?: boolean | null,
>   hasHipaaBAA?: boolean | null,
>   hasSAML?: boolean | null,
>   id?: string | null,
>   name?: string | null,
>   plan?: string | null,
>   preferredRegion?: string | null,
>   projectCount?: number | null,
>   redactedDueTo2FAPending?: boolean | null,
>   restrictProjectVisibilityToGroups?: boolean | null,
>   slackChannelId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   updatedAt?: string | null,
>   usersWithout2FA?: string[] | null
> } | null
> ```

***

### delete

`projects.delete`

Permanently delete a project with every environment, service, deployment, volume and variable in it

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

```ts theme={null}
await corsair.railway.api.projects.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### forceScheduledDelete

`projects.forceScheduledDelete`

Force delete a scheduled deletion of a project (skips the grace period)

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

```ts theme={null}
await corsair.railway.api.projects.forceScheduledDelete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### get

`projects.get`

Get a project by ID

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projects.get({ id: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseEnvironment` | `object \| null` | No | — |
| `baseEnvironmentId` | `string \| null` | No | — |
| `botPrEnvironments` | `boolean \| null` | No | — |
| `clearanceDefaultForNewEnvironments` | `boolean \| null` | No | Whether environments created from now on start with Railway Authentication protecting services that have no setting of their own. Existing environments keep their own default. |
| `clearanceTokens` | `object[] \| null` | No | The project's Railway Authentication tokens that still work (not revoked, not expired), newest first. |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `expiredAt` | `string \| null` | No | — |
| `featureFlags` | `string[] \| null` | No | — |
| `focusedPrEnvironments` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isPublic` | `boolean \| null` | No | — |
| `isTempProject` | `boolean \| null` | No | — |
| `members` | `object[] \| null` | No | — |
| `name` | `string \| null` | No | — |
| `prDeploys` | `boolean \| null` | No | — |
| `primaryEnvironmentId` | `string \| null` | No | The id of the oldest non-ephemeral environment for this project (typically production). Used by the dashboard to render project cards without fetching the full environments connection. |
| `subscriptionPlanLimit` | `any \| null` | No | — |
| `subscriptionType` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `viewerRole` | `string \| null` | No | — |
| `workspace` | `object \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] baseEnvironment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] clearanceTokens full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   environmentId?: string | null,
>   environmentName?: string | null,
>   expiresAt?: string | null,
>   id?: string | null,
>   name?: string | null
> }[] | null
> ```

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

> [accordion] workspace full type
>
> ```ts theme={null}
> {
>   adoptionLevel?: number | null,
>   avatar?: string | null,
>   createdAt?: string | null,
>   discordRole?: string | null,
>   has2FAEnforcement?: boolean | null,
>   hasAutomaticDiagnosis?: boolean | null,
>   hasGuardrailsAccess?: boolean | null,
>   hasHipaaBAA?: boolean | null,
>   hasSAML?: boolean | null,
>   id?: string | null,
>   name?: string | null,
>   plan?: string | null,
>   preferredRegion?: string | null,
>   projectCount?: number | null,
>   redactedDueTo2FAPending?: boolean | null,
>   restrictProjectVisibilityToGroups?: boolean | null,
>   slackChannelId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   updatedAt?: string | null,
>   usersWithout2FA?: string[] | null
> } | null
> ```

***

### initiateTransfer

`projects.initiateTransfer`

Initiate the transfer of project ownership

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.projects.initiateTransfer({
	input: { memberId: 'example', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   memberId: string,
>   projectId: string
> }
> ```

**Output:** `boolean`

***

### leave

`projects.leave`

Leave project as currently authenticated user

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.projects.leave({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### list

`projects.list`

List the projects the token can see (all workspaces, or one with workspaceId), as a page of nodes

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projects.list({ first: 20 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `includeDeleted` | `boolean` | No | — |
| `last` | `number` | No | — |
| `orderBy` | `CREATED_AT_DESC \| NAME_ASC \| UPDATED_AT_DESC` | No | — |
| `userId` | `string` | No | — |
| `workspaceId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   baseEnvironment?: {
>     canAccess?: boolean | null,
>     canvasGroupRefs?: any | null,
>     clearanceCachingTurnedOff?: string[] | null,
>     clearanceDefault?: boolean | null,
>     clearanceDefaultUpdatedAt?: string | null,
>     clearancePropagatedAt?: string | null,
>     clearancePropagationError?: string | null,
>     config?: any | null,
>     configEtag?: string | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     iacPartials?: any | null,
>     id?: string | null,
>     isEphemeral?: boolean | null,
>     name?: string | null,
>     projectId?: string | null,
>     sourceEnvironmentName?: string | null,
>     unmergedChangesCount?: number | null,
>     updatedAt?: string | null
>   } | null,
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   clearanceTokens?: {
>     createdAt?: string | null,
>     environmentId?: string | null,
>     environmentName?: string | null,
>     expiresAt?: string | null,
>     id?: string | null,
>     name?: string | null
>   }[] | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   members?: {
>     avatar?: string | null,
>     email?: string | null,
>     id?: string | null,
>     name?: string | null,
>     role?: string | null
>   }[] | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspace?: {
>     adoptionLevel?: number | null,
>     avatar?: string | null,
>     createdAt?: string | null,
>     discordRole?: string | null,
>     has2FAEnforcement?: boolean | null,
>     hasAutomaticDiagnosis?: boolean | null,
>     hasGuardrailsAccess?: boolean | null,
>     hasHipaaBAA?: boolean | null,
>     hasSAML?: boolean | null,
>     id?: string | null,
>     name?: string | null,
>     plan?: string | null,
>     preferredRegion?: string | null,
>     projectCount?: number | null,
>     redactedDueTo2FAPending?: boolean | null,
>     restrictProjectVisibilityToGroups?: boolean | null,
>     slackChannelId?: string | null,
>     subscriptionPlanLimit?: any | null,
>     updatedAt?: string | null,
>     usersWithout2FA?: string[] | null
>   } | null,
>   workspaceId?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### listByIds

`projects.listByIds`

Fetch multiple projects by id. Skips ids the caller cannot access (does not throw on partial denial). Intended for batched dashboard hydration of a small viewport-sized set of cards

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projects.listByIds({
	ids: ['00000001-5c1e-4d8a-9f43-2b6e1c0a9d17'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `ids` | `string[]` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   baseEnvironment?: {
>     canAccess?: boolean | null,
>     canvasGroupRefs?: any | null,
>     clearanceCachingTurnedOff?: string[] | null,
>     clearanceDefault?: boolean | null,
>     clearanceDefaultUpdatedAt?: string | null,
>     clearancePropagatedAt?: string | null,
>     clearancePropagationError?: string | null,
>     config?: any | null,
>     configEtag?: string | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     iacPartials?: any | null,
>     id?: string | null,
>     isEphemeral?: boolean | null,
>     name?: string | null,
>     projectId?: string | null,
>     sourceEnvironmentName?: string | null,
>     unmergedChangesCount?: number | null,
>     updatedAt?: string | null
>   } | null,
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   clearanceTokens?: {
>     createdAt?: string | null,
>     environmentId?: string | null,
>     environmentName?: string | null,
>     expiresAt?: string | null,
>     id?: string | null,
>     name?: string | null
>   }[] | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   members?: {
>     avatar?: string | null,
>     email?: string | null,
>     id?: string | null,
>     name?: string | null,
>     role?: string | null
>   }[] | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspace?: {
>     adoptionLevel?: number | null,
>     avatar?: string | null,
>     createdAt?: string | null,
>     discordRole?: string | null,
>     has2FAEnforcement?: boolean | null,
>     hasAutomaticDiagnosis?: boolean | null,
>     hasGuardrailsAccess?: boolean | null,
>     hasHipaaBAA?: boolean | null,
>     hasSAML?: boolean | null,
>     id?: string | null,
>     name?: string | null,
>     plan?: string | null,
>     preferredRegion?: string | null,
>     projectCount?: number | null,
>     redactedDueTo2FAPending?: boolean | null,
>     restrictProjectVisibilityToGroups?: boolean | null,
>     slackChannelId?: string | null,
>     subscriptionPlanLimit?: any | null,
>     updatedAt?: string | null,
>     usersWithout2FA?: string[] | null
>   } | null,
>   workspaceId?: string | null
> }[]
> ```

***

### removeFeatureFlag

`projects.removeFeatureFlag`

Remove a feature flag for a project

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.projects.removeFeatureFlag({
	input: { flag: 'LEGACY_CONFIG_AS_CODE', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   flag: LEGACY_CONFIG_AS_CODE | PLACEHOLDER | RBS_VOLUMES | TRACING_AUTO_INSTRUMENTATION | VM_NEW_SERVICES | VM_VOLUMES | VOLUME_AUTO_GROW | WEBSITES,
>   projectId: string
> }
> ```

**Output:** `boolean`

***

### resourceAccess

`projects.resourceAccess`

Get resource access rules for project-specific actions

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projects.resourceAccess({ projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `customDomain` | `object \| null` | No | — |
| `databaseDeployment` | `object \| null` | No | — |
| `deployment` | `object \| null` | No | — |
| `environment` | `object \| null` | No | — |
| `sandbox` | `object \| null` | No | — |

> [accordion] customDomain full type
>
> ```ts theme={null}
> {
>   disallowed?: string | null
> } | null
> ```

> [accordion] databaseDeployment full type
>
> ```ts theme={null}
> {
>   disallowed?: string | null
> } | null
> ```

> [accordion] deployment full type
>
> ```ts theme={null}
> {
>   disallowed?: string | null
> } | null
> ```

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   disallowed?: string | null
> } | null
> ```

> [accordion] sandbox full type
>
> ```ts theme={null}
> {
>   disallowed?: string | null
> } | null
> ```

***

### scheduleDelete

`projects.scheduleDelete`

Deletes a project with a 48 hour grace period

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.projects.scheduleDelete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### serviceUsage

`projects.serviceUsage`

Get paginated usage grouped by project and service for a workspace

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projects.serviceUsage({
	endDate: '2026-04-09T10:00:00Z',
	measurements: ['AGENT_CACHE_READ_TOKENS'],
	startDate: '2026-04-09T10:00:00Z',
	workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Project ID cursor returned from the previous page. |
| `endDate` | `string` | Yes | — |
| `first` | `number` | No | Number of projects to include in this page. Max 50. |
| `includeDeleted` | `boolean` | No | Whether to include deleted projects in usage. |
| `measurements` | `(AGENT_CACHE_READ_TOKENS \| AGENT_CACHE_WRITE_TOKENS \| AGENT_INPUT_TOKENS \| AGENT_OUTPUT_TOKENS \| AGENT_SPEND_USD \| BACKUP_USAGE_GB \| CPU_LIMIT \| CPU_USAGE \| CPU_USAGE_2 \| DISK_USAGE_GB \| EPHEMERAL_DISK_USAGE_GB \| MEASUREMENT_UNSPECIFIED \| MEMORY_LIMIT_GB \| MEMORY_USAGE_GB \| NETWORK_RX_GB \| NETWORK_TX_GB \| UNRECOGNIZED)[]` | Yes | — |
| `startDate` | `string` | Yes | — |
| `workspaceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `pageInfo` | `object \| null` | No | — |
| `usage` | `object[] \| null` | No | — |

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   endCursor?: string | null,
>   hasNextPage?: boolean | null
> } | null
> ```

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

***

### transfer

`projects.transfer`

Transfer a project to a workspace

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

```ts theme={null}
await corsair.railway.api.projects.transfer({
	input: { workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' },
	projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `input` | `object` | Yes | — |
| `projectId` | `string` | Yes | — |

> [accordion] input full type
>
> ```ts theme={null}
> {
>   workspaceId: string
> }
> ```

**Output:** `boolean`

***

### update

`projects.update`

Updates a project

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.projects.update({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string,
>   botPrEnvironments?: boolean,
>   description?: string,
>   focusedPrEnvironments?: boolean,
>   isPublic?: boolean,
>   name?: string,
>   prDeploys?: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseEnvironment` | `object \| null` | No | — |
| `baseEnvironmentId` | `string \| null` | No | — |
| `botPrEnvironments` | `boolean \| null` | No | — |
| `clearanceDefaultForNewEnvironments` | `boolean \| null` | No | Whether environments created from now on start with Railway Authentication protecting services that have no setting of their own. Existing environments keep their own default. |
| `clearanceTokens` | `object[] \| null` | No | The project's Railway Authentication tokens that still work (not revoked, not expired), newest first. |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `expiredAt` | `string \| null` | No | — |
| `featureFlags` | `string[] \| null` | No | — |
| `focusedPrEnvironments` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isPublic` | `boolean \| null` | No | — |
| `isTempProject` | `boolean \| null` | No | — |
| `members` | `object[] \| null` | No | — |
| `name` | `string \| null` | No | — |
| `prDeploys` | `boolean \| null` | No | — |
| `primaryEnvironmentId` | `string \| null` | No | The id of the oldest non-ephemeral environment for this project (typically production). Used by the dashboard to render project cards without fetching the full environments connection. |
| `subscriptionPlanLimit` | `any \| null` | No | — |
| `subscriptionType` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `viewerRole` | `string \| null` | No | — |
| `workspace` | `object \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] baseEnvironment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] clearanceTokens full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   environmentId?: string | null,
>   environmentName?: string | null,
>   expiresAt?: string | null,
>   id?: string | null,
>   name?: string | null
> }[] | null
> ```

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

> [accordion] workspace full type
>
> ```ts theme={null}
> {
>   adoptionLevel?: number | null,
>   avatar?: string | null,
>   createdAt?: string | null,
>   discordRole?: string | null,
>   has2FAEnforcement?: boolean | null,
>   hasAutomaticDiagnosis?: boolean | null,
>   hasGuardrailsAccess?: boolean | null,
>   hasHipaaBAA?: boolean | null,
>   hasSAML?: boolean | null,
>   id?: string | null,
>   name?: string | null,
>   plan?: string | null,
>   preferredRegion?: string | null,
>   projectCount?: number | null,
>   redactedDueTo2FAPending?: boolean | null,
>   restrictProjectVisibilityToGroups?: boolean | null,
>   slackChannelId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   updatedAt?: string | null,
>   usersWithout2FA?: string[] | null
> } | null
> ```

***

### updateClearanceDefault

`projects.updateClearanceDefault`

Sets whether environments created from now on start with Railway Authentication protecting services that have no setting of their own. Existing environments are unchanged. Requires a workspace admin; turning it on also requires the workspace's Railway Authentication entitlement

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.projects.updateClearanceDefault({
	input: { enabled: true, projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   enabled: boolean,
>   projectId: string
> }
> ```

**Output:** `boolean`

***

### workspaceMembers

`projects.workspaceMembers`

Get workspace members for a project with 2FA details

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projects.workspaceMembers({ projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `members` | `object[] \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `projectName` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] members full type
>
> ```ts theme={null}
> {
>   email?: string | null,
>   enabledMethods?: string[] | null,
>   name?: string | null,
>   twoFactorAuthEnabled?: boolean | null
> }[] | null
> ```

***

## Project Tokens

### create

`projectTokens.create`

Create a token for a project that has access to a specific environment

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.projectTokens.create({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', name: 'api', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   name: string,
>   projectId: string
> }
> ```

**Output:** `string`

***

### delete

`projectTokens.delete`

Delete a project token

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

```ts theme={null}
await corsair.railway.api.projectTokens.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### get

`projectTokens.get`

Get a single project token by the value in the header

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projectTokens.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `displayToken` | `string \| null` | No | — |
| `environment` | `object \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

***

### list

`projectTokens.list`

Get all project tokens for a project, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.projectTokens.list({ projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |
| `projectId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   displayToken?: string | null,
>   environment?: {
>     canAccess?: boolean | null,
>     canvasGroupRefs?: any | null,
>     clearanceCachingTurnedOff?: string[] | null,
>     clearanceDefault?: boolean | null,
>     clearanceDefaultUpdatedAt?: string | null,
>     clearancePropagatedAt?: string | null,
>     clearancePropagationError?: string | null,
>     config?: any | null,
>     configEtag?: string | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     iacPartials?: any | null,
>     id?: string | null,
>     isEphemeral?: boolean | null,
>     name?: string | null,
>     projectId?: string | null,
>     sourceEnvironmentName?: string | null,
>     unmergedChangesCount?: number | null,
>     updatedAt?: string | null
>   } | null,
>   environmentId?: string | null,
>   id?: string | null,
>   name?: string | null,
>   project?: {
>     baseEnvironmentId?: string | null,
>     botPrEnvironments?: boolean | null,
>     clearanceDefaultForNewEnvironments?: boolean | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     description?: string | null,
>     expiredAt?: string | null,
>     featureFlags?: string[] | null,
>     focusedPrEnvironments?: boolean | null,
>     id?: string | null,
>     isPublic?: boolean | null,
>     isTempProject?: boolean | null,
>     name?: string | null,
>     prDeploys?: boolean | null,
>     primaryEnvironmentId?: string | null,
>     subscriptionPlanLimit?: any | null,
>     subscriptionType?: string | null,
>     updatedAt?: string | null,
>     viewerRole?: string | null,
>     workspaceId?: string | null
>   } | null,
>   projectId?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

## Railway Domain Dns Records

### create

`railwayDomainDnsRecords.create`

Create a DNS record for a Railway domain

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.railwayDomainDnsRecords.create({
	input: {
		answer: 'example',
		domain: 'api.example.com',
		host: 'example',
		type: 'A',
		workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   answer: string,
>   domain: string,
>   host: string,
>   priority?: number,
>   ttl?: number,
>   type: A | AAAA | ANAME | CNAME | MX | NS | SRV | TXT,
>   workspaceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `answer` | `string \| null` | No | — |
| `domainName` | `string \| null` | No | — |
| `fqdn` | `string \| null` | No | — |
| `host` | `string \| null` | No | — |
| `id` | `number \| null` | No | — |
| `priority` | `number \| null` | No | — |
| `ttl` | `number \| null` | No | — |
| `type` | `string \| null` | No | — |

***

### delete

`railwayDomainDnsRecords.delete`

Delete a DNS record for a Railway domain

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

```ts theme={null}
await corsair.railway.api.railwayDomainDnsRecords.delete({
	input: { domain: 'api.example.com', recordId: 1, workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   domain: string,
>   recordId: number,
>   removeEmailForwarding?: boolean,
>   workspaceId: string
> }
> ```

**Output:** `boolean`

***

### list

`railwayDomainDnsRecords.list`

List DNS records for a Railway domain

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.railwayDomainDnsRecords.list({ domain: 'api.example.com', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | — |
| `workspaceId` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   answer?: string | null,
>   domainName?: string | null,
>   fqdn?: string | null,
>   host?: string | null,
>   id?: number | null,
>   priority?: number | null,
>   ttl?: number | null,
>   type?: string | null
> }[]
> ```

***

### update

`railwayDomainDnsRecords.update`

Update a DNS record for a Railway domain

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.railwayDomainDnsRecords.update({
	input: {
		answer: 'example',
		domain: 'api.example.com',
		host: 'example',
		recordId: 1,
		type: 'A',
		workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   answer: string,
>   domain: string,
>   host: string,
>   priority?: number,
>   recordId: number,
>   ttl?: number,
>   type: A | AAAA | ANAME | CNAME | MX | NS | SRV | TXT,
>   workspaceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `answer` | `string \| null` | No | — |
| `domainName` | `string \| null` | No | — |
| `fqdn` | `string \| null` | No | — |
| `host` | `string \| null` | No | — |
| `id` | `number \| null` | No | — |
| `priority` | `number \| null` | No | — |
| `ttl` | `number \| null` | No | — |
| `type` | `string \| null` | No | — |

***

## Railway Domain Email Forwarding Rules

### create

`railwayDomainEmailForwardingRules.create`

Forward an address on this domain to an external inbox

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.railwayDomainEmailForwardingRules.create({
	input: {
		alias: 'example',
		destination: 'example',
		domain: 'api.example.com',
		workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   alias: string,
>   destination: string,
>   domain: string,
>   workspaceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `alias` | `string \| null` | No | Local part of the forwarded address, without the domain. |
| `destination` | `string \| null` | No | The external inbox mail for this alias is delivered to. |

***

### delete

`railwayDomainEmailForwardingRules.delete`

Stop forwarding an address on this domain

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

```ts theme={null}
await corsair.railway.api.railwayDomainEmailForwardingRules.delete({
	input: { alias: 'example', domain: 'api.example.com', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   alias: string,
>   domain: string,
>   workspaceId: string
> }
> ```

**Output:** `boolean`

***

### list

`railwayDomainEmailForwardingRules.list`

List email forwarding rules for a Railway domain

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.railwayDomainEmailForwardingRules.list({ domain: 'api.example.com', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | — |
| `workspaceId` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   alias?: string | null,
>   destination?: string | null
> }[]
> ```

***

### removeAll

`railwayDomainEmailForwardingRules.removeAll`

Stop forwarding every address on this domain, and remove the mail records that delivered them

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.railwayDomainEmailForwardingRules.removeAll({
	input: { domain: 'api.example.com', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   domain: string,
>   workspaceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `addressesRemoved` | `number \| null` | No | — |
| `mailRecordsRemoved` | `number \| null` | No | — |

***

### sendTest

`railwayDomainEmailForwardingRules.sendTest`

Send a message to a forwarded address so the customer can confirm it delivers

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.railwayDomainEmailForwardingRules.sendTest({
	input: { alias: 'example', domain: 'api.example.com', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   alias: string,
>   domain: string,
>   workspaceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `alias` | `string \| null` | No | Local part of the forwarded address, without the domain. |
| `destination` | `string \| null` | No | The external inbox mail for this alias is delivered to. |

***

### update

`railwayDomainEmailForwardingRules.update`

Change where a forwarded address delivers

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.railwayDomainEmailForwardingRules.update({
	input: {
		alias: 'example',
		destination: 'example',
		domain: 'api.example.com',
		workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   alias: string,
>   destination: string,
>   domain: string,
>   workspaceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `alias` | `string \| null` | No | Local part of the forwarded address, without the domain. |
| `destination` | `string \| null` | No | The external inbox mail for this alias is delivered to. |

***

## Railway Domains

### emailForwardingEligibility

`railwayDomains.emailForwardingEligibility`

Whether email forwarding can be offered on this domain, or why it can't

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.railwayDomains.emailForwardingEligibility({ domain: 'api.example.com', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | — |
| `workspaceId` | `string` | Yes | — |

**Output:** `string`

***

### emailForwardingLimits

`railwayDomains.emailForwardingLimits`

Caps the forwarding UI surfaces before a rule is rejected server-side. Pass workspaceId for that workspace's alias allowance; without it the highest plan's is returned

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.railwayDomains.emailForwardingLimits({});
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `maxAliases` | `number \| null` | No | — |

***

### get

`railwayDomains.get`

Get a Railway domain by ID

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.railwayDomains.get({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `autoRenewEnabled` | `boolean \| null` | No | — |
| `connectedServiceInstances` | `object[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `nameservers` | `object \| null` | No | — |
| `nextBillingDate` | `string \| null` | No | — |
| `purchasePrice` | `number \| null` | No | — |
| `registrationYears` | `number \| null` | No | — |
| `renewalPrice` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |
| `workspaceName` | `string \| null` | No | — |

> [accordion] connectedServiceInstances full type
>
> ```ts theme={null}
> {
>   environmentId?: string | null,
>   projectId?: string | null,
>   serviceId?: string | null,
>   serviceName?: string | null
> }[] | null
> ```

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

***

### getByName

`railwayDomains.getByName`

Get a Railway domain by its domain name within a workspace

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.railwayDomains.getByName({ domain: 'api.example.com', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `domain` | `string` | Yes | — |
| `workspaceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `autoRenewEnabled` | `boolean \| null` | No | — |
| `connectedServiceInstances` | `object[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `nameservers` | `object \| null` | No | — |
| `nextBillingDate` | `string \| null` | No | — |
| `purchasePrice` | `number \| null` | No | — |
| `registrationYears` | `number \| null` | No | — |
| `renewalPrice` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |
| `workspaceName` | `string \| null` | No | — |

> [accordion] connectedServiceInstances full type
>
> ```ts theme={null}
> {
>   environmentId?: string | null,
>   projectId?: string | null,
>   serviceId?: string | null,
>   serviceName?: string | null
> }[] | null
> ```

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

***

### list

`railwayDomains.list`

Get Railway domains for a workspace

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.railwayDomains.list({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `ACTIVE \| EXPIRED \| PURCHASING \| REFUNDED` | No | — |
| `workspaceId` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   autoRenewEnabled?: boolean | null,
>   connectedServiceInstances?: {
>     environmentId?: string | null,
>     projectId?: string | null,
>     serviceId?: string | null,
>     serviceName?: string | null
>   }[] | null,
>   createdAt?: string | null,
>   domain?: string | null,
>   id?: string | null,
>   nameservers?: {
>     isDefault?: boolean | null,
>     nameservers?: string[] | null
>   } | null,
>   nextBillingDate?: string | null,
>   purchasePrice?: number | null,
>   registrationYears?: number | null,
>   renewalPrice?: number | null,
>   status?: string | null,
>   workspaceId?: string | null,
>   workspaceName?: string | null
> }[]
> ```

***

### setNameservers

`railwayDomains.setNameservers`

Delegate the domain's authoritative nameservers to an external DNS provider, or reset to Railway defaults by passing an empty list

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.railwayDomains.setNameservers({
	input: {
		id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
		nameservers: ['example'],
	},
});
```

**Input**

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

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `isDefault` | `boolean \| null` | No | True when the domain is delegated to Name.com's nameservers (Railway-managed DNS). |
| `nameservers` | `string[] \| null` | No | — |

***

### update

`railwayDomains.update`

Update a Railway domain's settings

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.railwayDomains.update({
	input: { id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   autoRenewEnabled?: boolean,
>   id: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `autoRenewEnabled` | `boolean \| null` | No | — |
| `connectedServiceInstances` | `object[] \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `nameservers` | `object \| null` | No | — |
| `nextBillingDate` | `string \| null` | No | — |
| `purchasePrice` | `number \| null` | No | — |
| `registrationYears` | `number \| null` | No | — |
| `renewalPrice` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |
| `workspaceName` | `string \| null` | No | — |

> [accordion] connectedServiceInstances full type
>
> ```ts theme={null}
> {
>   environmentId?: string | null,
>   projectId?: string | null,
>   serviceId?: string | null,
>   serviceName?: string | null
> }[] | null
> ```

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

***

## Referral

### get

`referral.get`

Gets the ReferralInfo for the authenticated user

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.referral.get({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

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

> [accordion] referralStats full type
>
> ```ts theme={null}
> {
>   credited?: number | null,
>   pending?: number | null
> } | null
> ```

***

### update

`referral.update`

Updates the ReferralInfo for the authenticated user

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.referral.update({
	input: { code: 'postgres', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   code: string,
>   workspaceId: string
> }
> ```

**Output**

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

> [accordion] referralStats full type
>
> ```ts theme={null}
> {
>   credited?: number | null,
>   pending?: number | null
> } | null
> ```

***

## Regions

### list

`regions.list`

List available regions

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.regions.list({});
```

**Input**

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

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   country?: string | null,
>   id?: string | null,
>   location?: string | null,
>   name?: string | null,
>   region?: string | null,
>   workspaceId?: string | null
> }[]
> ```

***

## Resource Access

### get

`resourceAccess.get`

Get resource access for the current user or workspace

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.resourceAccess.get({
	explicitResourceOwner: { id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] explicitResourceOwner full type
>
> ```ts theme={null}
> {
>   id: string,
>   type?: WORKSPACE
> }
> ```

**Output**

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

> [accordion] deployment full type
>
> ```ts theme={null}
> {
>   disallowed?: string | null
> } | null
> ```

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

***

## Sandbox Checkpoints

### create

`sandboxCheckpoints.create`

Capture a running sandbox's current disk into a reusable, named checkpoint. Synchronous: the checkpoint is ready when this returns

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.sandboxCheckpoints.create({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', name: 'api', sandboxId: '0000000d-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `sandboxId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `key` | `string \| null` | No | The checkpoint's identity within the environment (same as id): a recipe content hash for a built template, or the user-given name for one captured from a sandbox. |

***

### delete

`sandboxCheckpoints.delete`

Delete a sandbox checkpoint

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

```ts theme={null}
await corsair.railway.api.sandboxCheckpoints.delete({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### list

`sandboxCheckpoints.list`

List named sandbox checkpoints in an environment

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.sandboxCheckpoints.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `object[]`

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

***

### rename

`sandboxCheckpoints.rename`

Rename a sandbox checkpoint

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.sandboxCheckpoints.rename({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17', name: 'api' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `key` | `string \| null` | No | The checkpoint's identity within the environment (same as id): a recipe content hash for a built template, or the user-given name for one captured from a sandbox. |

***

## Sandboxes

### buildTemplate

`sandboxes.buildTemplate`

Build a sandbox template into a bootable checkpoint

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.sandboxes.buildTemplate({
	environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `input` | `object` | Yes | — |

> [accordion] input full type
>
> ```ts theme={null}
> {
>   instructions?: string[],
>   name?: string,
>   region?: string,
>   variables?: Record<string, string>
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | The template's resolved-content hash. |
| `status` | `string \| null` | No | — |

***

### create

`sandboxes.create`

Create a sandbox in an environment

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.sandboxes.create({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   idleTimeoutMinutes?: number,
>   networkIsolation?: ISOLATED | PRIVATE,
>   publicDomains?: {
>     port: number,
>     prefix?: string
>   }[],
>   region?: string,
>   resources?: {
>     cpu?: number,
>     memoryGB?: number
>   },
>   sourceSandboxId?: string,
>   template?: {
>     instructions?: string[],
>     name?: string,
>     region?: string,
>     variables?: Record<string, string>
>   },
>   variables?: Record<string, string>
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `domains` | `object[] \| null` | No | Railway-provided public HTTP domains whose routes have been published. |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `idleTimeoutMinutes` | `number \| null` | No | Minutes of inactivity before the sandbox is destroyed. 0 means it never idles out; null means unknown, including for a destroyed sandbox. |
| `networkIsolation` | `string \| null` | No | Controls a sandbox's access to the environment's private network. |
| `privateDomain` | `string \| null` | No | Hostname on the environment's private network, e.g. \<name>.railway.internal, reachable on any port from services in that environment. Null when the VM is isolated or its private endpoint isn't registered yet. |
| `region` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |

> [accordion] domains full type
>
> ```ts theme={null}
> {
>   domain?: string | null,
>   port?: number | null,
>   prefix?: string | null
> }[] | null
> ```

***

### destroy

`sandboxes.destroy`

Destroy a sandbox

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

```ts theme={null}
await corsair.railway.api.sandboxes.destroy({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `domains` | `object[] \| null` | No | Railway-provided public HTTP domains whose routes have been published. |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `idleTimeoutMinutes` | `number \| null` | No | Minutes of inactivity before the sandbox is destroyed. 0 means it never idles out; null means unknown, including for a destroyed sandbox. |
| `networkIsolation` | `string \| null` | No | Controls a sandbox's access to the environment's private network. |
| `privateDomain` | `string \| null` | No | Hostname on the environment's private network, e.g. \<name>.railway.internal, reachable on any port from services in that environment. Null when the VM is isolated or its private endpoint isn't registered yet. |
| `region` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |

> [accordion] domains full type
>
> ```ts theme={null}
> {
>   domain?: string | null,
>   port?: number | null,
>   prefix?: string | null
> }[] | null
> ```

***

### get

`sandboxes.get`

Get a sandbox by id

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.sandboxes.get({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `domains` | `object[] \| null` | No | Railway-provided public HTTP domains whose routes have been published. |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `idleTimeoutMinutes` | `number \| null` | No | Minutes of inactivity before the sandbox is destroyed. 0 means it never idles out; null means unknown, including for a destroyed sandbox. |
| `networkIsolation` | `string \| null` | No | Controls a sandbox's access to the environment's private network. |
| `privateDomain` | `string \| null` | No | Hostname on the environment's private network, e.g. \<name>.railway.internal, reachable on any port from services in that environment. Null when the VM is isolated or its private endpoint isn't registered yet. |
| `region` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |

> [accordion] domains full type
>
> ```ts theme={null}
> {
>   domain?: string | null,
>   port?: number | null,
>   prefix?: string | null
> }[] | null
> ```

***

### heartbeat

`sandboxes.heartbeat`

Extend a sandbox's lifetime

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.sandboxes.heartbeat({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `domains` | `object[] \| null` | No | Railway-provided public HTTP domains whose routes have been published. |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `idleTimeoutMinutes` | `number \| null` | No | Minutes of inactivity before the sandbox is destroyed. 0 means it never idles out; null means unknown, including for a destroyed sandbox. |
| `networkIsolation` | `string \| null` | No | Controls a sandbox's access to the environment's private network. |
| `privateDomain` | `string \| null` | No | Hostname on the environment's private network, e.g. \<name>.railway.internal, reachable on any port from services in that environment. Null when the VM is isolated or its private endpoint isn't registered yet. |
| `region` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |

> [accordion] domains full type
>
> ```ts theme={null}
> {
>   domain?: string | null,
>   port?: number | null,
>   prefix?: string | null
> }[] | null
> ```

***

### list

`sandboxes.list`

List sandboxes in an environment, newest first. Passing first/after paginates; omitting them returns the full list, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.sandboxes.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `active` | `boolean` | No | true = live sandboxes only (excludes destroyed; FAILED and transitional states are still included), false = destroyed only, omitted = all. |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `environmentId` | `string` | Yes | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   domains?: {
>     domain?: string | null,
>     port?: number | null,
>     prefix?: string | null
>   }[] | null,
>   environmentId?: string | null,
>   id?: string | null,
>   idleTimeoutMinutes?: number | null,
>   networkIsolation?: string | null,
>   privateDomain?: string | null,
>   region?: string | null,
>   status?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### templateBuild

`sandboxes.templateBuild`

Get a template's build state by id (the recipe content hash). READY once its checkpoint exists; BUILDING/FAILED reflect the build workflow

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.sandboxes.templateBuild({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | The template's resolved-content hash. |
| `status` | `string \| null` | No | — |

***

## Sandbox Sessions

### list

`sandboxSessions.list`

Resumable sessions inside a sandbox — interactive shells and one-off exec commands, live or recently exited. Null when the sandbox can't report them (e.g. its vm-init predates session listing), one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.sandboxSessions.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `environmentId` | `string` | Yes | — |
| `first` | `number` | No | — |
| `id` | `string` | Yes | — |
| `last` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   attached?: boolean | null,
>   command?: string | null,
>   createdAt?: string | null,
>   foregroundActive?: boolean | null,
>   kind?: string | null,
>   name?: string | null,
>   runState?: {
>     exitCode?: number | null,
>     exitedAt?: string | null,
>     running?: boolean | null
>   } | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

## Service Domains

### create

`serviceDomains.create`

Creates a new service domain

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.serviceDomains.create({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   serviceId: string,
>   targetPort?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `domain` | `string \| null` | No | — |
| `edgeId` | `string \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `newDomainName` | `string \| null` | No | — |
| `newHostLabel` | `string \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `serviceId` | `string \| null` | No | — |
| `suffix` | `string \| null` | No | — |
| `syncStatus` | `string \| null` | No | — |
| `targetPort` | `number \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

***

### delete

`serviceDomains.delete`

Deletes a service domain

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

```ts theme={null}
await corsair.railway.api.serviceDomains.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### isAvailable

`serviceDomains.isAvailable`

Checks if a service domain is available

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.serviceDomains.isAvailable({ domain: 'api.example.com' });
```

**Input**

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

**Output**

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

***

### update

`serviceDomains.update`

Updates a service domain

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.serviceDomains.update({
	input: {
		domain: 'api.example.com',
		environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
		serviceDomainId: '0000000f-5c1e-4d8a-9f43-2b6e1c0a9d17',
		serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   domain: string,
>   environmentId: string,
>   serviceDomainId: string,
>   serviceId: string,
>   targetPort?: number
> }
> ```

**Output:** `boolean`

***

## Service Instances

### autoDeployStatus

`serviceInstances.autoDeployStatus`

Returns the auto-deploy status for a service instance, including whether it can be enabled

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.serviceInstances.autoDeployStatus({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `projectId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `canEnable` | `boolean \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `reason` | `string \| null` | No | — |

***

### clearAutoUpdateSnooze

`serviceInstances.clearAutoUpdateSnooze`

Undo an active auto-update skip for a service instance, applied immediately (no config staging, no redeploy). The recurring maintenance window and update policy are untouched — the next scheduled occurrence fires normally again

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.serviceInstances.clearAutoUpdateSnooze({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `boolean`

***

### deploy

`serviceInstances.deploy`

Deploy the service in an environment from its latest source; the deployment runs on usage-billed compute

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.serviceInstances.deploy({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `commitSha` | `string` | No | — |
| `environmentId` | `string` | Yes | — |
| `latestCommit` | `boolean` | No | — |
| `serviceId` | `string` | Yes | — |

**Output:** `boolean`

***

### deployV2

`serviceInstances.deployV2`

Deploy the service in an environment from its latest source (or a commit) and return the new deployment id; runs on usage-billed compute

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.serviceInstances.deployV2({ serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17', environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `commitSha` | `string` | No | — |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `string`

***

### dismissVulnRemediation

`serviceInstances.dismissVulnRemediation`

Dismiss a pending database security update and cancel its scheduled redeploy

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.serviceInstances.dismissVulnRemediation({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `boolean`

***

### get

`serviceInstances.get`

Get a service instance belonging to a service and environment

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.serviceInstances.get({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `activeDeployments` | `object[] \| null` | No | All currently active (deployed and running) deployments for this service instance |
| `autoInstrumentationEnabled` | `boolean \| null` | No | Instrument the service's processes with eBPF (OBI) for supported runtimes, no code changes. Only active while tracingEnabled is true. |
| `buildCommand` | `string \| null` | No | — |
| `builder` | `string \| null` | No | — |
| `clearance` | `boolean \| null` | No | This service's own Railway Authentication setting. Null means no setting of its own: it follows the environment's default (see clearanceEffective). |
| `clearanceEffective` | `boolean \| null` | No | Whether Railway Authentication protects this service's HTTP domains: its own setting, else its environment's default. |
| `createdAt` | `string \| null` | No | — |
| `cronSchedule` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `dockerfilePath` | `string \| null` | No | — |
| `drainingSeconds` | `number \| null` | No | — |
| `edgeConfig` | `object \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `hasEverDeployed` | `boolean \| null` | No | Whether any deployment was ever created for this service instance, including deployments that have since been removed. Distinguishes a service that was torn down (all deployments removed) from one that has never deployed — latestDeployment and activeDeployments are null/empty for both. |
| `healthcheckPath` | `string \| null` | No | — |
| `healthcheckTimeout` | `number \| null` | No | — |
| `hideUnhealthyReplicas` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `ipv6EgressEnabled` | `boolean \| null` | No | — |
| `isUpdatable` | `boolean \| null` | No | — |
| `latestDeployment` | `object \| null` | No | — |
| `nextCronRunAt` | `string \| null` | No | — |
| `nixpacksPlan` | `any \| null` | No | — |
| `numReplicas` | `number \| null` | No | — |
| `overlapSeconds` | `number \| null` | No | — |
| `preDeployCommand` | `any \| null` | No | — |
| `preDeployTimeoutSeconds` | `number \| null` | No | — |
| `railpackInfo` | `any \| null` | No | — |
| `railwayConfigFile` | `string \| null` | No | — |
| `region` | `string \| null` | No | — |
| `resolvedFileConfig` | `object \| null` | No | The repo config file as of the most recent deployment that read it. |
| `restartPolicyMaxRetries` | `number \| null` | No | — |
| `restartPolicyType` | `string \| null` | No | — |
| `rootDirectory` | `string \| null` | No | — |
| `service` | `object \| null` | No | — |
| `serviceId` | `string \| null` | No | — |
| `serviceName` | `string \| null` | No | — |
| `sleepApplication` | `boolean \| null` | No | — |
| `source` | `object \| null` | No | — |
| `startCommand` | `string \| null` | No | — |
| `tracingEnabled` | `boolean \| null` | No | Trace requests to the service in this environment: the edge records a span per client-facing request to its domains and the next deploy provides the OpenTelemetry exporter variables. |
| `updatedAt` | `string \| null` | No | — |
| `upstreamUrl` | `string \| null` | No | — |
| `watchPatterns` | `string[] \| null` | No | — |

> [accordion] activeDeployments full type
>
> ```ts theme={null}
> {
>   canRedeploy?: boolean | null,
>   canRollback?: boolean | null,
>   createdAt?: string | null,
>   deploymentStopped?: boolean | null,
>   diagnosis?: any | null,
>   environmentId?: string | null,
>   id?: string | null,
>   isArchived?: boolean | null,
>   meta?: any | null,
>   projectId?: string | null,
>   serviceId?: string | null,
>   snapshotId?: string | null,
>   staticUrl?: string | null,
>   status?: string | null,
>   statusUpdatedAt?: string | null,
>   suggestAddServiceDomain?: boolean | null,
>   updatedAt?: string | null,
>   url?: string | null
> }[] | null
> ```

> [accordion] edgeConfig full type
>
> ```ts theme={null}
> {
>   edgeRules?: any | null,
>   enabled?: boolean | null,
>   id?: string | null,
>   overrides?: any | null,
>   purgeEpoch?: number | null,
>   purgeEpochByKind?: any | null,
>   underAttackModeUntil?: number | null
> } | null
> ```

> [accordion] latestDeployment full type
>
> ```ts theme={null}
> {
>   canRedeploy?: boolean | null,
>   canRollback?: boolean | null,
>   createdAt?: string | null,
>   deploymentStopped?: boolean | null,
>   diagnosis?: any | null,
>   environmentId?: string | null,
>   id?: string | null,
>   isArchived?: boolean | null,
>   meta?: any | null,
>   projectId?: string | null,
>   serviceId?: string | null,
>   snapshotId?: string | null,
>   staticUrl?: string | null,
>   status?: string | null,
>   statusUpdatedAt?: string | null,
>   suggestAddServiceDomain?: boolean | null,
>   updatedAt?: string | null,
>   url?: string | null
> } | null
> ```

> [accordion] resolvedFileConfig full type
>
> ```ts theme={null}
> {
>   commitHash?: string | null,
>   configFile?: string | null,
>   deploymentId?: string | null,
>   fileManifest?: any | null,
>   propertyFileMapping?: any | null,
>   repo?: string | null,
>   resolvedAt?: string | null
> } | null
> ```

> [accordion] service full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   featureFlags?: string[] | null,
>   groupId?: string | null,
>   hasHiddenRegistryCredentialsFromTemplate?: boolean | null,
>   icon?: string | null,
>   id?: string | null,
>   isRestricted?: boolean | null,
>   kind?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   templateId?: string | null,
>   templateServiceId?: string | null,
>   templateThreadSlug?: string | null,
>   updatedAt?: string | null
> } | null
> ```

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

***

### isUpdatable

`serviceInstances.isUpdatable`

Check if the upstream repo for a service has an update available

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.serviceInstances.isUpdatable({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `boolean`

***

### limitOverride

`serviceInstances.limitOverride`

Get the service instance resource limit overrides (null if no overrides set)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.serviceInstances.limitOverride({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `any`

***

### limits

`serviceInstances.limits`

Get the merged resource limits for a service instance (includes plan defaults)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.serviceInstances.limits({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `any`

***

### patchVulnNow

`serviceInstances.patchVulnNow`

Apply a pending database security update now (backup, then redeploy). Returns the new deployment id

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.serviceInstances.patchVulnNow({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `string`

***

### redeploy

`serviceInstances.redeploy`

Redeploy a service instance

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.serviceInstances.redeploy({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `boolean`

***

### snoozeAutoUpdate

`serviceInstances.snoozeAutoUpdate`

Skip the next scheduled auto-update for a service instance. Takes effect immediately, with no staged change and no redeploy. The maintenance window and update policy stay as they are. This only delays the next scheduled update

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.serviceInstances.snoozeAutoUpdate({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |
| `snoozeDays` | `number` | No | How many days to skip, from now (default 7 — covers any weekly schedule shape). Between 1 and 14. |

**Output:** `boolean`

***

### update

`serviceInstances.update`

Update a service instance

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.serviceInstances.update({
	input: {},
	serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | No | \[Experimental] Environment ID. If the environment is a fork, the service will only be updated in it. Otherwise it will updated in all environments that are not forks of other environments |
| `input` | `object` | Yes | — |
| `serviceId` | `string` | Yes | — |

> [accordion] input full type
>
> ```ts theme={null}
> {
>   autoInstrumentationEnabled?: boolean,
>   buildCommand?: string,
>   builder?: HEROKU | NIXPACKS | PAKETO | RAILPACK,
>   cronSchedule?: string,
>   dockerfilePath?: string,
>   drainingSeconds?: number,
>   healthcheckPath?: string,
>   healthcheckTimeout?: number,
>   hideUnhealthyReplicas?: boolean,
>   ipv6EgressEnabled?: boolean,
>   multiRegionConfig?: any,
>   nixpacksPlan?: any,
>   numReplicas?: number,
>   overlapSeconds?: number,
>   preDeployCommand?: string[],
>   preDeployTimeoutSeconds?: number,
>   railwayConfigFile?: string,
>   region?: string,
>   registryCredentials?: {
>     password: string,
>     username: string
>   },
>   restartPolicyMaxRetries?: number,
>   restartPolicyType?: ALWAYS | NEVER | ON_FAILURE,
>   rootDirectory?: string,
>   sleepApplication?: boolean,
>   source?: {
>     image?: string,
>     repo?: string
>   },
>   startCommand?: string,
>   tracingEnabled?: boolean,
>   watchPatterns?: string[]
> }
> ```

**Output:** `boolean`

***

### updateAutoDeploy

`serviceInstances.updateAutoDeploy`

Enables or disables auto-deploy for a service instance

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.serviceInstances.updateAutoDeploy({
	input: {
		enabled: true,
		environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
		projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17',
		serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   enabled: boolean,
>   environmentId: string,
>   projectId: string,
>   serviceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean \| null` | No | — |

***

### updateAutoUpdateSchedule

`serviceInstances.updateAutoUpdateSchedule`

Update the auto-update maintenance window for a service instance, applied immediately (no config staging, no redeploy). Only the schedule changes — the update policy is untouched

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.serviceInstances.updateAutoUpdateSchedule({
	environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
	schedule: [{ day: 1, endHour: 1, startHour: 1 }],
	serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `schedule` | `object[]` | Yes | The full replacement set of weekly UTC maintenance windows (at least one) |
| `serviceId` | `string` | Yes | — |

> [accordion] schedule full type
>
> ```ts theme={null}
> {
>   day: number,
>   endHour: number,
>   startHour: number
> }[]
> ```

**Output:** `boolean`

***

### updateClearance

`serviceInstances.updateClearance`

Sets a service instance's own Railway Authentication setting: on, off, or none (follow the environment's default). Requires a workspace admin; ending up on also requires the workspace's Railway Authentication entitlement and edge caching off

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.serviceInstances.updateClearance({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   enabled?: boolean,
>   environmentId: string,
>   projectId: string,
>   serviceId: string
> }
> ```

**Output:** `boolean`

***

### updateLimits

`serviceInstances.updateLimits`

Update the resource limits for a service instance

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.serviceInstances.updateLimits({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   memoryGB?: number,
>   serviceId: string,
>   vCPUs?: number
> }
> ```

**Output:** `boolean`

***

## Services

### acknowledgeTakedown

`services.acknowledgeTakedown`

Record that a workspace admin confirms subsequent deployments will exclude the content named in this notice, lifting its persistent takedown restriction. any other restriction on the service, and any other outstanding takedown, still applies. It permits a subsequent deployment; it does not restore an earlier one, and it is not Railway verifying the removal

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.services.acknowledgeTakedown({
	input: { acknowledgmentId: 'example', statement: 'example' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   acknowledgmentId: string,
>   statement: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `acknowledgedAt` | `string \| null` | No | — |
| `acknowledgedBy` | `object \| null` | No | — |
| `acknowledgedStatement` | `string \| null` | No | The attestation exactly as it was worded when it was confirmed. |
| `clearedAt` | `string \| null` | No | — |
| `customerNotice` | `string \| null` | No | — |
| `hasExternalNotice` | `boolean \| null` | No | False when no customer-visible notice beyond the dashboard page was recorded, so the UI can say so rather than implying the original complaint is linked. |
| `headline` | `string \| null` | No | Customer-safe statement of what happened and why. |
| `id` | `string \| null` | No | — |
| `instruction` | `string \| null` | No | What the customer has to do before deploying again. |
| `isApplying` | `boolean \| null` | No | The service teardown has not yet completed; acknowledgment remains unavailable. |
| `noticeKind` | `string \| null` | No | Which complaint a takedown answered. OTHER keeps generic wording rather than asserting a legal basis Railway did not record. |
| `noticeUrl` | `string \| null` | No | Where to read the notice. Always resolvable: it falls back to the dashboard restriction detail page. |
| `restrictionId` | `string \| null` | No | — |
| `statement` | `string \| null` | No | The attestation the customer must explicitly confirm. Opening or reading the notice is not acknowledgment. |
| `status` | `string \| null` | No | — |
| `takenDownAt` | `string \| null` | No | — |

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

***

### addFeatureFlag

`services.addFeatureFlag`

Add a feature flag for a service

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.services.addFeatureFlag({
	input: { flag: 'COPY_VOLUME_TO_ENVIRONMENT', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   flag: COPY_VOLUME_TO_ENVIRONMENT | LIVENESS_CHECKS | PLACEHOLDER | SKIPPED_BUILDS | USE_DEPLOYMENT_VMS,
>   serviceId: string
> }
> ```

**Output:** `boolean`

***

### connect

`services.connect`

Connect a service to a source

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.services.connect({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   branch?: string,
>   image?: string,
>   repo?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `featureFlags` | `string[] \| null` | No | — |
| `groupId` | `string \| null` | No | — |
| `hasHiddenRegistryCredentialsFromTemplate` | `boolean \| null` | No | Whether this service has hidden registry credentials from a template. When true, the credentials are stored in the template and used during deployment. |
| `icon` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isRestricted` | `boolean \| null` | No | Whether this service has an active restriction that limits its capabilities. |
| `kind` | `string \| null` | No | What a service is, when it isn't an ordinary service. A Website's builds upload a release that the edge serves. |
| `name` | `string \| null` | No | — |
| `pendingTakedownAcknowledgment` | `object \| null` | No | A takedown notice the customer must acknowledge before the service can deploy again. |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `takedownAcknowledgments` | `object[] \| null` | No | Every takedown requirement this service has had, newest first, outstanding or cleared. Retained after the service deploys again so the history survives the redeploy it permitted. |
| `templateId` | `string \| null` | No | — |
| `templateServiceId` | `string \| null` | No | — |
| `templateThreadSlug` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] pendingTakedownAcknowledgment full type
>
> ```ts theme={null}
> {
>   acknowledgedAt?: string | null,
>   acknowledgedStatement?: string | null,
>   clearedAt?: string | null,
>   customerNotice?: string | null,
>   hasExternalNotice?: boolean | null,
>   headline?: string | null,
>   id?: string | null,
>   instruction?: string | null,
>   isApplying?: boolean | null,
>   noticeKind?: string | null,
>   noticeUrl?: string | null,
>   restrictionId?: string | null,
>   statement?: string | null,
>   status?: string | null,
>   takenDownAt?: string | null
> } | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

> [accordion] takedownAcknowledgments full type
>
> ```ts theme={null}
> {
>   acknowledgedAt?: string | null,
>   acknowledgedStatement?: string | null,
>   clearedAt?: string | null,
>   customerNotice?: string | null,
>   hasExternalNotice?: boolean | null,
>   headline?: string | null,
>   id?: string | null,
>   instruction?: string | null,
>   isApplying?: boolean | null,
>   noticeKind?: string | null,
>   noticeUrl?: string | null,
>   restrictionId?: string | null,
>   statement?: string | null,
>   status?: string | null,
>   takenDownAt?: string | null
> }[] | null
> ```

***

### create

`services.create`

Create a service in a project from an image or a GitHub repo (source); a service with a source deploys right away and uses credits

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.services.create({
	input: {
		projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17',
		name: 'web',
		source: { image: 'nginx:alpine' },
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   branch?: string,
>   environmentId?: string,
>   icon?: string,
>   kind?: WEBSITE,
>   name?: string,
>   projectId: string,
>   registryCredentials?: {
>     password: string,
>     username: string
>   },
>   source?: {
>     image?: string,
>     repo?: string
>   },
>   templateId?: string,
>   templateServiceId?: string,
>   variables?: Record<string, string>
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `featureFlags` | `string[] \| null` | No | — |
| `groupId` | `string \| null` | No | — |
| `hasHiddenRegistryCredentialsFromTemplate` | `boolean \| null` | No | Whether this service has hidden registry credentials from a template. When true, the credentials are stored in the template and used during deployment. |
| `icon` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isRestricted` | `boolean \| null` | No | Whether this service has an active restriction that limits its capabilities. |
| `kind` | `string \| null` | No | What a service is, when it isn't an ordinary service. A Website's builds upload a release that the edge serves. |
| `name` | `string \| null` | No | — |
| `pendingTakedownAcknowledgment` | `object \| null` | No | A takedown notice the customer must acknowledge before the service can deploy again. |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `takedownAcknowledgments` | `object[] \| null` | No | Every takedown requirement this service has had, newest first, outstanding or cleared. Retained after the service deploys again so the history survives the redeploy it permitted. |
| `templateId` | `string \| null` | No | — |
| `templateServiceId` | `string \| null` | No | — |
| `templateThreadSlug` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] pendingTakedownAcknowledgment full type
>
> ```ts theme={null}
> {
>   acknowledgedAt?: string | null,
>   acknowledgedStatement?: string | null,
>   clearedAt?: string | null,
>   customerNotice?: string | null,
>   hasExternalNotice?: boolean | null,
>   headline?: string | null,
>   id?: string | null,
>   instruction?: string | null,
>   isApplying?: boolean | null,
>   noticeKind?: string | null,
>   noticeUrl?: string | null,
>   restrictionId?: string | null,
>   statement?: string | null,
>   status?: string | null,
>   takenDownAt?: string | null
> } | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

> [accordion] takedownAcknowledgments full type
>
> ```ts theme={null}
> {
>   acknowledgedAt?: string | null,
>   acknowledgedStatement?: string | null,
>   clearedAt?: string | null,
>   customerNotice?: string | null,
>   hasExternalNotice?: boolean | null,
>   headline?: string | null,
>   id?: string | null,
>   instruction?: string | null,
>   isApplying?: boolean | null,
>   noticeKind?: string | null,
>   noticeUrl?: string | null,
>   restrictionId?: string | null,
>   statement?: string | null,
>   status?: string | null,
>   takenDownAt?: string | null
> }[] | null
> ```

***

### delete

`services.delete`

Deletes a service

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

```ts theme={null}
await corsair.railway.api.services.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | No | Environment ID. When set, the service is deleted only in that environment; the service itself is deleted once no instances remain in any environment. When omitted, the service is deleted in every environment that is not a fork of another environment. |
| `id` | `string` | Yes | — |

**Output:** `boolean`

***

### disableCdn

`services.disableCdn`

Disables CDN for a service, soft-deleting the edge config

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.services.disableCdn({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   serviceId: string
> }
> ```

**Output:** `boolean`

***

### disconnect

`services.disconnect`

Disconnect a service from a repo

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.services.disconnect({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `featureFlags` | `string[] \| null` | No | — |
| `groupId` | `string \| null` | No | — |
| `hasHiddenRegistryCredentialsFromTemplate` | `boolean \| null` | No | Whether this service has hidden registry credentials from a template. When true, the credentials are stored in the template and used during deployment. |
| `icon` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isRestricted` | `boolean \| null` | No | Whether this service has an active restriction that limits its capabilities. |
| `kind` | `string \| null` | No | What a service is, when it isn't an ordinary service. A Website's builds upload a release that the edge serves. |
| `name` | `string \| null` | No | — |
| `pendingTakedownAcknowledgment` | `object \| null` | No | A takedown notice the customer must acknowledge before the service can deploy again. |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `takedownAcknowledgments` | `object[] \| null` | No | Every takedown requirement this service has had, newest first, outstanding or cleared. Retained after the service deploys again so the history survives the redeploy it permitted. |
| `templateId` | `string \| null` | No | — |
| `templateServiceId` | `string \| null` | No | — |
| `templateThreadSlug` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] pendingTakedownAcknowledgment full type
>
> ```ts theme={null}
> {
>   acknowledgedAt?: string | null,
>   acknowledgedStatement?: string | null,
>   clearedAt?: string | null,
>   customerNotice?: string | null,
>   hasExternalNotice?: boolean | null,
>   headline?: string | null,
>   id?: string | null,
>   instruction?: string | null,
>   isApplying?: boolean | null,
>   noticeKind?: string | null,
>   noticeUrl?: string | null,
>   restrictionId?: string | null,
>   statement?: string | null,
>   status?: string | null,
>   takenDownAt?: string | null
> } | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

> [accordion] takedownAcknowledgments full type
>
> ```ts theme={null}
> {
>   acknowledgedAt?: string | null,
>   acknowledgedStatement?: string | null,
>   clearedAt?: string | null,
>   customerNotice?: string | null,
>   hasExternalNotice?: boolean | null,
>   headline?: string | null,
>   id?: string | null,
>   instruction?: string | null,
>   isApplying?: boolean | null,
>   noticeKind?: string | null,
>   noticeUrl?: string | null,
>   restrictionId?: string | null,
>   statement?: string | null,
>   status?: string | null,
>   takenDownAt?: string | null
> }[] | null
> ```

***

### enableCdn

`services.enableCdn`

Enables CDN for a service, creating an edge config and attaching all live domains

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.services.enableCdn({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   config?: {
>     caching?: {
>       defaultTtlSeconds?: number,
>       htmlCaching?: string,
>       mode?: string,
>       purgeOnDeploy?: ALL | HTML | OFF,
>       staleWhileRevalidate?: {
>         enabled: boolean
>       }
>     }
>   },
>   environmentId: string,
>   serviceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `caching` | `object \| null` | No | — |
| `edgeRules` | `any \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `overrides` | `any \| null` | No | — |
| `purgeEpoch` | `number \| null` | No | — |
| `purgeEpochByKind` | `any \| null` | No | — |
| `tracing` | `object \| null` | No | — |
| `underAttackModeUntil` | `number \| null` | No | — |

> [accordion] caching full type
>
> ```ts theme={null}
> {
>   defaultTtlSeconds?: number | null,
>   htmlCaching?: string | null,
>   mode?: string | null,
>   purgeOnDeploy?: string | null
> } | null
> ```

> [accordion] tracing full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   sampleRate?: number | null
> } | null
> ```

***

### generateShellToken

`services.generateShellToken`

Creates a short-lived (5-minute) token for opening a shell, file, or network session to a running deployment

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.services.generateShellToken({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', instanceId: 'example', scope: 'example' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   instanceId: string,
>   kind?: string,
>   port?: number,
>   scope: string,
>   serviceId?: string
> }
> ```

**Output:** `string`

***

### get

`services.get`

Get a service by ID

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.services.get({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `featureFlags` | `string[] \| null` | No | — |
| `groupId` | `string \| null` | No | — |
| `hasHiddenRegistryCredentialsFromTemplate` | `boolean \| null` | No | Whether this service has hidden registry credentials from a template. When true, the credentials are stored in the template and used during deployment. |
| `icon` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isRestricted` | `boolean \| null` | No | Whether this service has an active restriction that limits its capabilities. |
| `kind` | `string \| null` | No | What a service is, when it isn't an ordinary service. A Website's builds upload a release that the edge serves. |
| `name` | `string \| null` | No | — |
| `pendingTakedownAcknowledgment` | `object \| null` | No | A takedown notice the customer must acknowledge before the service can deploy again. |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `takedownAcknowledgments` | `object[] \| null` | No | Every takedown requirement this service has had, newest first, outstanding or cleared. Retained after the service deploys again so the history survives the redeploy it permitted. |
| `templateId` | `string \| null` | No | — |
| `templateServiceId` | `string \| null` | No | — |
| `templateThreadSlug` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] pendingTakedownAcknowledgment full type
>
> ```ts theme={null}
> {
>   acknowledgedAt?: string | null,
>   acknowledgedStatement?: string | null,
>   clearedAt?: string | null,
>   customerNotice?: string | null,
>   hasExternalNotice?: boolean | null,
>   headline?: string | null,
>   id?: string | null,
>   instruction?: string | null,
>   isApplying?: boolean | null,
>   noticeKind?: string | null,
>   noticeUrl?: string | null,
>   restrictionId?: string | null,
>   statement?: string | null,
>   status?: string | null,
>   takenDownAt?: string | null
> } | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

> [accordion] takedownAcknowledgments full type
>
> ```ts theme={null}
> {
>   acknowledgedAt?: string | null,
>   acknowledgedStatement?: string | null,
>   clearedAt?: string | null,
>   customerNotice?: string | null,
>   hasExternalNotice?: boolean | null,
>   headline?: string | null,
>   id?: string | null,
>   instruction?: string | null,
>   isApplying?: boolean | null,
>   noticeKind?: string | null,
>   noticeUrl?: string | null,
>   restrictionId?: string | null,
>   statement?: string | null,
>   status?: string | null,
>   takenDownAt?: string | null
> }[] | null
> ```

***

### purgeCache

`services.purgeCache`

Purges the CDN cache for a service. Bumps the edge config's purge epoch so every edge node treats prior cached entries as stale on next request. Idempotent; returns true even if CDN is disabled for the service

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.services.purgeCache({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', scope: 'ALL', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   scope: ALL | HTML,
>   serviceId: string
> }
> ```

**Output:** `boolean`

***

### removeFeatureFlag

`services.removeFeatureFlag`

Remove a feature flag for a service

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.services.removeFeatureFlag({
	input: { flag: 'COPY_VOLUME_TO_ENVIRONMENT', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   flag: COPY_VOLUME_TO_ENVIRONMENT | LIVENESS_CHECKS | PLACEHOLDER | SKIPPED_BUILDS | USE_DEPLOYMENT_VMS,
>   serviceId: string
> }
> ```

**Output:** `boolean`

***

### removeUpstreamUrl

`services.removeUpstreamUrl`

Remove the upstream URL from all service instances for this service

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.services.removeUpstreamUrl({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `featureFlags` | `string[] \| null` | No | — |
| `groupId` | `string \| null` | No | — |
| `hasHiddenRegistryCredentialsFromTemplate` | `boolean \| null` | No | Whether this service has hidden registry credentials from a template. When true, the credentials are stored in the template and used during deployment. |
| `icon` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isRestricted` | `boolean \| null` | No | Whether this service has an active restriction that limits its capabilities. |
| `kind` | `string \| null` | No | What a service is, when it isn't an ordinary service. A Website's builds upload a release that the edge serves. |
| `name` | `string \| null` | No | — |
| `pendingTakedownAcknowledgment` | `object \| null` | No | A takedown notice the customer must acknowledge before the service can deploy again. |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `takedownAcknowledgments` | `object[] \| null` | No | Every takedown requirement this service has had, newest first, outstanding or cleared. Retained after the service deploys again so the history survives the redeploy it permitted. |
| `templateId` | `string \| null` | No | — |
| `templateServiceId` | `string \| null` | No | — |
| `templateThreadSlug` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] pendingTakedownAcknowledgment full type
>
> ```ts theme={null}
> {
>   acknowledgedAt?: string | null,
>   acknowledgedStatement?: string | null,
>   clearedAt?: string | null,
>   customerNotice?: string | null,
>   hasExternalNotice?: boolean | null,
>   headline?: string | null,
>   id?: string | null,
>   instruction?: string | null,
>   isApplying?: boolean | null,
>   noticeKind?: string | null,
>   noticeUrl?: string | null,
>   restrictionId?: string | null,
>   statement?: string | null,
>   status?: string | null,
>   takenDownAt?: string | null
> } | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

> [accordion] takedownAcknowledgments full type
>
> ```ts theme={null}
> {
>   acknowledgedAt?: string | null,
>   acknowledgedStatement?: string | null,
>   clearedAt?: string | null,
>   customerNotice?: string | null,
>   hasExternalNotice?: boolean | null,
>   headline?: string | null,
>   id?: string | null,
>   instruction?: string | null,
>   isApplying?: boolean | null,
>   noticeKind?: string | null,
>   noticeUrl?: string | null,
>   restrictionId?: string | null,
>   statement?: string | null,
>   status?: string | null,
>   takenDownAt?: string | null
> }[] | null
> ```

***

### setUnderAttackMode

`services.setUnderAttackMode`

Enables or disables Under Attack Mode for a service. While enabled, the edge serves a browser challenge to unverified visitors of the service's edge-routed domains; non-browser clients (APIs, webhooks) without a clearance cookie are rejected with a 429. Optionally time-boxed via durationSeconds, after which the mode disarms automatically

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.services.setUnderAttackMode({
	input: { enabled: true, environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   durationSeconds?: number,
>   enabled: boolean,
>   environmentId: string,
>   serviceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `caching` | `object \| null` | No | — |
| `edgeRules` | `any \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `overrides` | `any \| null` | No | — |
| `purgeEpoch` | `number \| null` | No | — |
| `purgeEpochByKind` | `any \| null` | No | — |
| `tracing` | `object \| null` | No | — |
| `underAttackModeUntil` | `number \| null` | No | — |

> [accordion] caching full type
>
> ```ts theme={null}
> {
>   defaultTtlSeconds?: number | null,
>   htmlCaching?: string | null,
>   mode?: string | null,
>   purgeOnDeploy?: string | null
> } | null
> ```

> [accordion] tracing full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   sampleRate?: number | null
> } | null
> ```

***

### update

`services.update`

Updates a service

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.services.update({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   icon?: string,
>   name?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `featureFlags` | `string[] \| null` | No | — |
| `groupId` | `string \| null` | No | — |
| `hasHiddenRegistryCredentialsFromTemplate` | `boolean \| null` | No | Whether this service has hidden registry credentials from a template. When true, the credentials are stored in the template and used during deployment. |
| `icon` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isRestricted` | `boolean \| null` | No | Whether this service has an active restriction that limits its capabilities. |
| `kind` | `string \| null` | No | What a service is, when it isn't an ordinary service. A Website's builds upload a release that the edge serves. |
| `name` | `string \| null` | No | — |
| `pendingTakedownAcknowledgment` | `object \| null` | No | A takedown notice the customer must acknowledge before the service can deploy again. |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |
| `takedownAcknowledgments` | `object[] \| null` | No | Every takedown requirement this service has had, newest first, outstanding or cleared. Retained after the service deploys again so the history survives the redeploy it permitted. |
| `templateId` | `string \| null` | No | — |
| `templateServiceId` | `string \| null` | No | — |
| `templateThreadSlug` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] pendingTakedownAcknowledgment full type
>
> ```ts theme={null}
> {
>   acknowledgedAt?: string | null,
>   acknowledgedStatement?: string | null,
>   clearedAt?: string | null,
>   customerNotice?: string | null,
>   hasExternalNotice?: boolean | null,
>   headline?: string | null,
>   id?: string | null,
>   instruction?: string | null,
>   isApplying?: boolean | null,
>   noticeKind?: string | null,
>   noticeUrl?: string | null,
>   restrictionId?: string | null,
>   statement?: string | null,
>   status?: string | null,
>   takenDownAt?: string | null
> } | null
> ```

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

> [accordion] takedownAcknowledgments full type
>
> ```ts theme={null}
> {
>   acknowledgedAt?: string | null,
>   acknowledgedStatement?: string | null,
>   clearedAt?: string | null,
>   customerNotice?: string | null,
>   hasExternalNotice?: boolean | null,
>   headline?: string | null,
>   id?: string | null,
>   instruction?: string | null,
>   isApplying?: boolean | null,
>   noticeKind?: string | null,
>   noticeUrl?: string | null,
>   restrictionId?: string | null,
>   statement?: string | null,
>   status?: string | null,
>   takenDownAt?: string | null
> }[] | null
> ```

***

### updateEdgeConfig

`services.updateEdgeConfig`

Updates the edge config (caching settings) for a service

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.services.updateEdgeConfig({
	input: {
		config: {},
		environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
		serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   config: {
>     caching?: {
>       defaultTtlSeconds?: number,
>       htmlCaching?: string,
>       mode?: string,
>       purgeOnDeploy?: ALL | HTML | OFF,
>       staleWhileRevalidate?: {
>         enabled: boolean
>       }
>     }
>   },
>   environmentId: string,
>   serviceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `caching` | `object \| null` | No | — |
| `edgeRules` | `any \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `overrides` | `any \| null` | No | — |
| `purgeEpoch` | `number \| null` | No | — |
| `purgeEpochByKind` | `any \| null` | No | — |
| `tracing` | `object \| null` | No | — |
| `underAttackModeUntil` | `number \| null` | No | — |

> [accordion] caching full type
>
> ```ts theme={null}
> {
>   defaultTtlSeconds?: number | null,
>   htmlCaching?: string | null,
>   mode?: string | null,
>   purgeOnDeploy?: string | null
> } | null
> ```

> [accordion] tracing full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   sampleRate?: number | null
> } | null
> ```

***

### updateEdgeRules

`services.updateEdgeRules`

Replaces the service's edge rules (whole-section replace; null clears). Rules are boolean expressions over request attributes plus one action (block/allow/challenge/redirect/cache\_override), evaluated at the edge before requests reach the service. The ruleset is validated server-side; invalid rulesets are rejected with per-rule diagnostics and nothing is written. Rules without an id get a server-assigned stable `rul_` id

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.services.updateEdgeRules({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   edgeRules?: any,
>   environmentId: string,
>   serviceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `caching` | `object \| null` | No | — |
| `edgeRules` | `any \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `overrides` | `any \| null` | No | — |
| `purgeEpoch` | `number \| null` | No | — |
| `purgeEpochByKind` | `any \| null` | No | — |
| `tracing` | `object \| null` | No | — |
| `underAttackModeUntil` | `number \| null` | No | — |

> [accordion] caching full type
>
> ```ts theme={null}
> {
>   defaultTtlSeconds?: number | null,
>   htmlCaching?: string | null,
>   mode?: string | null,
>   purgeOnDeploy?: string | null
> } | null
> ```

> [accordion] tracing full type
>
> ```ts theme={null}
> {
>   enabled?: boolean | null,
>   sampleRate?: number | null
> } | null
> ```

***

### updateKind

`services.updateKind`

Makes an ordinary service a Website (kind WEBSITE) and redeploys it in every environment where it has a deployment. A Website can't be made an ordinary service (kind null) yet. Returns false when the service already has that kind

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.services.updateKind({
	input: { serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   kind?: WEBSITE,
>   serviceId: string
> }
> ```

**Output:** `boolean`

***

### validateEdgeRules

`services.validateEdgeRules`

Validates an edge ruleset without writing it — returns the same diagnostics updateServiceEdgeRules would reject with (empty list = valid). For live feedback in rule editors

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.services.validateEdgeRules({
	input: { edgeRules: 'example', environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   edgeRules: any,
>   environmentId: string,
>   serviceId: string
> }
> ```

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   message?: string | null,
>   path?: string | null
> }[]
> ```

***

## Sessions

### delete

`sessions.delete`

Deletes a session

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

```ts theme={null}
await corsair.railway.api.sessions.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### list

`sessions.list`

Gets all sessions for authenticated user, one page at a time (first/after)

**Risk:** `read`

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

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

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

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

## Shared Variables

### configure

`sharedVariables.configure`

Configure a shared variable

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.sharedVariables.configure({
	input: {
		disabledServiceIds: ['example'],
		enabledServiceIds: ['example'],
		environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
		name: 'api',
		projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   disabledServiceIds: string[],
>   enabledServiceIds: string[],
>   environmentId: string,
>   name: string,
>   projectId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `environment` | `object \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isSealed` | `boolean \| null` | No | — |
| `name` | `string \| null` | No | — |
| `plugin` | `object \| null` | No | — |
| `references` | `string[] \| null` | No | — |
| `service` | `object \| null` | No | — |
| `serviceId` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] plugin full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   deprecatedAt?: string | null,
>   friendlyName?: string | null,
>   id?: string | null,
>   logsEnabled?: boolean | null,
>   migrationDatabaseServiceId?: string | null,
>   name?: string | null,
>   status?: string | null
> } | null
> ```

> [accordion] service full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   featureFlags?: string[] | null,
>   groupId?: string | null,
>   hasHiddenRegistryCredentialsFromTemplate?: boolean | null,
>   icon?: string | null,
>   id?: string | null,
>   isRestricted?: boolean | null,
>   kind?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   templateId?: string | null,
>   templateServiceId?: string | null,
>   templateThreadSlug?: string | null,
>   updatedAt?: string | null
> } | null
> ```

***

## Signals

### changes

`signals.changes`

Recent audit log entries for a signal

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.signals.changes({ name: 'api' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | — |
| `name` | `string` | Yes | — |
| `owner` | `string` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   authorId?: string | null,
>   createdAt?: string | null,
>   id?: string | null,
>   kind?: string | null,
>   payload?: any | null,
>   prevState?: any | null,
>   seq?: number | string | null,
>   signalId?: string | null
> }[]
> ```

***

### create

`signals.create`

Register a new signal for an owner scope

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.signals.create({
	input: {
		default: 'example',
		name: 'api',
		owner: 'example',
		type: 'bool',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   default: any,
>   name: string,
>   owner: string,
>   type: bool | json | number | string,
>   writableBy?: string[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `createdBy` | `string \| null` | No | — |
| `default` | `any \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `owner` | `string \| null` | No | — |
| `rules` | `any \| null` | No | — |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `version` | `number \| string \| null` | No | — |
| `writableBy` | `string[] \| null` | No | — |

***

### delete

`signals.delete`

Delete a signal and its audit log

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

```ts theme={null}
await corsair.railway.api.signals.delete({
	input: { name: 'api', owner: 'example' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   name: string,
>   owner: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `createdBy` | `string \| null` | No | — |
| `default` | `any \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `owner` | `string \| null` | No | — |
| `rules` | `any \| null` | No | — |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `version` | `number \| string \| null` | No | — |
| `writableBy` | `string[] \| null` | No | — |

***

### evaluate

`signals.evaluate`

Evaluate a signal against an evaluation context (pure resolution; does not mutate registry state)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.signals.evaluate({
	context: {},
	name: 'api',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `context` | `object \| any[] \| string \| number \| boolean` | Yes | — |
| `name` | `string` | Yes | — |
| `owner` | `string` | No | — |

> [accordion] context full type
>
> ```ts theme={null}
> {
> } | any[] | string | number | boolean
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `reason` | `string \| null` | No | — |
| `trace` | `any \| null` | No | — |
| `value` | `any \| null` | No | — |

***

### get

`signals.get`

Fetch a single signal by owner scope and name

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.signals.get({ name: 'api' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `createdBy` | `string \| null` | No | — |
| `default` | `any \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `owner` | `string \| null` | No | — |
| `rules` | `any \| null` | No | — |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `version` | `number \| string \| null` | No | — |
| `writableBy` | `string[] \| null` | No | — |

***

### list

`signals.list`

List signals registered for an owner scope

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.signals.list({});
```

**Input**

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

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   createdBy?: string | null,
>   default?: any | null,
>   id?: string | null,
>   name?: string | null,
>   owner?: string | null,
>   rules?: any | null,
>   type?: string | null,
>   updatedAt?: string | null,
>   version?: number | string | null,
>   writableBy?: string[] | null
> }[]
> ```

***

### replace

`signals.replace`

Replace a signal's type and default, clearing all rules. Destructive — intended for CLI --force re-type

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.signals.replace({
	input: {
		default: 'example',
		name: 'api',
		owner: 'example',
		type: 'bool',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   default: any,
>   name: string,
>   owner: string,
>   type: bool | json | number | string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `createdBy` | `string \| null` | No | — |
| `default` | `any \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `owner` | `string \| null` | No | — |
| `rules` | `any \| null` | No | — |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `version` | `number \| string \| null` | No | — |
| `writableBy` | `string[] \| null` | No | — |

***

### rollback

`signals.rollback`

Restore a signal to the snapshot captured before a change (reads prevState from the target change row)

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.signals.rollback({
	input: { name: 'api', owner: 'example', seq: 1 },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   name: string,
>   owner: string,
>   seq: number | string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `createdBy` | `string \| null` | No | — |
| `default` | `any \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `owner` | `string \| null` | No | — |
| `rules` | `any \| null` | No | — |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `version` | `number \| string \| null` | No | — |
| `writableBy` | `string[] \| null` | No | — |

***

### setDefault

`signals.setDefault`

Change a signal's canonical default (production floor)

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.signals.setDefault({
	input: { default: 'example', name: 'api', owner: 'example' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   default: any,
>   name: string,
>   owner: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `createdBy` | `string \| null` | No | — |
| `default` | `any \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `owner` | `string \| null` | No | — |
| `rules` | `any \| null` | No | — |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `version` | `number \| string \| null` | No | — |
| `writableBy` | `string[] \| null` | No | — |

***

### setRule

`signals.setRule`

Attach or replace a rule on a signal. Matching rules must agree at resolution time or the default is returned

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.signals.setRule({
	input: {
		expression: 'example',
		name: 'api',
		owner: 'example',
		ruleId: 'example',
		value: 'https://api.example.com',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   expression: any,
>   name: string,
>   owner: string,
>   ruleId: string,
>   value: any
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `createdBy` | `string \| null` | No | — |
| `default` | `any \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `owner` | `string \| null` | No | — |
| `rules` | `any \| null` | No | — |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `version` | `number \| string \| null` | No | — |
| `writableBy` | `string[] \| null` | No | — |

***

### unsetRule

`signals.unsetRule`

Remove a rule from a signal

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.signals.unsetRule({
	input: { name: 'api', owner: 'example', ruleId: 'example' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   name: string,
>   owner: string,
>   ruleId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `createdBy` | `string \| null` | No | — |
| `default` | `any \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `owner` | `string \| null` | No | — |
| `rules` | `any \| null` | No | — |
| `type` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `version` | `number \| string \| null` | No | — |
| `writableBy` | `string[] \| null` | No | — |

***

## Ssh Public Keys

### approveSignup

`sshPublicKeys.approveSignup`

Approve an SSH signup: register the offered SSH key on the authenticated account so the agent is recognized. When the key owns an anonymous trial box, claims that trial into workspaceId and re-owns the key

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.sshPublicKeys.approveSignup({ code: 'postgres' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `string` | Yes | — |
| `workspaceId` | `string` | No | — |

**Output:** `boolean`

***

### create

`sshPublicKeys.create`

Creates a new SSH public key. When workspaceId is provided (or omitted under a workspace-scoped API token, in which case it defaults to the token's workspace), the key is owned by the workspace and can be used by anyone authenticating as that workspace via native SSH; requires workspace ADMIN access. Otherwise the key is owned by the authenticated user

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.sshPublicKeys.create({
	input: { name: 'api', publicKey: 'example' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   name: string,
>   publicKey: string,
>   workspaceId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `fingerprint` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `publicKey` | `string \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `userId` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

***

### delete

`sshPublicKeys.delete`

Deletes an SSH public key

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

```ts theme={null}
await corsair.railway.api.sshPublicKeys.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### list

`sshPublicKeys.list`

Gets SSH public keys. If workspaceId is provided, returns the keys owned by that workspace (requires workspace MEMBER access). Under a workspace-scoped API token, workspaceId defaults to the token's workspace when omitted; otherwise returns the authenticated user's personal keys, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.sshPublicKeys.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |
| `workspaceId` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   fingerprint?: string | null,
>   id?: string | null,
>   name?: string | null,
>   publicKey?: string | null,
>   updatedAt?: string | null,
>   userId?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### signupInfo

`sshPublicKeys.signupInfo`

Details for an SSH signup confirm page: the SSH key fingerprint to verify before binding it to the account, and the trial box it owns if any

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.sshPublicKeys.signupInfo({ code: 'postgres' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `claimableWorkspaces` | `object[] \| null` | No | — |
| `fingerprint` | `string \| null` | No | — |
| `origin` | `object \| null` | No | Where the terminal that started an SSH signup connected from. |
| `trial` | `object \| null` | No | The anonymous trial box the offered SSH key currently owns; approving the signup claims it. |

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

> [accordion] origin full type
>
> ```ts theme={null}
> {
>   ip?: string | null,
>   requestedAt?: string | null,
>   sameNetwork?: boolean | null
> } | null
> ```

> [accordion] trial full type
>
> ```ts theme={null}
> {
>   buildExpiresAt?: string | null,
>   cloudAgentId?: string | null,
>   projectId?: string | null,
>   projectName?: string | null
> } | null
> ```

***

## Tcp Proxies

### delete

`tcpProxies.delete`

Deletes a TCP proxy by id

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

```ts theme={null}
await corsair.railway.api.tcpProxies.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### list

`tcpProxies.list`

All TCP proxies for a service instance

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.tcpProxies.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   applicationPort?: number | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   domain?: string | null,
>   environmentId?: string | null,
>   id?: string | null,
>   proxyPort?: number | null,
>   serviceId?: string | null,
>   syncStatus?: string | null,
>   updatedAt?: string | null
> }[]
> ```

***

## Templates

### clone

`templates.clone`

Duplicates an existing template

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.templates.clone({
	input: { code: 'postgres' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   code: string,
>   workspaceId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `activeProjects` | `number \| null` | No | — |
| `canvasConfig` | `any \| null` | No | — |
| `category` | `string \| null` | No | — |
| `code` | `string \| null` | No | — |
| `communityThreadSlug` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `creator` | `object \| null` | No | — |
| `demoProjectId` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `guides` | `object \| null` | No | — |
| `health` | `number \| null` | No | — |
| `id` | `string \| null` | No | — |
| `image` | `string \| null` | No | — |
| `isApproved` | `boolean \| null` | No | — |
| `isOuterEdge` | `boolean \| null` | No | — |
| `isV2Template` | `boolean \| null` | No | — |
| `isVerified` | `boolean \| null` | No | — |
| `languages` | `string[] \| null` | No | — |
| `maintainer` | `object \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projects` | `number \| null` | No | — |
| `publishingAllowance` | `object \| null` | No | How many templates this template's workspace may have live, and how many it has. New publishes are also rate limited per day; that limit is not reported here and surfaces as an error when hit. See [https://docs.railway.com/templates/publish-and-share#publishing-limits](https://docs.railway.com/templates/publish-and-share#publishing-limits) |
| `publishingRestrictionId` | `string \| null` | No | The active restriction stopping this workspace publishing templates, so a restricted author can be sent to the page that explains it and takes the appeal. Null when publishing is not restricted, and for anyone but the template's owner: the `template` query is public, and whether a workspace is under an abuse restriction is not. |
| `readme` | `string \| null` | No | — |
| `recentProjects` | `number \| null` | No | — |
| `serializedConfig` | `any \| null` | No | — |
| `similarTemplates` | `object[] \| null` | No | — |
| `status` | `string \| null` | No | — |
| `supportHealthMetrics` | `any \| null` | No | — |
| `tags` | `string[] \| null` | No | — |
| `totalPayout` | `number \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] creator full type
>
> ```ts theme={null}
> {
>   avatar?: string | null,
>   hasPublicProfile?: boolean | null,
>   name?: string | null,
>   username?: string | null
> } | null
> ```

> [accordion] guides full type
>
> ```ts theme={null}
> {
>   post?: string | null,
>   video?: string | null
> } | null
> ```

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

> [accordion] publishingAllowance full type
>
> ```ts theme={null}
> {
>   blockedReason?: string | null,
>   deployingWorkspaces?: number | null,
>   deployingWorkspacesPerExtraLive?: number | null,
>   liveLimit?: number | null,
>   liveTemplates?: number | null,
>   status?: string | null,
>   workspaceAgeDays?: number | null
> } | null
> ```

> [accordion] similarTemplates full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   createdAt?: string | null,
>   deploys?: number | null,
>   description?: string | null,
>   health?: number | null,
>   image?: string | null,
>   name?: string | null,
>   userId?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

***

### count

`templates.count`

Count all published templates

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.templates.count({});
```

**Input:** *empty object*

**Output:** `number`

***

### delete

`templates.delete`

Deletes a template

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

```ts theme={null}
await corsair.railway.api.templates.delete({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   workspaceId?: string
> }
> ```

**Output:** `boolean`

***

### deploy

`templates.deploy`

Deploy a template (by id or code) into a project and environment; the services it creates run on usage-billed compute

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.templates.deploy({
	input: { serializedConfig: 'example', templateId: '0000000b-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId?: string,
>   existingRootServiceId?: string,
>   projectId?: string,
>   serializedConfig: any,
>   stageOnly?: boolean,
>   templateId: string,
>   workspaceId?: string
> }
> ```

**Output**

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

***

### ejectServiceSource

`templates.ejectServiceSource`

Ejects a service from the template and creates a new repo in the provided org

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.templates.ejectServiceSource({
	input: {
		projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17',
		repoName: 'example',
		repoOwner: 'example',
		serviceIds: ['00000004-5c1e-4d8a-9f43-2b6e1c0a9d17'],
		upstreamUrl: 'example',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   projectId: string,
>   repoName: string,
>   repoOwner: string,
>   serviceIds: string[],
>   upstreamUrl: string
> }
> ```

**Output:** `boolean`

***

### generate

`templates.generate`

Generate a template for a project

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.templates.generate({
	input: { projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId?: string,
>   projectId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `activeProjects` | `number \| null` | No | — |
| `canvasConfig` | `any \| null` | No | — |
| `category` | `string \| null` | No | — |
| `code` | `string \| null` | No | — |
| `communityThreadSlug` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `creator` | `object \| null` | No | — |
| `demoProjectId` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `guides` | `object \| null` | No | — |
| `health` | `number \| null` | No | — |
| `id` | `string \| null` | No | — |
| `image` | `string \| null` | No | — |
| `isApproved` | `boolean \| null` | No | — |
| `isOuterEdge` | `boolean \| null` | No | — |
| `isV2Template` | `boolean \| null` | No | — |
| `isVerified` | `boolean \| null` | No | — |
| `languages` | `string[] \| null` | No | — |
| `maintainer` | `object \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projects` | `number \| null` | No | — |
| `publishingAllowance` | `object \| null` | No | How many templates this template's workspace may have live, and how many it has. New publishes are also rate limited per day; that limit is not reported here and surfaces as an error when hit. See [https://docs.railway.com/templates/publish-and-share#publishing-limits](https://docs.railway.com/templates/publish-and-share#publishing-limits) |
| `publishingRestrictionId` | `string \| null` | No | The active restriction stopping this workspace publishing templates, so a restricted author can be sent to the page that explains it and takes the appeal. Null when publishing is not restricted, and for anyone but the template's owner: the `template` query is public, and whether a workspace is under an abuse restriction is not. |
| `readme` | `string \| null` | No | — |
| `recentProjects` | `number \| null` | No | — |
| `serializedConfig` | `any \| null` | No | — |
| `similarTemplates` | `object[] \| null` | No | — |
| `status` | `string \| null` | No | — |
| `supportHealthMetrics` | `any \| null` | No | — |
| `tags` | `string[] \| null` | No | — |
| `totalPayout` | `number \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] creator full type
>
> ```ts theme={null}
> {
>   avatar?: string | null,
>   hasPublicProfile?: boolean | null,
>   name?: string | null,
>   username?: string | null
> } | null
> ```

> [accordion] guides full type
>
> ```ts theme={null}
> {
>   post?: string | null,
>   video?: string | null
> } | null
> ```

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

> [accordion] publishingAllowance full type
>
> ```ts theme={null}
> {
>   blockedReason?: string | null,
>   deployingWorkspaces?: number | null,
>   deployingWorkspacesPerExtraLive?: number | null,
>   liveLimit?: number | null,
>   liveTemplates?: number | null,
>   status?: string | null,
>   workspaceAgeDays?: number | null
> } | null
> ```

> [accordion] similarTemplates full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   createdAt?: string | null,
>   deploys?: number | null,
>   description?: string | null,
>   health?: number | null,
>   image?: string | null,
>   name?: string | null,
>   userId?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

***

### get

`templates.get`

Get a template by code or ID or GitHub owner and repo

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.templates.get({ code: 'postgres' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `string` | No | — |
| `id` | `string` | No | — |
| `owner` | `string` | No | — |
| `repo` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `activeProjects` | `number \| null` | No | — |
| `canvasConfig` | `any \| null` | No | — |
| `category` | `string \| null` | No | — |
| `code` | `string \| null` | No | — |
| `communityThreadSlug` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `creator` | `object \| null` | No | — |
| `demoProjectId` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `guides` | `object \| null` | No | — |
| `health` | `number \| null` | No | — |
| `id` | `string \| null` | No | — |
| `image` | `string \| null` | No | — |
| `isApproved` | `boolean \| null` | No | — |
| `isOuterEdge` | `boolean \| null` | No | — |
| `isV2Template` | `boolean \| null` | No | — |
| `isVerified` | `boolean \| null` | No | — |
| `languages` | `string[] \| null` | No | — |
| `maintainer` | `object \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projects` | `number \| null` | No | — |
| `publishingAllowance` | `object \| null` | No | How many templates this template's workspace may have live, and how many it has. New publishes are also rate limited per day; that limit is not reported here and surfaces as an error when hit. See [https://docs.railway.com/templates/publish-and-share#publishing-limits](https://docs.railway.com/templates/publish-and-share#publishing-limits) |
| `publishingRestrictionId` | `string \| null` | No | The active restriction stopping this workspace publishing templates, so a restricted author can be sent to the page that explains it and takes the appeal. Null when publishing is not restricted, and for anyone but the template's owner: the `template` query is public, and whether a workspace is under an abuse restriction is not. |
| `readme` | `string \| null` | No | — |
| `recentProjects` | `number \| null` | No | — |
| `serializedConfig` | `any \| null` | No | — |
| `similarTemplates` | `object[] \| null` | No | — |
| `status` | `string \| null` | No | — |
| `supportHealthMetrics` | `any \| null` | No | — |
| `tags` | `string[] \| null` | No | — |
| `totalPayout` | `number \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] creator full type
>
> ```ts theme={null}
> {
>   avatar?: string | null,
>   hasPublicProfile?: boolean | null,
>   name?: string | null,
>   username?: string | null
> } | null
> ```

> [accordion] guides full type
>
> ```ts theme={null}
> {
>   post?: string | null,
>   video?: string | null
> } | null
> ```

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

> [accordion] publishingAllowance full type
>
> ```ts theme={null}
> {
>   blockedReason?: string | null,
>   deployingWorkspaces?: number | null,
>   deployingWorkspacesPerExtraLive?: number | null,
>   liveLimit?: number | null,
>   liveTemplates?: number | null,
>   status?: string | null,
>   workspaceAgeDays?: number | null
> } | null
> ```

> [accordion] similarTemplates full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   createdAt?: string | null,
>   deploys?: number | null,
>   description?: string | null,
>   health?: number | null,
>   image?: string | null,
>   name?: string | null,
>   userId?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

***

### list

`templates.list`

Get all published templates, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.templates.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |
| `recommended` | `boolean` | No | If set to true, only recommended templates will be returned. |
| `verified` | `boolean` | No | If set to true, only verified templates will be returned. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   activeProjects?: number | null,
>   canvasConfig?: any | null,
>   category?: string | null,
>   code?: string | null,
>   communityThreadSlug?: string | null,
>   createdAt?: string | null,
>   creator?: {
>     avatar?: string | null,
>     hasPublicProfile?: boolean | null,
>     name?: string | null,
>     username?: string | null
>   } | null,
>   demoProjectId?: string | null,
>   description?: string | null,
>   guides?: {
>     post?: string | null,
>     video?: string | null
>   } | null,
>   health?: number | null,
>   id?: string | null,
>   image?: string | null,
>   isApproved?: boolean | null,
>   isOuterEdge?: boolean | null,
>   isV2Template?: boolean | null,
>   isVerified?: boolean | null,
>   languages?: string[] | null,
>   maintainer?: {
>     avatar?: string | null,
>     id?: string | null,
>     name?: string | null
>   } | null,
>   name?: string | null,
>   projects?: number | null,
>   publishingAllowance?: {
>     blockedReason?: string | null,
>     deployingWorkspaces?: number | null,
>     deployingWorkspacesPerExtraLive?: number | null,
>     liveLimit?: number | null,
>     liveTemplates?: number | null,
>     status?: string | null,
>     workspaceAgeDays?: number | null
>   } | null,
>   publishingRestrictionId?: string | null,
>   readme?: string | null,
>   recentProjects?: number | null,
>   serializedConfig?: any | null,
>   similarTemplates?: {
>     code?: string | null,
>     createdAt?: string | null,
>     deploys?: number | null,
>     description?: string | null,
>     health?: number | null,
>     image?: string | null,
>     name?: string | null,
>     userId?: string | null,
>     workspaceId?: string | null
>   }[] | null,
>   status?: string | null,
>   supportHealthMetrics?: any | null,
>   tags?: string[] | null,
>   totalPayout?: number | null,
>   updatedAt?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### metrics

`templates.metrics`

Get the metrics for a template

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.templates.metrics({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `activeDeployments` | `number \| null` | No | — |
| `deploymentsLast90Days` | `number \| null` | No | — |
| `earningsLast30Days` | `number \| null` | No | — |
| `earningsLast90Days` | `number \| null` | No | — |
| `eligibleForSupportBonus` | `boolean \| null` | No | — |
| `supportHealth` | `number \| null` | No | — |
| `templateHealth` | `number \| null` | No | — |
| `totalDeployments` | `number \| null` | No | — |
| `totalEarnings` | `number \| null` | No | — |

***

### publish

`templates.publish`

Publishes a template

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.templates.publish({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: { category: 'example', description: 'Corsair example', readme: 'example' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   category: string,
>   demoProjectId?: string,
>   description: string,
>   image?: string,
>   readme: string,
>   workspaceId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `activeProjects` | `number \| null` | No | — |
| `canvasConfig` | `any \| null` | No | — |
| `category` | `string \| null` | No | — |
| `code` | `string \| null` | No | — |
| `communityThreadSlug` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `creator` | `object \| null` | No | — |
| `demoProjectId` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `guides` | `object \| null` | No | — |
| `health` | `number \| null` | No | — |
| `id` | `string \| null` | No | — |
| `image` | `string \| null` | No | — |
| `isApproved` | `boolean \| null` | No | — |
| `isOuterEdge` | `boolean \| null` | No | — |
| `isV2Template` | `boolean \| null` | No | — |
| `isVerified` | `boolean \| null` | No | — |
| `languages` | `string[] \| null` | No | — |
| `maintainer` | `object \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projects` | `number \| null` | No | — |
| `publishingAllowance` | `object \| null` | No | How many templates this template's workspace may have live, and how many it has. New publishes are also rate limited per day; that limit is not reported here and surfaces as an error when hit. See [https://docs.railway.com/templates/publish-and-share#publishing-limits](https://docs.railway.com/templates/publish-and-share#publishing-limits) |
| `publishingRestrictionId` | `string \| null` | No | The active restriction stopping this workspace publishing templates, so a restricted author can be sent to the page that explains it and takes the appeal. Null when publishing is not restricted, and for anyone but the template's owner: the `template` query is public, and whether a workspace is under an abuse restriction is not. |
| `readme` | `string \| null` | No | — |
| `recentProjects` | `number \| null` | No | — |
| `serializedConfig` | `any \| null` | No | — |
| `similarTemplates` | `object[] \| null` | No | — |
| `status` | `string \| null` | No | — |
| `supportHealthMetrics` | `any \| null` | No | — |
| `tags` | `string[] \| null` | No | — |
| `totalPayout` | `number \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] creator full type
>
> ```ts theme={null}
> {
>   avatar?: string | null,
>   hasPublicProfile?: boolean | null,
>   name?: string | null,
>   username?: string | null
> } | null
> ```

> [accordion] guides full type
>
> ```ts theme={null}
> {
>   post?: string | null,
>   video?: string | null
> } | null
> ```

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

> [accordion] publishingAllowance full type
>
> ```ts theme={null}
> {
>   blockedReason?: string | null,
>   deployingWorkspaces?: number | null,
>   deployingWorkspacesPerExtraLive?: number | null,
>   liveLimit?: number | null,
>   liveTemplates?: number | null,
>   status?: string | null,
>   workspaceAgeDays?: number | null
> } | null
> ```

> [accordion] similarTemplates full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   createdAt?: string | null,
>   deploys?: number | null,
>   description?: string | null,
>   health?: number | null,
>   image?: string | null,
>   name?: string | null,
>   userId?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

***

### revert

`templates.revert`

Reverts an HA cluster to standalone mode using template metadata to derive variables to remove

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.templates.revert({
	input: {
		environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
		projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17',
		rootServiceId: 'example',
		templateCode: 'example',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   groupId?: string,
>   projectId: string,
>   rootServiceId: string,
>   stageOnly?: boolean,
>   templateCode: string
> }
> ```

**Output**

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

***

### search

`templates.search`

Search published templates using the backend-ranked template search index, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.templates.search({ query: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `category` | `string` | No | If set, only templates in this category will be returned. |
| `first` | `number` | No | — |
| `last` | `number` | No | — |
| `query` | `string` | Yes | Search term to filter templates. Empty query returns browse-style results. |
| `verified` | `boolean` | No | If set, only templates matching this verification state will be returned. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   creatorName?: string | null,
>   deploymentCount?: number | null,
>   description?: string | null,
>   healthScore?: number | null,
>   id?: string | null,
>   image?: string | null,
>   isVerified?: boolean | null,
>   name?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### sourceForProject

`templates.sourceForProject`

Get the source template for a project

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.templates.sourceForProject({ projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `activeProjects` | `number \| null` | No | — |
| `canvasConfig` | `any \| null` | No | — |
| `category` | `string \| null` | No | — |
| `code` | `string \| null` | No | — |
| `communityThreadSlug` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `creator` | `object \| null` | No | — |
| `demoProjectId` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `guides` | `object \| null` | No | — |
| `health` | `number \| null` | No | — |
| `id` | `string \| null` | No | — |
| `image` | `string \| null` | No | — |
| `isApproved` | `boolean \| null` | No | — |
| `isOuterEdge` | `boolean \| null` | No | — |
| `isV2Template` | `boolean \| null` | No | — |
| `isVerified` | `boolean \| null` | No | — |
| `languages` | `string[] \| null` | No | — |
| `maintainer` | `object \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projects` | `number \| null` | No | — |
| `publishingAllowance` | `object \| null` | No | How many templates this template's workspace may have live, and how many it has. New publishes are also rate limited per day; that limit is not reported here and surfaces as an error when hit. See [https://docs.railway.com/templates/publish-and-share#publishing-limits](https://docs.railway.com/templates/publish-and-share#publishing-limits) |
| `publishingRestrictionId` | `string \| null` | No | The active restriction stopping this workspace publishing templates, so a restricted author can be sent to the page that explains it and takes the appeal. Null when publishing is not restricted, and for anyone but the template's owner: the `template` query is public, and whether a workspace is under an abuse restriction is not. |
| `readme` | `string \| null` | No | — |
| `recentProjects` | `number \| null` | No | — |
| `serializedConfig` | `any \| null` | No | — |
| `similarTemplates` | `object[] \| null` | No | — |
| `status` | `string \| null` | No | — |
| `supportHealthMetrics` | `any \| null` | No | — |
| `tags` | `string[] \| null` | No | — |
| `totalPayout` | `number \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] creator full type
>
> ```ts theme={null}
> {
>   avatar?: string | null,
>   hasPublicProfile?: boolean | null,
>   name?: string | null,
>   username?: string | null
> } | null
> ```

> [accordion] guides full type
>
> ```ts theme={null}
> {
>   post?: string | null,
>   video?: string | null
> } | null
> ```

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

> [accordion] publishingAllowance full type
>
> ```ts theme={null}
> {
>   blockedReason?: string | null,
>   deployingWorkspaces?: number | null,
>   deployingWorkspacesPerExtraLive?: number | null,
>   liveLimit?: number | null,
>   liveTemplates?: number | null,
>   status?: string | null,
>   workspaceAgeDays?: number | null
> } | null
> ```

> [accordion] similarTemplates full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   createdAt?: string | null,
>   deploys?: number | null,
>   description?: string | null,
>   health?: number | null,
>   image?: string | null,
>   name?: string | null,
>   userId?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

***

### unpublish

`templates.unpublish`

Unpublishes a template

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.templates.unpublish({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### updateVolume

`templates.updateVolume`

Sets the default size (in MB) for a volume mount in a template's config. New volumes created when the template is deployed are provisioned at this size, clamped to the deployer's plan maximum. Pass sizeMB: null to clear the pre-size and fall back to the plan default. Editing a template requires maintainer access

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.templates.updateVolume({ serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17', templateId: '0000000b-5c1e-4d8a-9f43-2b6e1c0a9d17', volumeId: '00000007-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `serviceId` | `string` | Yes | — |
| `sizeMB` | `number` | No | — |
| `templateId` | `string` | Yes | — |
| `volumeId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `activeProjects` | `number \| null` | No | — |
| `canvasConfig` | `any \| null` | No | — |
| `category` | `string \| null` | No | — |
| `code` | `string \| null` | No | — |
| `communityThreadSlug` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `creator` | `object \| null` | No | — |
| `demoProjectId` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `guides` | `object \| null` | No | — |
| `health` | `number \| null` | No | — |
| `id` | `string \| null` | No | — |
| `image` | `string \| null` | No | — |
| `isApproved` | `boolean \| null` | No | — |
| `isOuterEdge` | `boolean \| null` | No | — |
| `isV2Template` | `boolean \| null` | No | — |
| `isVerified` | `boolean \| null` | No | — |
| `languages` | `string[] \| null` | No | — |
| `maintainer` | `object \| null` | No | — |
| `name` | `string \| null` | No | — |
| `projects` | `number \| null` | No | — |
| `publishingAllowance` | `object \| null` | No | How many templates this template's workspace may have live, and how many it has. New publishes are also rate limited per day; that limit is not reported here and surfaces as an error when hit. See [https://docs.railway.com/templates/publish-and-share#publishing-limits](https://docs.railway.com/templates/publish-and-share#publishing-limits) |
| `publishingRestrictionId` | `string \| null` | No | The active restriction stopping this workspace publishing templates, so a restricted author can be sent to the page that explains it and takes the appeal. Null when publishing is not restricted, and for anyone but the template's owner: the `template` query is public, and whether a workspace is under an abuse restriction is not. |
| `readme` | `string \| null` | No | — |
| `recentProjects` | `number \| null` | No | — |
| `serializedConfig` | `any \| null` | No | — |
| `similarTemplates` | `object[] \| null` | No | — |
| `status` | `string \| null` | No | — |
| `supportHealthMetrics` | `any \| null` | No | — |
| `tags` | `string[] \| null` | No | — |
| `totalPayout` | `number \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] creator full type
>
> ```ts theme={null}
> {
>   avatar?: string | null,
>   hasPublicProfile?: boolean | null,
>   name?: string | null,
>   username?: string | null
> } | null
> ```

> [accordion] guides full type
>
> ```ts theme={null}
> {
>   post?: string | null,
>   video?: string | null
> } | null
> ```

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

> [accordion] publishingAllowance full type
>
> ```ts theme={null}
> {
>   blockedReason?: string | null,
>   deployingWorkspaces?: number | null,
>   deployingWorkspacesPerExtraLive?: number | null,
>   liveLimit?: number | null,
>   liveTemplates?: number | null,
>   status?: string | null,
>   workspaceAgeDays?: number | null
> } | null
> ```

> [accordion] similarTemplates full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   createdAt?: string | null,
>   deploys?: number | null,
>   description?: string | null,
>   health?: number | null,
>   image?: string | null,
>   name?: string | null,
>   userId?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

***

## Traces

### get

`traces.get`

The spans of one trace, oldest first. Only spans belonging to the environment are returned

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.traces.get({ traceId: '4bf92f3577b34da6a3ce929d0e0e4736', environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `maxSpans` | `number` | No | Spans returned (defaults 1000, max 2000) |
| `traceId` | `string` | Yes | W3C trace id, 32 hex characters |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   component?: string | null,
>   deploymentId?: string | null,
>   deploymentInstanceId?: string | null,
>   durationMs?: number | null,
>   events?: {
>     attributes?: any | null,
>     name?: string | null,
>     timestamp?: string | null
>   }[] | null,
>   kind?: string | null,
>   links?: {
>     spanId?: string | null,
>     traceId?: string | null
>   }[] | null,
>   name?: string | null,
>   parentSpanId?: string | null,
>   resourceAttributes?: any | null,
>   serviceId?: string | null,
>   serviceName?: string | null,
>   spanAttributes?: any | null,
>   spanId?: string | null,
>   startedAt?: string | null,
>   statusCode?: string | null,
>   statusMessage?: string | null,
>   traceId?: string | null
> }[]
> ```

***

### list

`traces.list`

Traces of an environment with at least one span matching the filter, newest first

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.traces.list({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `endDate` | `string` | No | Latest span start to consider (ISO); defaults to now |
| `environmentId` | `string` | Yes | — |
| `filter` | `string` | No | Filter expression over spans, e.g. @status:error @component:edge @duration:>500 @http.route:/api/users. Built-in fields: trace, span, name, serviceName, service, deployment, replica, component, kind, status, duration (ms). Any other @key looks the key up in the span and resource attributes; free text matches the span name. Prefix a term with - to exclude it. |
| `limit` | `number` | No | Traces returned (defaults 100, max 500) |
| `serviceId` | `string` | No | Only traces with a span from this Railway service (optional) |
| `startDate` | `string` | No | Oldest span start to consider (ISO). Clamped to the project's retention; defaults to one hour ago |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   durationMs?: number | null,
>   errorCount?: number | null,
>   hasEdge?: boolean | null,
>   rootComponent?: string | null,
>   rootServerAddress?: string | null,
>   rootServiceId?: string | null,
>   rootServiceName?: string | null,
>   rootSpanName?: string | null,
>   rootUrlPath?: string | null,
>   serviceName?: string | null,
>   spanCount?: number | null,
>   startedAt?: string | null,
>   traceId?: string | null
> }[]
> ```

***

### status

`traces.status`

Span activity per service of an environment within retention; a service absent from the list has produced no spans at all

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.traces.status({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   lastEdgeSpanAt?: string | null,
>   lastServiceSpanAt?: string | null,
>   serviceId?: string | null
> }[]
> ```

***

## Trusted Domains

### create

`trustedDomains.create`

Create a new trusted domain for this workspace

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.trustedDomains.create({
	input: { domainName: 'example', role: 'MEMBER', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   domainName: string,
>   role: string,
>   workspaceId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `autoJoinEnabled` | `boolean \| null` | No | — |
| `domainName` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `verificationData` | `object \| null` | No | — |
| `verificationType` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] verificationData full type
>
> ```ts theme={null}
> {
>   dnsHost?: string | null,
>   token?: string | null
> } | null
> ```

***

### delete

`trustedDomains.delete`

Delete a trusted domain

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

```ts theme={null}
await corsair.railway.api.trustedDomains.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### list

`trustedDomains.list`

Get all trusted domains for a workspace, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.trustedDomains.list({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |
| `workspaceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   autoJoinEnabled?: boolean | null,
>   domainName?: string | null,
>   id?: string | null,
>   role?: string | null,
>   status?: string | null,
>   verificationData?: {
>     dnsHost?: string | null,
>     token?: string | null
>   } | null,
>   verificationType?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### retriggerVerification

`trustedDomains.retriggerVerification`

Check the DNS record for a workspace email domain

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.trustedDomains.retriggerVerification({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `autoJoinEnabled` | `boolean \| null` | No | — |
| `domainName` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `verificationData` | `object \| null` | No | — |
| `verificationType` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] verificationData full type
>
> ```ts theme={null}
> {
>   dnsHost?: string | null,
>   token?: string | null
> } | null
> ```

***

### update

`trustedDomains.update`

Update the automatic joining policy for a workspace email domain

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.trustedDomains.update({
	input: { id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   autoJoinEnabled?: boolean,
>   id: string,
>   role?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `autoJoinEnabled` | `boolean \| null` | No | — |
| `domainName` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `role` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `verificationData` | `object \| null` | No | — |
| `verificationType` | `string \| null` | No | — |
| `workspaceId` | `string \| null` | No | — |

> [accordion] verificationData full type
>
> ```ts theme={null}
> {
>   dnsHost?: string | null,
>   token?: string | null
> } | null
> ```

***

## Two Factor

### get

`twoFactor.get`

Gets the TwoFactorInfo for the authenticated user

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.twoFactor.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `hasRecoveryCodes` | `boolean \| null` | No | — |
| `isVerified` | `boolean \| null` | No | — |

***

## Usage

### estimated

`usage.estimated`

Get the estimated total cost of the project at the end of the current billing cycle. If no `startDate` is provided, the usage for the current billing period of the project owner is returned

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.usage.estimated({
	measurements: ['AGENT_CACHE_READ_TOKENS'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `includeDeleted` | `boolean` | No | Whether to include deleted projects in estimations. |
| `measurements` | `(AGENT_CACHE_READ_TOKENS \| AGENT_CACHE_WRITE_TOKENS \| AGENT_INPUT_TOKENS \| AGENT_OUTPUT_TOKENS \| AGENT_SPEND_USD \| BACKUP_USAGE_GB \| CPU_LIMIT \| CPU_USAGE \| CPU_USAGE_2 \| DISK_USAGE_GB \| EPHEMERAL_DISK_USAGE_GB \| MEASUREMENT_UNSPECIFIED \| MEMORY_LIMIT_GB \| MEMORY_USAGE_GB \| NETWORK_RX_GB \| NETWORK_TX_GB \| UNRECOGNIZED)[]` | Yes | — |
| `projectId` | `string` | No | — |
| `workspaceId` | `string` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   estimatedValue?: number | null,
>   measurement?: string | null,
>   projectId?: string | null
> }[]
> ```

***

### get

`usage.get`

Get the usage for a single project or all projects for a user/workspace. If no `projectId` or `workspaceId` is provided, the usage for the current user is returned. If no `startDate` is provided, the usage for the current billing period of the project owner is returned

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.usage.get({
	measurements: ['AGENT_CACHE_READ_TOKENS'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `endDate` | `string` | No | — |
| `groupBy` | `(BILLABLE \| DEPLOYMENT_ID \| DEPLOYMENT_INSTANCE_ID \| ENVIRONMENT_ID \| FEATURE \| HOST_TYPE \| KEY_UNSPECIFIED \| MODEL \| PLUGIN_ID \| PROJECT_ID \| REGION \| SERVICE_ID \| UNRECOGNIZED \| VM_ID \| VOLUME_ID \| VOLUME_INSTANCE_ID \| WORKLOAD_KIND)[]` | No | What to group the aggregated usage by. By default, it is grouped over the entire project. |
| `includeDeleted` | `boolean` | No | Whether to include deleted projects in the usage. |
| `measurements` | `(AGENT_CACHE_READ_TOKENS \| AGENT_CACHE_WRITE_TOKENS \| AGENT_INPUT_TOKENS \| AGENT_OUTPUT_TOKENS \| AGENT_SPEND_USD \| BACKUP_USAGE_GB \| CPU_LIMIT \| CPU_USAGE \| CPU_USAGE_2 \| DISK_USAGE_GB \| EPHEMERAL_DISK_USAGE_GB \| MEASUREMENT_UNSPECIFIED \| MEMORY_LIMIT_GB \| MEMORY_USAGE_GB \| NETWORK_RX_GB \| NETWORK_TX_GB \| UNRECOGNIZED)[]` | Yes | — |
| `projectId` | `string` | No | — |
| `startDate` | `string` | No | — |
| `workspaceId` | `string` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   measurement?: string | null,
>   tags?: {
>     deploymentId?: string | null,
>     deploymentInstanceId?: string | null,
>     environmentId?: string | null,
>     projectId?: string | null,
>     region?: string | null,
>     serviceId?: string | null,
>     volumeId?: string | null,
>     volumeInstanceId?: string | null
>   } | null,
>   value?: number | null
> }[]
> ```

***

### removeLimit

`usage.removeLimit`

Remove the usage limit for a customer

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.usage.removeLimit({
	input: { customerId: 'example' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   customerId: string
> }
> ```

**Output:** `boolean`

***

### setLimit

`usage.setLimit`

Set the usage limit for a customer

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.usage.setLimit({
	input: { customerId: 'example', softLimitDollars: 1 },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   customerId: string,
>   hardLimitDollars?: number,
>   softLimitDollars: number
> }
> ```

**Output:** `boolean`

***

## User

### agreeToFairUse

`user.agreeToFairUse`

Agree to the fair use policy for the currently authenticated user

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.user.agreeToFairUse({ agree: true });
```

**Input**

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

**Output:** `boolean`

***

### delete

`user.delete`

Delete the currently authenticated user

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

```ts theme={null}
await corsair.railway.api.user.delete({});
```

**Input:** *empty object*

**Output:** `boolean`

***

### disconnectDiscord

`user.disconnectDiscord`

Disconnect your Railway account from Discord

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.user.disconnectDiscord({});
```

**Input:** *empty object*

**Output:** `boolean`

***

### pendingEmailChange

`user.pendingEmailChange`

The authenticated user's unconfirmed email change, if there is one

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.user.pendingEmailChange({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `email` | `string \| null` | No | The address the change is to. |
| `expiresAt` | `string \| null` | No | When the confirmation link stops working. |
| `requestedAt` | `string \| null` | No | — |

***

### removeProviderAuth

`user.removeProviderAuth`

Deletes a ProviderAuth

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.user.removeProviderAuth({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### updateTerms

`user.updateTerms`

Update date of TermsAgreedOn

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.user.updateTerms({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agreedFairUse` | `boolean \| null` | No | — |
| `apiTokenRateLimit` | `object \| null` | No | — |
| `avatar` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `featureFlags` | `string[] \| null` | No | — |
| `githubProviderId` | `string \| null` | No | — |
| `githubUsername` | `string \| null` | No | — |
| `has2FA` | `boolean \| null` | No | — |
| `hasPasskeys` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isAdmin` | `boolean \| null` | No | — |
| `isConductor` | `boolean \| null` | No | — |
| `isVerified` | `boolean \| null` | No | — |
| `lastLogin` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `profile` | `object \| null` | No | — |
| `registrationStatus` | `string \| null` | No | — |
| `riskLevel` | `number \| null` | No | — |
| `termsAgreedOn` | `string \| null` | No | — |
| `username` | `string \| null` | No | — |
| `workspaces` | `object[] \| null` | No | Workspaces user is member of |

> [accordion] apiTokenRateLimit full type
>
> ```ts theme={null}
> {
>   remainingPoints?: number | null,
>   resetsAt?: string | null
> } | null
> ```

> [accordion] profile full type
>
> ```ts theme={null}
> {
>   bio?: string | null,
>   isPublic?: boolean | null,
>   website?: string | null
> } | null
> ```

> [accordion] workspaces full type
>
> ```ts theme={null}
> {
>   adoptionLevel?: number | null,
>   avatar?: string | null,
>   createdAt?: string | null,
>   discordRole?: string | null,
>   has2FAEnforcement?: boolean | null,
>   hasAutomaticDiagnosis?: boolean | null,
>   hasGuardrailsAccess?: boolean | null,
>   hasHipaaBAA?: boolean | null,
>   hasSAML?: boolean | null,
>   id?: string | null,
>   name?: string | null,
>   plan?: string | null,
>   preferredRegion?: string | null,
>   projectCount?: number | null,
>   redactedDueTo2FAPending?: boolean | null,
>   restrictProjectVisibilityToGroups?: boolean | null,
>   slackChannelId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   updatedAt?: string | null,
>   usersWithout2FA?: string[] | null
> }[] | null
> ```

***

## User Profile

### get

`userProfile.get`

Get the public profile for a user

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.userProfile.get({ username: 'example' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `avatar` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `profile` | `object \| null` | No | — |
| `totalDeploys` | `number \| null` | No | — |
| `username` | `string \| null` | No | — |

> [accordion] profile full type
>
> ```ts theme={null}
> {
>   bio?: string | null,
>   isPublic?: boolean | null,
>   website?: string | null
> } | null
> ```

***

### update

`userProfile.update`

Updates the profile for the authenticated user

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.userProfile.update({
	input: { isPublic: true },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   bio?: string,
>   isPublic: boolean,
>   website?: string
> }
> ```

**Output:** `boolean`

***

## Variables

### delete

`variables.delete`

Deletes a variable

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

```ts theme={null}
await corsair.railway.api.variables.delete({
	input: { environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', name: 'api', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   name: string,
>   projectId: string,
>   serviceId?: string
> }
> ```

**Output:** `boolean`

***

### forServiceDeployment

`variables.forServiceDeployment`

All rendered variables that are required for a service deployment

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.variables.forServiceDeployment({ environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `projectId` | `string` | Yes | — |
| `serviceId` | `string` | Yes | — |

**Output:** `Record<string, string>`

***

### list

`variables.list`

Get the variables of a service in an environment (or the shared ones without serviceId), as a name -> value map

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.variables.list({ projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17', environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17', serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `projectId` | `string` | Yes | — |
| `serviceId` | `string` | No | Provide a serviceId to get all variables for a specific service. |
| `unrendered` | `boolean` | No | — |

**Output:** `Record<string, string>`

***

### upsert

`variables.upsert`

Create or change one variable; Railway redeploys the service unless skipDeploys is set

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.variables.upsert({
	input: {
		projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17',
		environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
		serviceId: '00000004-5c1e-4d8a-9f43-2b6e1c0a9d17',
		name: 'API_URL',
		value: 'https://api.example.com',
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   name: string,
>   projectId: string,
>   serviceId?: string,
>   skipDeploys?: boolean,
>   value: string
> }
> ```

**Output:** `boolean`

***

### upsertMany

`variables.upsertMany`

Create or change several variables at once (replace: true drops the others); redeploys unless skipDeploys is set

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.variables.upsertMany({
	input: {
		environmentId: '00000003-5c1e-4d8a-9f43-2b6e1c0a9d17',
		projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17',
		variables: {},
	},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId: string,
>   projectId: string,
>   replace?: boolean,
>   serviceId?: string,
>   skipDeploys?: boolean,
>   variables: Record<string, string>
> }
> ```

**Output:** `boolean`

***

## Volume Instance Backups

### create

`volumeInstanceBackups.create`

Create backup of a volume instance

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.volumeInstanceBackups.create({ volumeInstanceId: '00000008-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | No | Optional name/label for the backup. Defaults to 'Manual' if not provided. |
| `volumeInstanceId` | `string` | Yes | The id of the volume instance to create a backup of |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `archiveContinuityUnverifiedReason` | `string \| null` | No | Why MySQL archive continuity could not be verified. The restore remains allowed and its image performs the authoritative replay check. |
| `archiveContinuityVerified` | `boolean \| null` | No | For MySQL PITR restores, whether archive continuity was verified before the workflow started. |
| `workflowId` | `string \| null` | No | — |

***

### delete

`volumeInstanceBackups.delete`

Deletes volume instance backup

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

```ts theme={null}
await corsair.railway.api.volumeInstanceBackups.delete({ volumeInstanceBackupId: 'example', volumeInstanceId: '00000008-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `volumeInstanceBackupId` | `string` | Yes | The volume instance's backup id |
| `volumeInstanceId` | `string` | Yes | The volume instance's id |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `archiveContinuityUnverifiedReason` | `string \| null` | No | Why MySQL archive continuity could not be verified. The restore remains allowed and its image performs the authoritative replay check. |
| `archiveContinuityVerified` | `boolean \| null` | No | For MySQL PITR restores, whether archive continuity was verified before the workflow started. |
| `workflowId` | `string \| null` | No | — |

***

### list

`volumeInstanceBackups.list`

List backups of a volume instance

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.volumeInstanceBackups.list({ volumeInstanceId: '00000008-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `volumeInstanceId` | `string` | Yes | The id of the volume instance to list the backups of |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   creatorId?: string | null,
>   expiresAt?: string | null,
>   externalId?: string | null,
>   id?: string | null,
>   name?: string | null,
>   referencedMB?: number | null,
>   scheduleId?: string | null,
>   usedMB?: number | null,
>   volumeInstanceSizeMB?: number | null
> }[]
> ```

***

### lock

`volumeInstanceBackups.lock`

Removes backup expiration date

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.volumeInstanceBackups.lock({ volumeInstanceBackupId: 'example', volumeInstanceId: '00000008-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `volumeInstanceBackupId` | `string` | Yes | The id of the backup to lock |
| `volumeInstanceId` | `string` | Yes | The id of the volume instance to be restored from |

**Output:** `boolean`

***

### restore

`volumeInstanceBackups.restore`

Restore a volume instance from a backup

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

```ts theme={null}
await corsair.railway.api.volumeInstanceBackups.restore({ volumeInstanceBackupId: 'example', volumeInstanceId: '00000008-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `replicaServiceIds` | `string[]` | No | Optional: for HA cluster restores, service IDs of replicas that should also receive the backup |
| `volumeInstanceBackupId` | `string` | Yes | The id of the backup to be restored from |
| `volumeInstanceId` | `string` | Yes | The id of the volume instance to be restored from |
| `wipeServiceIds` | `string[]` | No | Service IDs whose volumes should be wiped (replaced with fresh empty volumes) as part of this restore |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `archiveContinuityUnverifiedReason` | `string \| null` | No | Why MySQL archive continuity could not be verified. The restore remains allowed and its image performs the authoritative replay check. |
| `archiveContinuityVerified` | `boolean \| null` | No | For MySQL PITR restores, whether archive continuity was verified before the workflow started. |
| `workflowId` | `string \| null` | No | — |

***

## Volume Instance Backup Schedules

### list

`volumeInstanceBackupSchedules.list`

List backups schedules of a volume instance

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.volumeInstanceBackupSchedules.list({ volumeInstanceId: '00000008-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `volumeInstanceId` | `string` | Yes | The id of the volume instance to list the schedules of |

**Output:** `object[]`

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

***

### update

`volumeInstanceBackupSchedules.update`

Manage schedule for backups of a volume instance

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.volumeInstanceBackupSchedules.update({
	kinds: ['DAILY'],
	volumeInstanceId: '00000008-5c1e-4d8a-9f43-2b6e1c0a9d17',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `kinds` | `(DAILY \| MONTHLY \| WEEKLY)[]` | Yes | The frequency/retention of the backups |
| `volumeInstanceId` | `string` | Yes | The id of the volume instance to create a backup of |

**Output:** `boolean`

***

## Volume Instances

### get

`volumeInstances.get`

Get a single volume instance by id

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.volumeInstances.get({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `currentSizeMB` | `number \| null` | No | — |
| `deletedAt` | `string \| null` | No | — |
| `environment` | `object \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `externalId` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `isPendingDeletion` | `boolean \| null` | No | — |
| `mountPath` | `string \| null` | No | — |
| `region` | `string \| null` | No | — |
| `service` | `object \| null` | No | — |
| `serviceId` | `string \| null` | No | — |
| `sizeMB` | `number \| null` | No | — |
| `state` | `string \| null` | No | — |
| `volume` | `object \| null` | No | — |
| `volumeId` | `string \| null` | No | — |

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   canAccess?: boolean | null,
>   canvasGroupRefs?: any | null,
>   clearanceCachingTurnedOff?: string[] | null,
>   clearanceDefault?: boolean | null,
>   clearanceDefaultUpdatedAt?: string | null,
>   clearancePropagatedAt?: string | null,
>   clearancePropagationError?: string | null,
>   config?: any | null,
>   configEtag?: string | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   iacPartials?: any | null,
>   id?: string | null,
>   isEphemeral?: boolean | null,
>   name?: string | null,
>   projectId?: string | null,
>   sourceEnvironmentName?: string | null,
>   unmergedChangesCount?: number | null,
>   updatedAt?: string | null
> } | null
> ```

> [accordion] service full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   featureFlags?: string[] | null,
>   groupId?: string | null,
>   hasHiddenRegistryCredentialsFromTemplate?: boolean | null,
>   icon?: string | null,
>   id?: string | null,
>   isRestricted?: boolean | null,
>   kind?: string | null,
>   name?: string | null,
>   projectId?: string | null,
>   templateId?: string | null,
>   templateServiceId?: string | null,
>   templateThreadSlug?: string | null,
>   updatedAt?: string | null
> } | null
> ```

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

***

### pitrRestore

`volumeInstances.pitrRestore`

Point-in-time restore. Creates a brand-new database service in the project, recovered to the target timestamp from the source service's backup history. The source service stays online and untouched

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

```ts theme={null}
await corsair.railway.api.volumeInstances.pitrRestore({ targetTimestamp: '2026-04-09T10:00:00Z', volumeInstanceId: '00000008-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `newServiceName` | `string` | No | Optional name for the new restored service. Defaults to '\<source>-restored-YYYYMMDD-HHMM'. |
| `sourceRepoPath` | `string` | No | One of the source's backup histories, as listed by the backup history picker. Pass null to use the source's current history. |
| `targetTimestamp` | `string` | Yes | Point-in-time target. Must be within the available restore window. |
| `volumeInstanceId` | `string` | Yes | The id of the volume instance to restore from |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `archiveContinuityUnverifiedReason` | `string \| null` | No | Why MySQL archive continuity could not be verified. The restore remains allowed and its image performs the authoritative replay check. |
| `archiveContinuityVerified` | `boolean \| null` | No | For MySQL PITR restores, whether archive continuity was verified before the workflow started. |
| `workflowId` | `string \| null` | No | — |

***

### pitrRestoreEstimate

`volumeInstances.pitrRestoreEstimate`

Estimated disk space a point-in-time restore to this target needs, and whether it fits your plan's largest volume. Returns null when no estimate is available

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.volumeInstances.pitrRestoreEstimate({ targetTimestamp: '2026-04-09T10:00:00Z', volumeInstanceId: '00000008-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sourceRepoPath` | `string` | No | One of the source's backup histories, as listed by the backup history picker. Pass null to use the source's current history. |
| `targetTimestamp` | `string` | Yes | Point-in-time target the estimate is computed for |
| `volumeInstanceId` | `string` | Yes | The id of the source volume instance to restore from |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseBackupLabel` | `string \| null` | No | — |
| `dataMB` | `number \| null` | No | — |
| `estimatedScratchMB` | `number \| null` | No | — |
| `likelyToFit` | `boolean \| null` | No | — |
| `planMaxSizeMB` | `number \| null` | No | — |
| `walMB` | `number \| null` | No | — |

***

### update

`volumeInstances.update`

Update a volume instance. If no environmentId is provided, all volume instances for the volume will be updated

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.volumeInstances.update({
	input: {},
	volumeId: '00000007-5c1e-4d8a-9f43-2b6e1c0a9d17',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | No | The environment of the volume instance to update. If null, all instances for the volume will be updated |
| `input` | `object` | Yes | — |
| `volumeId` | `string` | Yes | The id of the volume to update |

> [accordion] input full type
>
> ```ts theme={null}
> {
>   mountPath?: string,
>   serviceId?: string,
>   state?: DELETED | DELETING | ERROR | MIGRATING | MIGRATION_PENDING | READY | RESTORING | UPDATING
> }
> ```

**Output:** `boolean`

***

## Volumes

### create

`volumes.create`

Create a persistent volume in a project

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.volumes.create({
	input: { mountPath: 'example', projectId: '00000002-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   environmentId?: string,
>   mountPath: string,
>   projectId: string,
>   region?: string,
>   serviceId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

***

### delete

`volumes.delete`

Delete a persistent volume in a project

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

```ts theme={null}
await corsair.railway.api.volumes.delete({ volumeId: '00000007-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### update

`volumes.update`

Update a persistent volume in a project

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.volumes.update({
	input: {},
	volumeId: '00000007-5c1e-4d8a-9f43-2b6e1c0a9d17',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `input` | `object` | Yes | — |
| `volumeId` | `string` | Yes | — |

> [accordion] input full type
>
> ```ts theme={null}
> {
>   name?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `createdAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `project` | `object \| null` | No | — |
| `projectId` | `string \| null` | No | — |

> [accordion] project full type
>
> ```ts theme={null}
> {
>   baseEnvironmentId?: string | null,
>   botPrEnvironments?: boolean | null,
>   clearanceDefaultForNewEnvironments?: boolean | null,
>   createdAt?: string | null,
>   deletedAt?: string | null,
>   description?: string | null,
>   expiredAt?: string | null,
>   featureFlags?: string[] | null,
>   focusedPrEnvironments?: boolean | null,
>   id?: string | null,
>   isPublic?: boolean | null,
>   isTempProject?: boolean | null,
>   name?: string | null,
>   prDeploys?: boolean | null,
>   primaryEnvironmentId?: string | null,
>   subscriptionPlanLimit?: any | null,
>   subscriptionType?: string | null,
>   updatedAt?: string | null,
>   viewerRole?: string | null,
>   workspaceId?: string | null
> } | null
> ```

***

## Webhooks

### test

`webhooks.test`

Test a webhook URL by sending a sample payload. Returns the HTTP status code. Custom headers come from `headers`, plus the stored headers of `notificationRuleId` for names not passed

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.webhooks.test({ payload: 'example', url: 'https://example.com/railway/webhook' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `headers` | `object[]` | No | — |
| `notificationRuleId` | `string` | No | — |
| `payload` | `string` | Yes | — |
| `url` | `string` | Yes | — |

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

**Output:** `number`

***

## Workflows

### status

`workflows.status`

Gets the status of a workflow

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.workflows.status({ workflowId: 'example' });
```

**Input**

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

**Output**

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

***

## Workspace Api Tokens

### delete

`workspaceApiTokens.delete`

Revokes an API token scoped to a workspace. Requires workspace admin access

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

```ts theme={null}
await corsair.railway.api.workspaceApiTokens.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### list

`workspaceApiTokens.list`

Lists API tokens scoped to a workspace. Requires workspace admin access, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.workspaceApiTokens.list({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |
| `workspaceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   createdAt?: string | null,
>   creator?: {
>     avatar?: string | null,
>     email?: string | null,
>     id?: string | null,
>     name?: string | null,
>     username?: string | null
>   } | null,
>   displayToken?: string | null,
>   expiresAt?: string | null,
>   id?: string | null,
>   name?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

## Workspace Members

### changeRole

`workspaceMembers.changeRole`

Changes a user workspace permissions

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.workspaceMembers.changeRole({
	input: { role: 'MEMBER', userId: '00000009-5c1e-4d8a-9f43-2b6e1c0a9d17', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' },
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   role: ADMIN | MEMBER | VIEWER,
>   userId: string,
>   workspaceId: string
> }
> ```

**Output:** `boolean`

***

### invite

`workspaceMembers.invite`

Invite a user by email to a workspace

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.workspaceMembers.invite({
	input: { code: 'postgres', email: 'ada@example.com' },
	workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `input` | `object` | Yes | — |
| `workspaceId` | `string` | Yes | — |

> [accordion] input full type
>
> ```ts theme={null}
> {
>   code: string,
>   email: string
> }
> ```

**Output:** `boolean`

***

### remove

`workspaceMembers.remove`

Remove a user from a workspace

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.workspaceMembers.remove({
	input: { userId: '00000009-5c1e-4d8a-9f43-2b6e1c0a9d17' },
	workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `input` | `object` | Yes | — |
| `workspaceId` | `string` | Yes | — |

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

**Output:** `boolean`

***

## Workspace Policies

### addDeploySource

`workspacePolicies.addDeploySource`

Add a deploy source to a workspace policy allowlist

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.workspacePolicies.addDeploySource({ sourceId: 'example', sourceType: 'GITHUB_ORG', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sourceId` | `string` | Yes | — |
| `sourceType` | `GITHUB_ORG` | Yes | — |
| `workspaceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `addedBy` | `object \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `sourceIcon` | `string \| null` | No | — |
| `sourceId` | `string \| null` | No | — |
| `sourceName` | `string \| null` | No | — |
| `sourceType` | `string \| null` | No | — |

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

***

### get

`workspacePolicies.get`

Get the policies for a workspace

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.workspacePolicies.get({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `restrictDeploysToAllowedSources` | `boolean \| null` | No | — |
| `restrictPublicTcpProxies` | `boolean \| null` | No | — |
| `restrictRailwayDomainGeneration` | `boolean \| null` | No | — |

***

### removeDeploySource

`workspacePolicies.removeDeploySource`

Remove a deploy source from a workspace policy allowlist

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.workspacePolicies.removeDeploySource({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### selectableDeploySources

`workspacePolicies.selectableDeploySources`

List deploy sources that can be added to a workspace policy

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.workspacePolicies.selectableDeploySources({ sourceType: 'GITHUB_ORG', workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sourceType` | `GITHUB_ORG` | Yes | — |
| `workspaceId` | `string` | Yes | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   sourceIcon?: string | null,
>   sourceId?: string | null,
>   sourceName?: string | null,
>   sourceType?: string | null
> }[]
> ```

***

### updateItem

`workspacePolicies.updateItem`

Enable or disable a workspace policy. Enterprise workspaces only

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.workspacePolicies.updateItem({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean` | No | — |
| `input` | `object` | No | — |
| `policy` | `RESTRICT_DEPLOYS_TO_ALLOWED_SOURCES \| RESTRICT_PUBLIC_TCP_PROXIES \| RESTRICT_RAILWAY_DOMAIN_GENERATION` | No | — |
| `workspaceId` | `string` | Yes | — |

> [accordion] input full type
>
> ```ts theme={null}
> {
>   enabled: boolean,
>   policy: RESTRICT_DEPLOYS_TO_ALLOWED_SOURCES | RESTRICT_PUBLIC_TCP_PROXIES | RESTRICT_RAILWAY_DOMAIN_GENERATION
> }
> ```

**Output:** `boolean`

***

## Workspaces

### complianceAgreements

`workspaces.complianceAgreements`

Get compliance agreements for a workspace including HIPAA BAA and GDPR DPA status

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.workspaces.complianceAgreements({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `hasBAA` | `boolean \| null` | No | Whether the workspace has a signed Business Associate Agreement (HIPAA) |
| `hasDPA` | `boolean \| null` | No | Whether the workspace has a Data Processing Agreement (GDPR) |

***

### createInviteCode

`workspaces.createInviteCode`

Get an invite code for a workspace and role

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.workspaces.createInviteCode({
	input: { role: 'MEMBER' },
	workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `input` | `object` | Yes | — |
| `workspaceId` | `string` | Yes | — |

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

**Output:** `string`

***

### delete

`workspaces.delete`

Delete a workspace and all data associated with it

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

```ts theme={null}
await corsair.railway.api.workspaces.delete({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### get

`workspaces.get`

Get the workspace

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.workspaces.get({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `adoptionHistory` | `object[] \| null` | No | — |
| `adoptionLevel` | `number \| null` | No | — |
| `apiTokenRateLimit` | `object \| null` | No | — |
| `avatar` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `customer` | `object \| null` | No | — |
| `discordRole` | `string \| null` | No | — |
| `has2FAEnforcement` | `boolean \| null` | No | Whether 2FA enforcement is enabled for this workspace. |
| `hasAutomaticDiagnosis` | `boolean \| null` | No | Whether automatic deployment diagnosis is enabled for this workspace. |
| `hasGuardrailsAccess` | `boolean \| null` | No | Whether this workspace has access to guardrails policies. |
| `hasHipaaBAA` | `boolean \| null` | No | Whether this workspace has a signed HIPAA Business Associate Agreement, from either the legacy hasBAA flag or the HIPAA\_BAA spend commitment feature. |
| `hasSAML` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `members` | `object[] \| null` | No | — |
| `name` | `string \| null` | No | — |
| `partnerProfile` | `object \| null` | No | — |
| `plan` | `string \| null` | No | — |
| `preferredRegion` | `string \| null` | No | — |
| `projectCount` | `number \| null` | No | Total number of projects in this workspace. Used by the dashboard to show an exact count without paginating through every project. |
| `redactedDueTo2FAPending` | `boolean \| null` | No | Whether the current user's access is redacted due to pending 2FA requirement. Returns true if the user is a workspace member, workspace has 2FA enforcement enabled, and the current user needs to enable 2FA. |
| `referredUsers` | `object[] \| null` | No | — |
| `restrictProjectVisibilityToGroups` | `boolean \| null` | No | — |
| `slackChannelId` | `string \| null` | No | — |
| `subscriptionPlanLimit` | `any \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `usersWithout2FA` | `string[] \| null` | No | Get a list of user emails in the workspace who do not have verified 2FA enabled. Returns an empty array if all users have 2FA enabled. |

> [accordion] adoptionHistory full type
>
> ```ts theme={null}
> {
>   adoptionLevel?: number | null,
>   createdAt?: string | null,
>   deltaLevel?: number | null,
>   id?: string | null,
>   matchedIcpEmail?: string | null,
>   monthlyEstimatedUsage?: number | null,
>   numConfigFile?: number | null,
>   numCronSchedule?: number | null,
>   numDeploys?: number | null,
>   numEnvs?: number | null,
>   numFailedDeploys?: number | null,
>   numHealthcheck?: number | null,
>   numIconConfig?: number | null,
>   numRegion?: number | null,
>   numReplicas?: number | null,
>   numRootDirectory?: number | null,
>   numSeats?: number | null,
>   numServices?: number | null,
>   numVariables?: number | null,
>   numWatchPatterns?: number | null,
>   totalCores?: number | null,
>   totalDisk?: number | null,
>   totalNetwork?: number | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] apiTokenRateLimit full type
>
> ```ts theme={null}
> {
>   remainingPoints?: number | null,
>   resetsAt?: string | null
> } | null
> ```

> [accordion] customer full type
>
> ```ts theme={null}
> {
>   appliedCredits?: number | null,
>   billingEmail?: string | null,
>   creditBalance?: number | null,
>   currentUsage?: number | null,
>   defaultPaymentMethodId?: string | null,
>   hasExhaustedFreePlan?: boolean | null,
>   id?: string | null,
>   isPrepaying?: boolean | null,
>   isTrialing?: boolean | null,
>   isUsageSubscriber?: boolean | null,
>   isWithdrawingToCredits?: boolean | null,
>   remainingUsageCreditBalance?: number | null,
>   state?: string | null,
>   stripeCustomerId?: string | null,
>   supportedWithdrawalPlatforms?: string[] | null,
>   trialDaysRemaining?: number | null
> } | null
> ```

> [accordion] members full type
>
> ```ts theme={null}
> {
>   avatar?: string | null,
>   email?: string | null,
>   featureFlags?: string[] | null,
>   id?: string | null,
>   name?: string | null,
>   role?: string | null,
>   twoFactorAuthEnabled?: boolean | null
> }[] | null
> ```

> [accordion] partnerProfile full type
>
> ```ts theme={null}
> {
>   category?: string | null,
>   description?: string | null,
>   slug?: string | null,
>   type?: string | null,
>   website?: string | null
> } | null
> ```

> [accordion] referredUsers full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   id?: string | null,
>   status?: string | null
> }[] | null
> ```

***

### getByCode

`workspaces.getByCode`

Find a workspace by invite code

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.workspaces.getByCode({ code: 'postgres' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `adoptionHistory` | `object[] \| null` | No | — |
| `adoptionLevel` | `number \| null` | No | — |
| `apiTokenRateLimit` | `object \| null` | No | — |
| `avatar` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `customer` | `object \| null` | No | — |
| `discordRole` | `string \| null` | No | — |
| `has2FAEnforcement` | `boolean \| null` | No | Whether 2FA enforcement is enabled for this workspace. |
| `hasAutomaticDiagnosis` | `boolean \| null` | No | Whether automatic deployment diagnosis is enabled for this workspace. |
| `hasGuardrailsAccess` | `boolean \| null` | No | Whether this workspace has access to guardrails policies. |
| `hasHipaaBAA` | `boolean \| null` | No | Whether this workspace has a signed HIPAA Business Associate Agreement, from either the legacy hasBAA flag or the HIPAA\_BAA spend commitment feature. |
| `hasSAML` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `members` | `object[] \| null` | No | — |
| `name` | `string \| null` | No | — |
| `partnerProfile` | `object \| null` | No | — |
| `plan` | `string \| null` | No | — |
| `preferredRegion` | `string \| null` | No | — |
| `projectCount` | `number \| null` | No | Total number of projects in this workspace. Used by the dashboard to show an exact count without paginating through every project. |
| `redactedDueTo2FAPending` | `boolean \| null` | No | Whether the current user's access is redacted due to pending 2FA requirement. Returns true if the user is a workspace member, workspace has 2FA enforcement enabled, and the current user needs to enable 2FA. |
| `referredUsers` | `object[] \| null` | No | — |
| `restrictProjectVisibilityToGroups` | `boolean \| null` | No | — |
| `slackChannelId` | `string \| null` | No | — |
| `subscriptionPlanLimit` | `any \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `usersWithout2FA` | `string[] \| null` | No | Get a list of user emails in the workspace who do not have verified 2FA enabled. Returns an empty array if all users have 2FA enabled. |

> [accordion] adoptionHistory full type
>
> ```ts theme={null}
> {
>   adoptionLevel?: number | null,
>   createdAt?: string | null,
>   deltaLevel?: number | null,
>   id?: string | null,
>   matchedIcpEmail?: string | null,
>   monthlyEstimatedUsage?: number | null,
>   numConfigFile?: number | null,
>   numCronSchedule?: number | null,
>   numDeploys?: number | null,
>   numEnvs?: number | null,
>   numFailedDeploys?: number | null,
>   numHealthcheck?: number | null,
>   numIconConfig?: number | null,
>   numRegion?: number | null,
>   numReplicas?: number | null,
>   numRootDirectory?: number | null,
>   numSeats?: number | null,
>   numServices?: number | null,
>   numVariables?: number | null,
>   numWatchPatterns?: number | null,
>   totalCores?: number | null,
>   totalDisk?: number | null,
>   totalNetwork?: number | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] apiTokenRateLimit full type
>
> ```ts theme={null}
> {
>   remainingPoints?: number | null,
>   resetsAt?: string | null
> } | null
> ```

> [accordion] customer full type
>
> ```ts theme={null}
> {
>   appliedCredits?: number | null,
>   billingEmail?: string | null,
>   creditBalance?: number | null,
>   currentUsage?: number | null,
>   defaultPaymentMethodId?: string | null,
>   hasExhaustedFreePlan?: boolean | null,
>   id?: string | null,
>   isPrepaying?: boolean | null,
>   isTrialing?: boolean | null,
>   isUsageSubscriber?: boolean | null,
>   isWithdrawingToCredits?: boolean | null,
>   remainingUsageCreditBalance?: number | null,
>   state?: string | null,
>   stripeCustomerId?: string | null,
>   supportedWithdrawalPlatforms?: string[] | null,
>   trialDaysRemaining?: number | null
> } | null
> ```

> [accordion] members full type
>
> ```ts theme={null}
> {
>   avatar?: string | null,
>   email?: string | null,
>   featureFlags?: string[] | null,
>   id?: string | null,
>   name?: string | null,
>   role?: string | null,
>   twoFactorAuthEnabled?: boolean | null
> }[] | null
> ```

> [accordion] partnerProfile full type
>
> ```ts theme={null}
> {
>   category?: string | null,
>   description?: string | null,
>   slug?: string | null,
>   type?: string | null,
>   website?: string | null
> } | null
> ```

> [accordion] referredUsers full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   id?: string | null,
>   status?: string | null
> }[] | null
> ```

***

### identityProviders

`workspaces.identityProviders`

Gets all identity providers of a workspace, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.workspaces.identityProviders({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |
| `workspaceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   connection?: {
>     createdAt?: string | null,
>     provider?: string | null,
>     status?: string | null,
>     updatedAt?: string | null
>   } | null,
>   createdAt?: string | null,
>   enforcementEnabledAt?: string | null,
>   id?: string | null,
>   updatedAt?: string | null,
>   workspace?: {
>     adoptionLevel?: number | null,
>     avatar?: string | null,
>     createdAt?: string | null,
>     discordRole?: string | null,
>     has2FAEnforcement?: boolean | null,
>     hasAutomaticDiagnosis?: boolean | null,
>     hasGuardrailsAccess?: boolean | null,
>     hasHipaaBAA?: boolean | null,
>     hasSAML?: boolean | null,
>     id?: string | null,
>     name?: string | null,
>     plan?: string | null,
>     preferredRegion?: string | null,
>     projectCount?: number | null,
>     redactedDueTo2FAPending?: boolean | null,
>     restrictProjectVisibilityToGroups?: boolean | null,
>     slackChannelId?: string | null,
>     subscriptionPlanLimit?: any | null,
>     updatedAt?: string | null,
>     usersWithout2FA?: string[] | null
>   } | null,
>   workspaceId?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***

### leave

`workspaces.leave`

Leave a workspace

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.workspaces.leave({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### listExternal

`workspaces.listExternal`

Get the workspaces the user doesn't belong to, but needs access (like when invited to a project)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.workspaces.listExternal({});
```

**Input**

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

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   avatar?: string | null,
>   banReason?: string | null,
>   createdAt?: string | null,
>   currentSessionHasAccess?: boolean | null,
>   customerId?: string | null,
>   customerState?: string | null,
>   discordRole?: string | null,
>   has2FAEnforcement?: boolean | null,
>   hasAutomaticDiagnosis?: boolean | null,
>   hasGuardrailsAccess?: boolean | null,
>   hasSAML?: boolean | null,
>   id?: string | null,
>   isTrialing?: boolean | null,
>   name?: string | null,
>   plan?: string | null,
>   preferredRegion?: string | null,
>   projects?: {
>     baseEnvironmentId?: string | null,
>     botPrEnvironments?: boolean | null,
>     clearanceDefaultForNewEnvironments?: boolean | null,
>     createdAt?: string | null,
>     deletedAt?: string | null,
>     description?: string | null,
>     expiredAt?: string | null,
>     featureFlags?: string[] | null,
>     focusedPrEnvironments?: boolean | null,
>     id?: string | null,
>     isPublic?: boolean | null,
>     isTempProject?: boolean | null,
>     name?: string | null,
>     prDeploys?: boolean | null,
>     primaryEnvironmentId?: string | null,
>     subscriptionPlanLimit?: any | null,
>     subscriptionType?: string | null,
>     updatedAt?: string | null,
>     viewerRole?: string | null,
>     workspaceId?: string | null
>   }[] | null,
>   redactedDueTo2FAPending?: boolean | null,
>   subscriptionPlanLimit?: any | null,
>   teamId?: string | null
> }[]
> ```

***

### setRestrictProjectVisibilityToGroups

`workspaces.setRestrictProjectVisibilityToGroups`

Control whether non-admin project visibility is restricted to access groups and direct project permissions

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.workspaces.setRestrictProjectVisibilityToGroups({ enabled: true, workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean` | Yes | — |
| `workspaceId` | `string` | Yes | — |

**Output:** `boolean`

***

### update

`workspaces.update`

Update a workspace by id

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.workspaces.update({
	id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17',
	input: {},
});
```

**Input**

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

> [accordion] input full type
>
> ```ts theme={null}
> {
>   avatar?: string,
>   name?: string,
>   preferredRegion?: string
> }
> ```

**Output:** `boolean`

***

### updateTwoFactorEnforcement

`workspaces.updateTwoFactorEnforcement`

Enable or disable 2FA enforcement for a workspace

**Risk:** `destructive`

```ts theme={null}
await corsair.railway.api.workspaces.updateTwoFactorEnforcement({ enabled: true, workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean` | Yes | — |
| `workspaceId` | `string` | Yes | — |

**Output:** `boolean`

***

### upsertSlackChannel

`workspaces.upsertSlackChannel`

Generate a Slack channel for a workspace

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.workspaces.upsertSlackChannel({ id: '00000001-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

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

**Output:** `boolean`

***

### usageTotals

`workspaces.usageTotals`

Workspace-wide SUM of the same UI usage rollup as `usage` grouped by project. Use this for the usage-page header so it does not wait on per-project rows. Deleted projects that still bill are included when `includeDeleted` is true

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.workspaces.usageTotals({
	measurements: ['AGENT_CACHE_READ_TOKENS'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `endDate` | `string` | No | — |
| `includeDeleted` | `boolean` | No | Whether to include deleted projects in the usage. |
| `measurements` | `(AGENT_CACHE_READ_TOKENS \| AGENT_CACHE_WRITE_TOKENS \| AGENT_INPUT_TOKENS \| AGENT_OUTPUT_TOKENS \| AGENT_SPEND_USD \| BACKUP_USAGE_GB \| CPU_LIMIT \| CPU_USAGE \| CPU_USAGE_2 \| DISK_USAGE_GB \| EPHEMERAL_DISK_USAGE_GB \| MEASUREMENT_UNSPECIFIED \| MEMORY_LIMIT_GB \| MEMORY_USAGE_GB \| NETWORK_RX_GB \| NETWORK_TX_GB \| UNRECOGNIZED)[]` | Yes | — |
| `startDate` | `string` | No | — |
| `workspaceId` | `string` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   measurement?: string | null,
>   tags?: {
>     deploymentId?: string | null,
>     deploymentInstanceId?: string | null,
>     environmentId?: string | null,
>     projectId?: string | null,
>     region?: string | null,
>     serviceId?: string | null,
>     volumeId?: string | null,
>     volumeInstanceId?: string | null
>   } | null,
>   value?: number | null
> }[]
> ```

***

### useInviteCode

`workspaces.useInviteCode`

Use an invite code to join a workspace

**Risk:** `write`

```ts theme={null}
await corsair.railway.api.workspaces.useInviteCode({ code: 'postgres' });
```

**Input**

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

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `adoptionHistory` | `object[] \| null` | No | — |
| `adoptionLevel` | `number \| null` | No | — |
| `apiTokenRateLimit` | `object \| null` | No | — |
| `avatar` | `string \| null` | No | — |
| `createdAt` | `string \| null` | No | — |
| `customer` | `object \| null` | No | — |
| `discordRole` | `string \| null` | No | — |
| `has2FAEnforcement` | `boolean \| null` | No | Whether 2FA enforcement is enabled for this workspace. |
| `hasAutomaticDiagnosis` | `boolean \| null` | No | Whether automatic deployment diagnosis is enabled for this workspace. |
| `hasGuardrailsAccess` | `boolean \| null` | No | Whether this workspace has access to guardrails policies. |
| `hasHipaaBAA` | `boolean \| null` | No | Whether this workspace has a signed HIPAA Business Associate Agreement, from either the legacy hasBAA flag or the HIPAA\_BAA spend commitment feature. |
| `hasSAML` | `boolean \| null` | No | — |
| `id` | `string \| null` | No | — |
| `members` | `object[] \| null` | No | — |
| `name` | `string \| null` | No | — |
| `partnerProfile` | `object \| null` | No | — |
| `plan` | `string \| null` | No | — |
| `preferredRegion` | `string \| null` | No | — |
| `projectCount` | `number \| null` | No | Total number of projects in this workspace. Used by the dashboard to show an exact count without paginating through every project. |
| `redactedDueTo2FAPending` | `boolean \| null` | No | Whether the current user's access is redacted due to pending 2FA requirement. Returns true if the user is a workspace member, workspace has 2FA enforcement enabled, and the current user needs to enable 2FA. |
| `referredUsers` | `object[] \| null` | No | — |
| `restrictProjectVisibilityToGroups` | `boolean \| null` | No | — |
| `slackChannelId` | `string \| null` | No | — |
| `subscriptionPlanLimit` | `any \| null` | No | — |
| `updatedAt` | `string \| null` | No | — |
| `usersWithout2FA` | `string[] \| null` | No | Get a list of user emails in the workspace who do not have verified 2FA enabled. Returns an empty array if all users have 2FA enabled. |

> [accordion] adoptionHistory full type
>
> ```ts theme={null}
> {
>   adoptionLevel?: number | null,
>   createdAt?: string | null,
>   deltaLevel?: number | null,
>   id?: string | null,
>   matchedIcpEmail?: string | null,
>   monthlyEstimatedUsage?: number | null,
>   numConfigFile?: number | null,
>   numCronSchedule?: number | null,
>   numDeploys?: number | null,
>   numEnvs?: number | null,
>   numFailedDeploys?: number | null,
>   numHealthcheck?: number | null,
>   numIconConfig?: number | null,
>   numRegion?: number | null,
>   numReplicas?: number | null,
>   numRootDirectory?: number | null,
>   numSeats?: number | null,
>   numServices?: number | null,
>   numVariables?: number | null,
>   numWatchPatterns?: number | null,
>   totalCores?: number | null,
>   totalDisk?: number | null,
>   totalNetwork?: number | null,
>   updatedAt?: string | null
> }[] | null
> ```

> [accordion] apiTokenRateLimit full type
>
> ```ts theme={null}
> {
>   remainingPoints?: number | null,
>   resetsAt?: string | null
> } | null
> ```

> [accordion] customer full type
>
> ```ts theme={null}
> {
>   appliedCredits?: number | null,
>   billingEmail?: string | null,
>   creditBalance?: number | null,
>   currentUsage?: number | null,
>   defaultPaymentMethodId?: string | null,
>   hasExhaustedFreePlan?: boolean | null,
>   id?: string | null,
>   isPrepaying?: boolean | null,
>   isTrialing?: boolean | null,
>   isUsageSubscriber?: boolean | null,
>   isWithdrawingToCredits?: boolean | null,
>   remainingUsageCreditBalance?: number | null,
>   state?: string | null,
>   stripeCustomerId?: string | null,
>   supportedWithdrawalPlatforms?: string[] | null,
>   trialDaysRemaining?: number | null
> } | null
> ```

> [accordion] members full type
>
> ```ts theme={null}
> {
>   avatar?: string | null,
>   email?: string | null,
>   featureFlags?: string[] | null,
>   id?: string | null,
>   name?: string | null,
>   role?: string | null,
>   twoFactorAuthEnabled?: boolean | null
> }[] | null
> ```

> [accordion] partnerProfile full type
>
> ```ts theme={null}
> {
>   category?: string | null,
>   description?: string | null,
>   slug?: string | null,
>   type?: string | null,
>   website?: string | null
> } | null
> ```

> [accordion] referredUsers full type
>
> ```ts theme={null}
> {
>   code?: string | null,
>   id?: string | null,
>   status?: string | null
> }[] | null
> ```

***

## Workspace Templates

### list

`workspaceTemplates.list`

Get all templates for a workspace, one page at a time (first/after)

**Risk:** `read`

```ts theme={null}
await corsair.railway.api.workspaceTemplates.list({ workspaceId: '00000006-5c1e-4d8a-9f43-2b6e1c0a9d17' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `before` | `string` | No | — |
| `first` | `number` | No | — |
| `last` | `number` | No | — |
| `workspaceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[] \| null` | No | The nodes of this page. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] items full type
>
> ```ts theme={null}
> {
>   activeProjects?: number | null,
>   canvasConfig?: any | null,
>   category?: string | null,
>   code?: string | null,
>   communityThreadSlug?: string | null,
>   createdAt?: string | null,
>   creator?: {
>     avatar?: string | null,
>     hasPublicProfile?: boolean | null,
>     name?: string | null,
>     username?: string | null
>   } | null,
>   demoProjectId?: string | null,
>   description?: string | null,
>   guides?: {
>     post?: string | null,
>     video?: string | null
>   } | null,
>   health?: number | null,
>   id?: string | null,
>   image?: string | null,
>   isApproved?: boolean | null,
>   isOuterEdge?: boolean | null,
>   isV2Template?: boolean | null,
>   isVerified?: boolean | null,
>   languages?: string[] | null,
>   maintainer?: {
>     avatar?: string | null,
>     id?: string | null,
>     name?: string | null
>   } | null,
>   name?: string | null,
>   projects?: number | null,
>   publishingAllowance?: {
>     blockedReason?: string | null,
>     deployingWorkspaces?: number | null,
>     deployingWorkspacesPerExtraLive?: number | null,
>     liveLimit?: number | null,
>     liveTemplates?: number | null,
>     status?: string | null,
>     workspaceAgeDays?: number | null
>   } | null,
>   publishingRestrictionId?: string | null,
>   readme?: string | null,
>   recentProjects?: number | null,
>   serializedConfig?: any | null,
>   similarTemplates?: {
>     code?: string | null,
>     createdAt?: string | null,
>     deploys?: number | null,
>     description?: string | null,
>     health?: number | null,
>     image?: string | null,
>     name?: string | null,
>     userId?: string | null,
>     workspaceId?: string | null
>   }[] | null,
>   status?: string | null,
>   supportHealthMetrics?: any | null,
>   tags?: string[] | null,
>   totalPayout?: number | null,
>   updatedAt?: string | null,
>   workspaceId?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   hasPreviousPage?: boolean | null,
>   startCursor?: string | null,
>   endCursor?: string | null
> } | null
> ```

***


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