SnozeDevelopers
API referenceBilling

Change the workspace subscription plan

Applies a previewed plan change and returns the updated subscription. Send the preview's `timing` (`now` charges the prorated difference immediately, `period_end` schedules the change for the renewal), `dueNowCents` and `recurringAmountCents` as the customer confirmed them; the server re-quotes and rejects with a conflict when the timing or recurring amount differs or the charge due now is higher. Requires a Clerk session with a synced profile and the `billing:manage` workspace permission. Send an `Idempotency-Key` header to make retries safe.

POST
/v1/workspaces/{workspaceId}/billing/change-plan

Authorization

apiKey
headerAuthorizationBearer <snoze_sk_…>

Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.

Path Parameters

workspaceId*string

Request Body

application/json
  1. body
plan*string
Value in"free""team""business""enterprise"
interval*string
Value in"month""year"
timing*string
Value in"now""period_end"
dueNowCents*number
recurringAmountCents*number

Response Body

Success

application/json
  1. response
data*
Example Request
curl -X POST 'https://api.snoze.dev/v1/workspaces/string/billing/change-plan' \  -H 'Content-Type: application/json' \  -d '{  "plan": "free",  "interval": "month",  "timing": "now",  "dueNowCents": 0,  "recurringAmountCents": 0}'
Example Response
{  "data": {    "workspaceId": "string",    "plan": "free",    "status": "none",    "polarCustomerId": "string",    "polarSubscriptionId": "string",    "polarProductId": "string",    "cancelAtPeriodEnd": true,    "currentPeriodStart": "string",    "recurringInterval": "month",    "currentPeriodEnd": "string",    "scheduledChange": {      "plan": "free",      "interval": "month",      "effectiveAt": "string"    }  }}