---
title: "Organizations API"
description: "For platforms that give each customer a workspace: an organization key creates, lists, closes and restores the organization's workspaces and mints their keys, and registers webhook endpoints that receive every workspace's events, each naming its workspace (workspace_id, external_id)."
url: https://www.unitpost.com/docs/platform/organizations
section: "Platform API reference"
updated: 2026-11-17
---
# Organizations API

> For platforms that give each customer a workspace: an organization key creates, lists, closes and restores the organization's workspaces and mints their keys, and registers webhook endpoints that receive every workspace's events, each naming its workspace (`workspace_id`, `external_id`). Staff approve each organization first. To change the plan of a workspace the organization pays for, quote it (`POST …/plan-quotes`), show the price, then confirm the quote within 10 minutes; that takes `organizations:billing`, which only an organization Owner gives a key. Creates and plan changes stay within the Owner's API rules: the plans they allow, up to their largest plan price (with none set, each plan's lowest price). An organization can also ask for shared usage (Organization → Billing, Request access): one Starter or Growth plan whose allowance its workspaces share, turned on by Unitpost on request. `GET …/shared-plan` reads it; `PUT`, `PATCH` and `DELETE …/shared-plan/workspaces/{workspace_id}` add a workspace, set its cap and take it off (`organizations:billing`). Buying, upgrading and ending it stay in the dashboard.

Full schemas: [OpenAPI 3.1](https://www.unitpost.com/api/v1/openapi.json). HTML reference: https://www.unitpost.com/docs/platform/organizations.

## Operations

### `GET /api/v1/organizations/{id}/workspaces`

List the organization's workspaces

The organization's workspaces, newest first and cursor-paginated (`limit`, `after`, `before`). `external_id` narrows to the workspace you gave that id. Takes an organization key (`ok_live_…`) with `organizations:read`.

Reference: https://www.unitpost.com/docs/platform/get-organizations-id-workspaces ([Markdown](https://www.unitpost.com/docs/platform/get-organizations-id-workspaces.md))

### `POST /api/v1/organizations/{id}/workspaces`

Create a workspace

Create a workspace in the organization. Its Owner is the person who made the key. The plan follows the Owner's API rules (Organization → API): `free`, or a paid plan they allowed at a price no higher than their largest plan price (with none set, the plan's lowest), billed to the organization's card within its workspace limit. `Idempotency-Key` is required; a retry with it returns the first result. `sms_purchases_cap_cents` sets the workspace's monthly SMS purchases cap, at most the Owner's largest; left out, a paid workspace starts with the Owner's default and a free one with none. `shared_plan: true` makes it straight onto the organization's shared plan instead of a plan of its own (it also needs `organizations:billing`, like `PUT /organizations/{id}/shared-plan/workspaces/{workspace_id}`); a refused join makes nothing. Takes an organization key (`ok_live_…`) with `organizations:write`.

Reference: https://www.unitpost.com/docs/platform/post-organizations-id-workspaces ([Markdown](https://www.unitpost.com/docs/platform/post-organizations-id-workspaces.md))

### `GET /api/v1/organizations/{id}/usage`

List usage by workspace

Usage and spend for each of the organization's workspaces, one row per workspace, newest first and cursor-paginated by workspace (`limit` 1 to 25, default 10; `after` and `before` take a `ws_…` id). A `limit` above 25 is a 422, not a shorter page; read more with `after`. Each workspace renews on its own date, so a row covers that workspace's own billing period: `period=current` (the default) is its open period, and an ISO 8601 instant is its period that contains that instant. A workspace with no recorded period at that instant (it did not exist yet, or nothing was used in that period) has `period_start` and `period_end` null and every number 0. `spend`, `sms`, `emails.sent`, `plan` and the period are built as `GET /usage` builds them, so for the open period a row equals that workspace's `GET /usage`; amounts are integer USD cents rounded per workspace, and the organization's total is the sum of the rows. Closed workspaces are listed, with `closed_at`, until they are deleted. `external_id` narrows to the workspace you gave that id. Takes an organization key (`ok_live_…`) with `organizations:read`.

Reference: https://www.unitpost.com/docs/platform/get-organizations-id-usage ([Markdown](https://www.unitpost.com/docs/platform/get-organizations-id-usage.md))

### `GET /api/v1/organizations/{id}/workspaces/{workspace_id}`

Get a workspace

One of the organization's workspaces. Takes an organization key (`ok_live_…`) with `organizations:read`.

Reference: https://www.unitpost.com/docs/platform/get-organizations-id-workspaces-workspace-id ([Markdown](https://www.unitpost.com/docs/platform/get-organizations-id-workspaces-workspace-id.md))

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

