Update a workspace

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
FieldTypeDescription
idrequiredstring · pathThe organization's id (`org_…`), from `GET /whoami` or Organization → API.
workspace_idrequiredstring · pathThe workspace's id (`ws_…`).
Request body3 fields
FieldTypeDescription
namestring—
external_idstring—
sms_purchases_cap_centsintegerThe 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
FieldTypeDescription
objectrequiredenumworkspace—
idrequiredstring`ws_…`
namerequiredstring—
slugrequiredstring—
external_idrequiredstringYour own id for it, unique in the organization.
planrequiredstring`free`, or the paid plan's key.
paid_byrequiredenumworkspace | organization—
requires_paid_planrequiredbooleanNo free allowance: the Owner already has a free workspace, so it sends once a plan is bought.
sms_purchases_cap_centsintegerThe 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_atrequiredstring—
restorable_untilrequiredstringOnce closed: the last moment it can be restored, 30 days after `closed_at`. Null while open.
deletes_atstringOnce 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_planobjectOn 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_atrequiredstring—
hosted_invoice_urlstringOn create only: the card asked for authentication; paying here starts the plan.
200401403404409422429

Search docs and guides

Search the docs and product guides.