Attach a Polar subscription to a workspace
Links an existing Polar subscription to a workspace, deriving the plan from the subscription's product and recording the supplied `reason`. Platform admins only; a `subscriptionId` that is not present upstream is reported as not found.
Authorization
apiKey Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/admin/billing/link" \ -H "Content-Type: application/json" \ -d '{ "workspaceId": "string", "subscriptionId": "string" }'{ "data": { "linked": true }}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}List Polar subscriptions not linked to a workspace
Returns the Polar subscriptions that exist upstream but are not yet attached to a Snoze workspace, joined with the plan each product maps to. Used for the migration flow. Platform admins only.
List workspaces with their operational state
Returns every workspace with its plan, limit overrides, and current AI usage, as shown on the admin operations screen. Platform admins only.