Update a workspace

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

Reference: https://www.unitpost.com/docs/platform/patch-organizations-id-workspaces-workspace-id ([Markdown](https://www.unitpost.com/docs/platform/patch-organizations-id-workspaces-workspace-id.md))

### `POST /api/v1/organizations/{id}/workspaces/{workspace_id}/close`

Close a workspace

The workspace stops working at once: its keys are revoked, every request to it is refused and its campaigns pause. Its SMS numbers renew nothing while it is closed. It can be restored for 30 days. Unless restored, it is deleted once those 30 days are over and 7 days have passed since the end of the billing period it closed in (so that period's usage stays readable with `GET /organizations/{id}/usage`), and its numbers are released then. Closing twice changes nothing. Takes an organization key (`ok_live_…`) with `organizations:write`.

Reference: https://www.unitpost.com/docs/platform/post-organizations-id-workspaces-workspace-id-close ([Markdown](https://www.unitpost.com/docs/platform/post-organizations-id-workspaces-workspace-id-close.md))

### `POST /api/v1/organizations/{id}/workspaces/{workspace_id}/restore`

Restore a workspace

Reopen a closed workspace within 30 days. Its old keys stay revoked: mint new ones. An SMS number renewal that fell due while it was closed is charged once, for the period in progress, and any grace resumes with the time it had left. Takes an organization key (`ok_live_…`) with `organizations:write`.

Reference: https://www.unitpost.com/docs/platform/post-organizations-id-workspaces-workspace-id-restore ([Markdown](https://www.unitpost.com/docs/platform/post-organizations-id-workspaces-workspace-id-restore.md))

### `POST /api/v1/organizations/{id}/workspaces/{workspace_id}/api-keys`

Mint a workspace key

A workspace key for one of the organization's workspaces: it reaches only that workspace, can't manage keys, and is revoked with the organization key that minted it. The secret is returned once. `opt_in_capabilities: ["sms:purchase"]` adds SMS purchases (quote, then confirm), which no scope grants: only on a workspace the organization pays for that has an SMS purchases cap. Takes an organization key (`ok_live_…`) with `organizations:write`.

Reference: https://www.unitpost.com/docs/platform/post-organizations-id-workspaces-workspace-id-api-keys ([Markdown](https://www.unitpost.com/docs/platform/post-organizations-id-workspaces-workspace-id-api-keys.md))

### `POST /api/v1/organizations/{id}/workspaces/{workspace_id}/plan-quotes`

Quote a plan change

What moving a workspace to `plan` and `tier_index` would do; nothing is changed or charged. `kind` is `upgrade` (now: the new price is charged in full, the billing period restarts, unused allowance carries over), `downgrade` (at the end of the period already paid), `lateral` (now), `start` (from free: now, on the organization's card), `cancel` (to free: the plan ends at the period end) or `noop`. The answer has the prices before and after, `due_now_cents`, `effective_at` and a single-use `confirm_token`, returned only here. A quote lasts 10 minutes. `pending_change` shows a downgrade already scheduled for the period end; with one, a quote for the current plan and tier is a `noop` whose confirm cancels it, so the workspace keeps its plan. On a workspace the organization pays for; or on a free workspace that pays for itself, a paid plan is a `start` billed to the organization (`moves_to_organization: true`), only while organization billing is on. Within the Owner's API rules: an allowed plan at a price no higher than their largest plan price (with none set, the lowest price of each allowed plan). The key's creator must still be an organization Owner. Takes an organization key (`ok_live_…`) with `organizations:billing`.

Reference: https://www.unitpost.com/docs/platform/post-organizations-id-workspaces-workspace-id-plan-quotes ([Markdown](https://www.unitpost.com/docs/platform/post-organizations-id-workspaces-workspace-id-plan-quotes.md))

### `GET /api/v1/organizations/{id}/workspaces/{workspace_id}/plan-quotes/{quote_id}`

Get a plan quote

A plan quote as it was offered, with its `status` (`open`, `confirmed`, `expired`) and, once confirmed, `confirmed_at` and `hosted_invoice_url`. Never the confirm token. Takes an organization key (`ok_live_…`) with `organizations:read`.

Reference: https://www.unitpost.com/docs/platform/get-organizations-id-workspaces-workspace-id-plan-quotes-quote-id ([Markdown](https://www.unitpost.com/docs/platform/get-organizations-id-workspaces-workspace-id-plan-quotes-quote-id.md))

### `POST /api/v1/organizations/{id}/workspaces/{workspace_id}/plan-quotes/{quote_id}/confirm`

Confirm a plan quote

Apply a plan quote, once: the body is its `confirm_token`, and `Idempotency-Key` is required (a retry with it answers what the first call did and never applies twice). The change takes effect as the quote said, the same as a plan change in the dashboard. Everything the quote assumed is checked again: today's API rules, who pays, and that the workspace's plan didn't change since (`quote_stale`). A card that refuses the charge is `402 payment_failed`: nothing changed and the quote stays open until it expires. That is for an upgrade (a lateral move charges nothing now, only Stripe's proration on the next invoice): a `start` from free behaves as a paid create does, so a card that is declined or asks for authentication still answers `200` `confirmed`, with `hosted_invoice_url`; the plan starts when that invoice is paid, and unpaid it lapses after about 23 hours (nothing charged) and the workspace stays on Free. While a change is still being written back (or a first invoice waits), a new quote or confirm for the workspace is `409 conflict` with `details[0].code: "plan_change_in_progress"`. A quote with `moves_to_organization` first moves the free workspace onto the organization's billing (one of its card's workspace slots; at the limit it is `409` and nothing is charged) and, if it has no SMS purchases cap, gives it the Owner's default, as a paid create does. Every refusal frees the `Idempotency-Key`. The workspace's activity log names the organization key, and the organization's Owners and Billing members get an email about the change. The key's creator must still be an organization Owner. Takes an organization key (`ok_live_…`) with `organizations:billing`.

