# Workspaces

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

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

## List workspaces

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

The caller's workspaces. A deleted workspace is gone to its members: it is listed, with status deleted, to Pontive's staff alone, who restore it; status=deleted lists only those.

Operation ID: `ListWorkspaces`

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | "active" \| "pastdue" \| "suspended" \| "cancelled" \| "deleted" |  | Filter by status |
| `plan` | "free" \| "pro" \| "enterprise" |  | Filter by plan |
| `page` | integer |  | Page number |
| `limit` | integer |  | Page size (default 25, at most 100) |
| `sort` | string |  | Sort order |
| `search` | string |  | Search term (slug,description,name depending on implementation) |

### Responses

- `200` OK: ListWorkspacesResponse
- `400` Bad Request: ErrResponse
- `500` Internal Server Error: ErrResponse

## Create workspace

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

Create a new workspace

Operation ID: `CreateWorkspace`

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

Create Workspace Request

### Responses

- `201` Created: Workspace
- `400` Bad Request: ErrResponse
- `500` Internal Server Error: ErrResponse

## Get workspace

```http
GET https://api.pontive.com/v1/workspaces/{workspace_id}
```

One workspace. A deleted one answers 404 to its members and is returned, with status deleted and deleted_at, to Pontive's staff.

Operation ID: `GetWorkspace`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | yes | Workspace ID |

### Responses

- `200` OK: Workspace
- `400` Bad Request: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Update workspace

```http
PATCH https://api.pontive.com/v1/workspaces/{workspace_id}
```

Update an existing workspace. The name, description and metadata need workspace:manage; the billing contact needs workspace:billing.manage, and a request carrying only the billing contact needs nothing else, so a billing member sets where the invoices go. A token acting for a Pontive user (the Pontive MCP server) is refused the billing contact with 403 actor_refused: it is set in the dashboard.

Operation ID: `UpdateWorkspace`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | yes | Workspace ID |

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

Update Workspace Request

### Responses

- `200` OK: Workspace
- `400` Bad Request: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Delete workspace

```http
DELETE https://api.pontive.com/v1/workspaces/{workspace_id}
```

The recoverable delete: the workspace's status becomes deleted, it disappears for its members, and Pontive's admins can restore it for 60 days (POST …/restore), until its purge_scheduled_at, when it is purged with everything it holds; POST …/purge deletes it for good now. Its contract on Pontive's billing ends with the current period, and that period's usage bills on its final invoice. A workspace is deleted last: with no live projects (409 workspace_has_projects) and nothing owed (402 outstanding_balance).

Operation ID: `DeleteWorkspace`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | yes | Workspace ID |

### Responses

- `204` Workspace deleted successfully
- `400` Bad Request: ErrResponse
- `402` outstanding_balance: ErrResponse
- `404` Not Found: ErrResponse
- `409` workspace_has_projects: ErrResponse
- `500` Internal Server Error: ErrResponse

## Cancel workspace

```http
POST https://api.pontive.com/v1/workspaces/{workspace_id}/cancel
```

Close the account: the workspace is cancelled now and read-only, and deleted 30 days later, at its deletion_scheduled_at, unless its owner restores it before. Its contract on Pontive's billing ends with the current period, and that period's usage bills on its final invoice. Needs confirm: true (400 confirmation_required); reason and feedback are for Pontive's analytics. Its owner only (403 for anyone else, its admins included).

Operation ID: `CancelWorkspace`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | yes | Workspace ID |

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

Confirmation, and why

### Responses

- `200` OK: Workspace
- `400` confirmation_required: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Purge workspace

```http
POST https://api.pontive.com/v1/workspaces/{workspace_id}/purge
```

Delete a deleted workspace for good, now, rather than at the end of its restore window: its organization and everything under it go, and nothing restores it (GDPR erasure). The workspace must be deleted first (DELETE). Only the workspace's owner and Pontive's admins purge; anyone else, a workspace admin included, is refused with 403, as is a token acting for a user.

Operation ID: `PurgeWorkspace`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | yes | Workspace ID |

### Responses

- `204` Workspace purged successfully
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Restore workspace

```http
POST https://api.pontive.com/v1/workspaces/{workspace_id}/restore
```

Undo a cancellation within 30 days, or a delete within 60 days (409 restore_window_closed after, at deletion_scheduled_at and purge_scheduled_at): the workspace is active again. A cancelled workspace is restored by its owner or Pontive's admins; a deleted one by Pontive's admins only (403 for anyone else). While its contract is still ending, at most until the period's end, the restore revokes the contract's cancellation: a workspace on a paid plan then bills again, so it needs a payment method on its Customer that can be charged, read from Pontive's billing at the time of the restore (402 payment_method_required with none or an expired card; 503 when billing cannot be reached); one on Free needs none. Once the contract has ended, the workspace restarts on a new contract on Free, with no card needed, and its owner upgrades from there. A suspended workspace is resumed instead.

