# Instances

Source: https://www.pontive.com/docs/api-reference/platform/instances

Base URL: `https://api.pontive.com/v1` (operations that name another server say so).

## List instances

```http
GET https://api.pontive.com/v1/instances
```

List the instances of a project or a workspace. One of project_id or workspace_id is required, but for Pontive's staff, who list every instance. A token acting for a Pontive user through an actor (the Pontive MCP server) lists the instances the user's own roles reach, never a staff role's: those of the project or workspace named, else of every workspace the user belongs to.

Operation ID: `ListInstances`

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | string |  | Filter by project ID |
| `workspace_id` | string |  | Filter by workspace ID |
| `environment` | "production" \| "non_production" |  | Filter by environment |
| `status` | "active" \| "paused" \| "deleted" |  | Filter by the instance's own status |
| `page` | integer |  | Page number |
| `limit` | integer |  | Page size (default 25, at most 100) |
| `sort` | string |  | Sort order |

### Responses

- `200` OK: ListInstancesResponse
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `500` Internal Server Error: ErrResponse

## Create instance

```http
POST https://api.pontive.com/v1/instances
```

Create an instance in a project. name and slug are required for non_production and must be omitted for production, which is always Production/production and limited to one per project.

Operation ID: `CreateInstance`

### Request body (`application/json`, required): CreateInstanceRequest

Create Instance Request

### Responses

- `201` Created: Instance
- `400` invalid_environment, invalid_slug, slug_reserved, slug_too_long, instance_name_not_settable: ErrResponse
- `403` Forbidden: ErrResponse
- `404` project_not_found: ErrResponse
- `409` slug_conflict, prod_instance_exists, prod_instance_limit_exceeded, non_prod_instance_limit_exceeded: ErrResponse
- `500` Internal Server Error: ErrResponse

## Get instance

```http
GET https://api.pontive.com/v1/instances/{instance_id}
```

Get instance details by ID

Operation ID: `GetInstance`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |

### Responses

- `200` OK: Instance
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` instance_not_found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Update instance

```http
PATCH https://api.pontive.com/v1/instances/{instance_id}
```

Update an instance. name is writable on non_production instances only; renaming the production instance returns instance_name_not_settable.

Operation ID: `UpdateInstance`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |

### Request body (`application/json`, required): UpdateInstanceRequest

Update Instance Request

### Responses

- `200` OK: Instance
- `400` instance_name_not_settable: ErrResponse
- `403` Forbidden: ErrResponse
- `404` instance_not_found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Delete instance

```http
DELETE https://api.pontive.com/v1/instances/{instance_id}
```

Soft-delete an instance, recoverable for 30 days: it carries purge_scheduled_at, deleted_at plus 30 days, and is purged after it. Requires {"confirm_delete": true}; without it the API returns 400 confirmation_required. A project keeps at least one active instance: deleting its last one returns 409 last_active_instance. A token acting for a Pontive user (the Pontive MCP server) deletes a non_production instance only; the production one is refused with 403 actor_refused, to be deleted in the dashboard.

Operation ID: `DeleteInstance`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |

### Request body (`application/json`, required): DeleteInstanceRequest

Delete confirmation

### Responses

- `204` Instance deleted successfully
- `400` confirmation_required: ErrResponse
- `403` Forbidden: ErrResponse
- `404` instance_not_found: ErrResponse
- `409` last_active_instance: ErrResponse
- `500` Internal Server Error: ErrResponse

## Pause instance

```http
POST https://api.pontive.com/v1/instances/{instance_id}/pause
```

Pause an instance. A project keeps at least one active instance: pausing its last one returns 409 last_active_instance.

Operation ID: `PauseInstance`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |

### Responses

- `200` OK: Instance
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` instance_not_found: ErrResponse
- `409` last_active_instance: ErrResponse
- `500` Internal Server Error: ErrResponse

## Purge instance

```http
POST https://api.pontive.com/v1/instances/{instance_id}/purge
```

Permanently delete a deleted instance and all its data now, rather than at its purge_scheduled_at, and retire its host label. Cannot be undone.

Operation ID: `PurgeInstance`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |

### Responses

- `204` Instance purged successfully
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` instance_not_found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Restore instance

```http
POST https://api.pontive.com/v1/instances/{instance_id}/restore
```

Restore a soft-deleted instance within 30 days of its deletion, until its purge_scheduled_at (409 restore_window_closed after, when it is purged).

Operation ID: `RestoreInstance`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |

### Responses

- `200` OK: Instance
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` instance_not_found: ErrResponse
- `409` restore_window_closed: ErrResponse
- `500` Internal Server Error: ErrResponse

