---
title: "Update a workspace"
description: "Rename a workspace, change its external_id (null clears it), or set its monthly SMS API spend cap (sms_purchases_cap_cents, null clears it). `PATCH /api/v1/organizations/{id}/workspaces/{workspace_id}`"
url: https://www.unitpost.com/docs/platform/patch-organizations-id-workspaces-workspace-id
section: "Platform API reference"
updated: 2026-11-17
---
# Update a workspace

`PATCH /api/v1/organizations/{id}/workspaces/{workspace_id}`

Rename a workspace, change its `external_id` (null clears it), or set its monthly SMS API spend cap (`sms_purchases_cap_cents`, null clears it). A cap above 0 needs a workspace the organization pays for and is at most the Owner's largest (Organization → API); 0 or null is always allowed. Takes an organization key (`ok_live_…`) with `organizations:write`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The organization's id (`org_…`), from `GET /whoami` or Organization → API. |
| `workspace_id` | path | string | yes | The workspace's id (`ws_…`). |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | — |
| `external_id` | string | no | — |
| `sms_purchases_cap_cents` | integer | no | The monthly SMS purchases cap, in cents; null clears it. Above 0 only on a workspace the organization pays for, and at most the Owner's largest. |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | enum | yes | One of: `workspace`. |
| `id` | string | yes | `ws_…` |
| `name` | string | yes | — |
| `slug` | string | yes | — |
| `external_id` | string | yes | Your own id for it, unique in the organization. |
| `plan` | string | yes | `free`, or the paid plan's key. |
| `paid_by` | enum | yes | One of: `workspace`, `organization`. |
| `requires_paid_plan` | boolean | yes | No free allowance: the Owner already has a free workspace, so it sends once a plan is bought. |
| `sms_purchases_cap_cents` | integer | no | The workspace's monthly cap on SMS purchases by API, in cents (ADR-0114). Null: none, so every API purchase is refused with `api_spend_cap_not_set`. |
| `closed_at` | string | yes | — |
| `restorable_until` | string | yes | Once closed: the last moment it can be restored, 30 days after `closed_at`. Null while open. |
| `deletes_at` | string | no | Once closed: when it is deleted unless restored, the later of `restorable_until` and 7 days after the end of the billing period it closed in (so that period's usage stays readable). Its SMS numbers are released then. Null while open. |
| `shared_plan` | object | no | On the organization's shared plan: its cap on what it draws each period (`cap_cents`, null: none) and when it joined. Null when it isn't on it. Its usage is on `GET /organizations/{id}/shared-plan/workspaces`. |
| `created_at` | string | yes | — |
| `hosted_invoice_url` | string | no | On create only: the card asked for authentication; paying here starts the plan. |

## Responses

| Status | Description |
| --- | --- |
| 200 | The workspace. |
| 401 | Missing or invalid organization key (a workspace key is refused). |
| 403 | API access not approved for the organization, the key lacks the capability, or no User-Agent. |
| 404 | Not this key's organization, or not one of its workspaces. |
| 409 | The external_id is taken, or an SMS purchases cap above 0 on a workspace that pays for itself (its owner sets it in the dashboard or with `PATCH /spend-caps`, which takes `spend_caps:write`). |
| 422 | Invalid body, or an SMS purchases cap above the Owner's largest. |
| 429 | The organization's rate limit. |

## Example request

```bash
curl -X PATCH 'https://www.unitpost.com/api/v1/organizations/org_123/workspaces/ws_123' \
  -H 'Authorization: Bearer YOUR_ORG_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Acme Bakery & Cafe"
  }'
```

## Example response (200)

```json
{
  "object": "workspace",
  "id": "id_123",
  "name": "Example",
  "slug": "string",
  "external_id": "external_123",
  "plan": "string",
  "paid_by": "workspace",
  "requires_paid_plan": false,
  "sms_purchases_cap_cents": 0,
  "closed_at": "2026-01-01T00:00:00.000Z",
  "restorable_until": "2026-01-01T00:00:00.000Z",
  "deletes_at": "2026-01-01T00:00:00.000Z",
  "shared_plan": {
    "cap_cents": 0,
    "joined_at": "2026-01-01T00:00:00.000Z"
  },
  "created_at": "2026-01-01T00:00:00.000Z",
  "hosted_invoice_url": "https://example.com"
}
```

## Links

- HTML reference (with Node.js, Python, Ruby, PHP, Laravel, Go, Java, Rust, .NET and CLI examples): https://www.unitpost.com/docs/platform/patch-organizations-id-workspaces-workspace-id
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