Operation ID: `RestoreWorkspace`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | yes | Workspace ID |

### Responses

- `200` OK: Workspace
- `400` Bad Request: ErrResponse
- `402` payment_method_required: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `409` restore_window_closed: ErrResponse
- `500` Internal Server Error: ErrResponse
- `503` Service Unavailable: ErrResponse

## Resume workspace

```http
POST https://api.pontive.com/v1/workspaces/{workspace_id}/resume
```

Suspend's pair: a suspended workspace goes back to the status its payment is in — past_due while it still is, active once paid. One suspended for an unpaid invoice stays suspended (402 outstanding_balance): paying lifts it. Needs workspace:delete.

Operation ID: `ResumeWorkspace`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | yes | Workspace ID |

### Responses

- `200` OK: Workspace
- `400` Bad Request: ErrResponse
- `402` Payment Required: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Suspend workspace

```http
POST https://api.pontive.com/v1/workspaces/{workspace_id}/suspend
```

Suspend a past-due workspace: its console takes no writes but billing's until it is resumed or paid. Needs workspace:delete.

Operation ID: `SuspendWorkspace`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | yes | Workspace ID |

### Responses

- `200` OK: Workspace
- `400` Bad Request: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Schemas

### ListWorkspacesResponse

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

### ErrResponse

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

### CreateWorkspaceRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  | The description of the workspace |
| `name` | string |  | The name of the workspace required: true minLength: 1 maxLength: 255 |

### Workspace

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `billing_contact` | BillingContact |  | Replaces the billing contact, where invoices and receipts are emailed. Its email is required. Needs workspace:billing.manage; sent on its own it needs nothing else, so a billing member sets it. |
| `cancelled_at` | string (date-time) |  | When the workspace was cancelled (pontive-spec 01, Cancellation flow). Set while it is cancelled. |
| `created_at` | string (date-time) |  | The time when the workspace was created |
| `deleted_at` | string (date-time) |  | The time when the workspace was deleted |
| `deletion_scheduled_at` | string (date-time) |  | When a cancelled workspace is deleted unless it is restored first, cancelled_at plus 30 days: its owner restores it until then. Set only on a cancelled workspace. |
| `description` | string |  | The description of the workspace |
| `id` | string |  | The unique identifier of the workspace |
| `metadata` | Metadata |  | The new metadata for the workspace |
| `name` | string |  | The name of the workspace |
| `object` | string |  | The object type |
| `purge_scheduled_at` | string (date-time) |  | When a deleted workspace's restore window ends, deleted_at plus 60 days: it can be restored until then (route review D30). Set only on a deleted workspace. |
| `slug` | string |  | The slug of the workspace |
| `status` | string |  | The current status of the workspace enum: active,pastdue,suspended,cancelled,deleted |
| `system` | "holding" |  | System marks a workspace Pontive keeps for itself, shown to Pontive's staff only: holding, the installation's one holding workspace, which owns the unclaimed development instances until they are claimed (pontive-spec 47 §4.2). Absent for every customer workspace. |
| `updated_at` | string (date-time) |  | The time when the workspace was last updated |

### UpdateWorkspaceRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `billing_contact` | BillingContact |  | Replaces the billing contact, where invoices and receipts are emailed. Its email is required. Needs workspace:billing.manage; sent on its own it needs nothing else, so a billing member sets it. |
| `description` | string |  | The new description for the workspace |
| `metadata` | Metadata |  | The new metadata for the workspace |
| `name` | string |  | The new name for the workspace minLength: 1 maxLength: 255 |

### CancelWorkspaceRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `confirm` | boolean |  | Must be true: closing the account is confirmed (400 confirmation_required otherwise). |
| `feedback` | string |  | Free-form feedback, for Pontive's analytics. maxLength: 2000 |
| `reason` | "no_longer_needed" \| "too_expensive" \| "missing_features" \| "switching_providers" \| "other" \| "no_longer_needed" \| "too_expensive" \| "missing_features" \| "switching_providers" \| "other" |  | Why the account is closed, for Pontive's analytics. |

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

### BillingContact

Replaces the billing contact, where invoices and receipts are emailed.
Its email is required. Needs workspace:billing.manage; sent on its own
it needs nothing else, so a billing member sets it.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `address` | string |  | The address of the billing contact |
| `city` | string |  | The city of the billing contact |
| `company_name` | string |  | The company name of the billing contact |
| `country` | string |  | The country of the billing contact |
| `email` | string |  | The email of the billing contact |
| `name` | string |  | The name of the billing contact |
| `phone` | string |  | The phone of the billing contact |
| `state` | string |  | The state of the billing contact |
| `tax_id` | string |  | The tax ID of the billing contact |
| `tax_rate` | string |  | The tax rate of the billing contact |
| `zip` | string |  | The zip code of the billing contact |

### Metadata

The new metadata for the workspace

Type: Record<string, string>
