Update a workspace
PATCH/api/v1/organizations/{id}/workspaces/{workspace_id}
PATCH /organizations/{id}/workspaces/{workspace_id}
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"
}'Response · 200
{
"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"
}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.
Parameters2 fields
| Field | Type | Description |
|---|---|---|
idrequired | string · path | The organization's id (`org_…`), from `GET /whoami` or Organization → API. |
workspace_idrequired | string · path | The workspace's id (`ws_…`). |
Request body3 fields
| Field | Type | Description |
|---|---|---|
name | string | — |
external_id | string | — |
sms_purchases_cap_cents | integer | 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 · 200 fields15 fields
| Field | Type | Description |
|---|---|---|
objectrequired | enumworkspace | — |
idrequired | string | `ws_…` |
namerequired | string | — |
slugrequired | string | — |
external_idrequired | string | Your own id for it, unique in the organization. |
planrequired | string | `free`, or the paid plan's key. |
paid_byrequired | enumworkspace | organization | — |
requires_paid_planrequired | boolean | No free allowance: the Owner already has a free workspace, so it sends once a plan is bought. |
sms_purchases_cap_cents | integer | 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_atrequired | string | — |
restorable_untilrequired | string | Once closed: the last moment it can be restored, 30 days after `closed_at`. Null while open. |
deletes_at | string | 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 | 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_atrequired | string | — |
hosted_invoice_url | string | On create only: the card asked for authentication; paying here starts the plan. |
200401403404409422429