Reference: https://www.unitpost.com/docs/platform/post-organizations-id-workspaces-workspace-id-plan-quotes-quote-id-confirm ([Markdown](https://www.unitpost.com/docs/platform/post-organizations-id-workspaces-workspace-id-plan-quotes-quote-id-confirm.md))

### `GET /api/v1/organizations/{id}/shared-plan`

Get the shared plan

The organization's shared plan: one plan whose allowance its workspaces share. `approved` says whether Unitpost's team turned it on for the organization (it is never on by default: an Owner or Billing member asks on Organization → Billing, `requested_at`). `status` is `none` until a plan is bought there, then the plan's status. With a plan: its `plan`, `tier_index` and list `price_monthly_cents`, the billing period, `cancel_at` (set to end at the period end), the shared `allowance_cents`, what its workspaces drew this period (`used_cents`, `overage_cents` beyond the allowance), the overage band's size (`overage_cap_cents`, null for no band), `paused` (the allowance and band are used up: every workspace on it stops sending until the period renews), `overage_frozen` (Unitpost paused overage: sending stops at the allowance) and how many workspaces it covers (`workspace_limit`) and has (`workspaces`). Buying, upgrading and ending the plan, and raising its workspace number, are done in the dashboard. Takes an organization key (`ok_live_…`) with `organizations:read`.

Reference: https://www.unitpost.com/docs/platform/get-organizations-id-shared-plan ([Markdown](https://www.unitpost.com/docs/platform/get-organizations-id-shared-plan.md))

### `GET /api/v1/organizations/{id}/shared-plan/workspaces`

List the shared plan's workspaces

Every workspace on the shared plan now, oldest first: its id, your `external_id`, `name`, its cap (`cap_cents`: what it may draw each period, allowance and overage together; null for none), `joined_at`, and what it drew this period (`used_cents`). One page: a shared plan covers a bounded number of workspaces, so `has_more` is always false. Takes an organization key (`ok_live_…`) with `organizations:read`.

Reference: https://www.unitpost.com/docs/platform/get-organizations-id-shared-plan-workspaces ([Markdown](https://www.unitpost.com/docs/platform/get-organizations-id-shared-plan-workspaces.md))

### `PATCH /api/v1/organizations/{id}/shared-plan/workspaces/{workspace_id}`

Set a workspace's shared plan cap

Set what a workspace on the shared plan may draw from it each period, allowance and overage together, in cents (`cap_cents`; 0 stops it drawing at all, null removes the cap). At its cap only that workspace pauses (`quota_exceeded`); caps may add up to more than the plan. The workspace's activity log names the key. The key's creator must still be an organization Owner. Takes an organization key (`ok_live_…`) with `organizations:billing`.

Reference: https://www.unitpost.com/docs/platform/patch-organizations-id-shared-plan-workspaces-workspace-id ([Markdown](https://www.unitpost.com/docs/platform/patch-organizations-id-shared-plan-workspaces-workspace-id.md))

### `PUT /api/v1/organizations/{id}/shared-plan/workspaces/{workspace_id}`