## Resume instance

```http
POST https://api.pontive.com/v1/instances/{instance_id}/resume
```

Resume a paused instance

Operation ID: `ResumeInstance`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |

### Responses

- `200` OK: Instance
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` instance_not_found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Schemas

### ListInstancesResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | Instance[] |  | List of instances |
| `object` | string |  | The object type |
| `pagination` | Pagination |  | Pagination information |

### ErrResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | ErrBody |  |  |

### CreateInstanceRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  | The description of the instance (0-500 chars) |
| `environment` | "production" \| "non_production" | yes | The environment of the instance. A project holds at most one production instance. |
| `metadata` | Metadata |  | The new metadata |
| `name` | string |  | The name of the instance (1-100 chars). Required for non_production; must be omitted for production (instance_name_not_settable). |
| `project_id` | string | yes | The ID of the project to create the instance in |
| `slug` | string |  | The slug of the instance (2-20 chars). Required for non_production; must be omitted for production (instance_name_not_settable). |

### Instance

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `auth_server_domains` | string[] |  | All active auth-server domains, canonical first |
| `capabilities` | Capabilities |  | The per-instance capability switches |
| `created_at` | string (date-time) |  | The time when the instance was created |
| `deleted_at` | string (date-time) |  | The time when the instance was deleted, if applicable |
| `description` | string |  | The description of the instance |
| `domain` | string |  | The primary (canonical) auth domain |
| `effective_status` | "active" \| "paused" \| "deleted" |  | The effective status: the project's status overrides the instance's own while the project is not active |
| `environment` | "production" \| "non_production" |  | The environment of the instance, fixed at creation |
| `id` | string |  | The unique identifier of the instance |
| `metadata` | Metadata |  | The new metadata |
| `name` | string |  | The name of the instance. Always "Production" for the production instance. |
| `object` | string |  | The object type |
| `paused_at` | string (date-time) |  | The time when the instance was paused, if applicable |
| `project_id` | string |  | The ID of the project the instance belongs to |
| `purge_scheduled_at` | string (date-time) |  | When a deleted instance's restore window ends, deleted_at plus 30 days: it can be restored until then, and is purged after (route review D30). Null unless the instance's own status is is deleted. An instance of a deleted project goes with it, at the project's purge_scheduled_at. |
| `region` | "us" \| "eu" \| "au" |  | The region, inherited from the project |
| `shard_id` | string |  | The ID of the shard the instance is deployed on |
| `slug` | string |  | The slug of the instance. Always "production" for the production instance. Immutable. |
| `status` | "active" \| "paused" \| "deleted" |  | The instance's own status |
| `tenancy_mode` | "b2b" \| "b2c" |  | The read-only tenancy mode, inherited from the project |
| `updated_at` | string (date-time) |  | The time when the instance was last updated |
| `workspace_id` | string |  | The ID of the workspace that owns the project |

### UpdateInstanceRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  | The new description |
| `metadata` | Metadata |  | The new metadata |
| `name` | string |  | The new name. non_production only; renaming the production instance returns instance_name_not_settable. |

### DeleteInstanceRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `confirm_delete` | boolean |  | Must be true; without it the API returns 400 confirmation_required. |

### Pagination

Pagination information

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer |  | Number of records per page |
| `page` | integer |  | Current page number |
| `total` | integer |  | Total number of records |
| `total_pages` | integer |  | Total number of pages |

### ErrBody

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | string |  | Code is a stable machine-readable identifier for this error: the domain code where one exists (e.g. slug_conflict, instance_not_found, confirmation_required), else the spec's generic code (invalid_request, permission_denied, not_found, conflict, internal_error). |
| `doc_url` | string |  | DocURL links to documentation about this error, when available. |
| `message` | string |  | Message is a human-readable description of what went wrong. |
| `object` | string |  | Object is the discriminator; always "error". |
| `param` | string |  | Param names the request parameter this error refers to, when applicable. |
| `type` | string |  | Type is the error's category, from its HTTP status: validation_error, authentication_error, authorization_error, not_found, conflict_error, rate_limit_error or internal_error. |

### Metadata

The new metadata

Type: Record<string, string>

### Capabilities

The per-instance capability switches

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `billing` | Capability |  | Fine-Grained Authorization: custom resource types and everything built on them. |
| `fga` | Capability |  | Fine-Grained Authorization: custom resource types and everything built on them. |

### Capability

Fine-Grained Authorization: custom resource types and everything built
on them.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean |  | Whether the capability is enabled |