Add a workspace to the shared plan

Put one of the organization's workspaces on the shared plan, with an optional `cap_cents` (left out: no cap). It moves onto the organization's card (one more workspace on its billing) and draws on the shared allowance from now; its own usage this period so far stays its own. Already on it: `cap_cents`, when sent, sets its cap, and nothing else changes. Refused with the reason in `details[0].code`: `not_approved` (403: the shared plan isn't turned on), `no_plan` or `plan_inactive` (none bought, not active, or set to end), `own_plan` (it pays for a plan of its own: set that to end first), `grant` (a plan Unitpost's team gave it), `payer_change` (a change of who pays is scheduled), `suspended`, `closed`, `already_member` (on another shared plan) or `limit_reached` (the plan covers no more workspaces, or the organization's card is at its workspace limit), all `409` but the first. `Idempotency-Key` is optional: a retry with it answers what the first call did. The workspace's activity log names the key. The key's creator must still be an organization Owner. Takes an organization key (`ok_live_…`) with `organizations:billing`.

Reference: https://www.unitpost.com/docs/platform/put-organizations-id-shared-plan-workspaces-workspace-id ([Markdown](https://www.unitpost.com/docs/platform/put-organizations-id-shared-plan-workspaces-workspace-id.md))

### `DELETE /api/v1/organizations/{id}/shared-plan/workspaces/{workspace_id}`

Remove a workspace from the shared plan

Take a workspace off the shared plan. Its usage this period stays counted on the plan. It drops to Free if its Owner's one free workspace is unused, else it needs a plan before it sends again (`drops_to`: `free` or `needs_plan`); it stays on the organization's billing, so a plan bought for it is billed to the organization. A workspace not on the shared plan answers `left: false` and nothing changes. `Idempotency-Key` is optional: a retry with it answers what the first call did. The workspace's activity log names the key. The key's creator must still be an organization Owner. Takes an organization key (`ok_live_…`) with `organizations:billing`.

Reference: https://www.unitpost.com/docs/platform/delete-organizations-id-shared-plan-workspaces-workspace-id ([Markdown](https://www.unitpost.com/docs/platform/delete-organizations-id-shared-plan-workspaces-workspace-id.md))

### `GET /api/v1/organizations/{id}/webhooks`

List the organization's webhook endpoints

The organization's webhook endpoints, newest first and cursor-paginated (`limit`, `after`, `before`). Signing secrets are never returned here. A workspace's own endpoints (`/webhooks`) are not listed. Takes an organization key (`ok_live_…`) with `organizations:read`.

Reference: https://www.unitpost.com/docs/platform/get-organizations-id-webhooks ([Markdown](https://www.unitpost.com/docs/platform/get-organizations-id-webhooks.md))

### `POST /api/v1/organizations/{id}/webhooks`

Create an organization webhook endpoint

Register an `https` URL that receives the events of every workspace in the organization, closed ones included while they exist, for the event types it subscribes to (as on `POST /webhooks`). Workspaces' own endpoints keep receiving theirs: an event goes to each matching endpoint of either kind. Each delivery's envelope names the workspace the event happened in (`workspace_id`) and that workspace's `external_id` as it is when the delivery is made (null when it has none); a workspace endpoint's envelope has no `external_id`. The response includes the `signing_secret` exactly once. Names and URLs are unique in the organization. At most 5 endpoints per organization: the next create is a 422 and creates nothing. One endpoint already receives every workspace's events, so add event types to an existing endpoint (update its `events`) instead of adding endpoints. Takes an organization key (`ok_live_…`) with `organizations:write`.

Reference: https://www.unitpost.com/docs/platform/post-organizations-id-webhooks ([Markdown](https://www.unitpost.com/docs/platform/post-organizations-id-webhooks.md))

### `GET /api/v1/organizations/{id}/webhooks/{webhook_id}`

Get an organization webhook endpoint

One organization webhook endpoint, without its secret. `backlog` counts the deliveries a flush would send: queued while the endpoint was paused, and failed. Takes an organization key (`ok_live_…`) with `organizations:read`.

Reference: https://www.unitpost.com/docs/platform/get-organizations-id-webhooks-webhook-id ([Markdown](https://www.unitpost.com/docs/platform/get-organizations-id-webhooks-webhook-id.md))

### `PATCH /api/v1/organizations/{id}/webhooks/{webhook_id}`

Update an organization webhook endpoint

Change the endpoint's `url`, `events`, `name`, `status` or `include_text`, as `PATCH /webhooks/{id}` does. Re-enabling clears its failure streak; it never delivers the backlog on its own. The signing secret never changes here. Takes an organization key (`ok_live_…`) with `organizations:write`.

Reference: https://www.unitpost.com/docs/platform/patch-organizations-id-webhooks-webhook-id ([Markdown](https://www.unitpost.com/docs/platform/patch-organizations-id-webhooks-webhook-id.md))

### `DELETE /api/v1/organizations/{id}/webhooks/{webhook_id}`

Delete an organization webhook endpoint

Delete the endpoint and its delivery log. Deliveries stop at once. Deleting one already gone still answers `204`. To pause deliveries instead, set `status` to `disabled`. Takes an organization key (`ok_live_…`) with `organizations:write`.

Reference: https://www.unitpost.com/docs/platform/delete-organizations-id-webhooks-webhook-id ([Markdown](https://www.unitpost.com/docs/platform/delete-organizations-id-webhooks-webhook-id.md))

### `POST /api/v1/organizations/{id}/webhooks/{webhook_id}/rotate-secret`

Rotate an organization webhook's signing secret

A new signing secret, returned once. For 24 hours (until `previous_secret_expires_at`) every delivery is signed with the new and the old secret, so switch your receiver inside that window. Takes an organization key (`ok_live_…`) with `organizations:write`.

Reference: https://www.unitpost.com/docs/platform/post-organizations-id-webhooks-webhook-id-rotate-secret ([Markdown](https://www.unitpost.com/docs/platform/post-organizations-id-webhooks-webhook-id-rotate-secret.md))

### `POST /api/v1/organizations/{id}/webhooks/{webhook_id}/test`

Send a test event to an organization webhook

Send a sample event now, signed like a real delivery, and answer with your endpoint's response. It is not kept in the delivery log. A test happens in no workspace: its `workspace_id` and `external_id` are null. Takes an organization key (`ok_live_…`) with `organizations:write`.

Reference: https://www.unitpost.com/docs/platform/post-organizations-id-webhooks-webhook-id-test ([Markdown](https://www.unitpost.com/docs/platform/post-organizations-id-webhooks-webhook-id-test.md))

### `GET /api/v1/organizations/{id}/webhooks/{webhook_id}/deliveries`

List an organization webhook's deliveries

The endpoint's delivery log, newest first and cursor-paginated, as `GET /webhooks/{id}/deliveries`. Each row also names the event's workspace (`workspace_id`) and that workspace's `external_id` now. Narrow it with `status`, `event_type`, and one workspace by `workspace_id` or `external_id`. A filter value it can't apply (a typo, an unknown id) is ignored and named in the `Unitpost-Warning` header, and the answer is the one without it; send `Unitpost-Strict: true` to have it refused instead. A `workspace_id` or `external_id` it can't read (malformed, too long, sent twice) is not ignored: the page is empty, named in `Unitpost-Warning`, never every workspace's deliveries. Each row carries its event's `data` (message content of every workspace), so this takes `organizations:write`; a key with only `organizations:read` gets `403 insufficient_scope`. Takes an organization key (`ok_live_…`) with `organizations:write`.

Reference: https://www.unitpost.com/docs/platform/get-organizations-id-webhooks-webhook-id-deliveries ([Markdown](https://www.unitpost.com/docs/platform/get-organizations-id-webhooks-webhook-id-deliveries.md))

### `POST /api/v1/organizations/{id}/webhooks/{webhook_id}/deliveries/{delivery}/replay`

Replay an organization webhook delivery

Deliver one event to the endpoint again, with the same id, as `POST /webhooks/{id}/deliveries/{delivery}/replay`. The endpoint must be enabled. Takes no body. Takes an organization key (`ok_live_…`) with `organizations:write`.

Reference: https://www.unitpost.com/docs/platform/post-organizations-id-webhooks-webhook-id-deliveries-delivery-replay ([Markdown](https://www.unitpost.com/docs/platform/post-organizations-id-webhooks-webhook-id-deliveries-delivery-replay.md))

### `POST /api/v1/organizations/{id}/webhooks/{webhook_id}/flush`

Deliver an organization webhook's backlog

Deliver the deliveries held while the endpoint was suspended (`queued`); with `include_failed` also the ones that failed for good. The endpoint must be enabled: re-enabling never delivers the backlog on its own. Takes an organization key (`ok_live_…`) with `organizations:write`.

Reference: https://www.unitpost.com/docs/platform/post-organizations-id-webhooks-webhook-id-flush ([Markdown](https://www.unitpost.com/docs/platform/post-organizations-id-webhooks-webhook-id-flush.md))
