internal
workspaces

Provision Workspace

Provision a new workspace end-to-end with a Neon sandbox + counties.

Replaces the legacy bare-create POST /. A workspace granted no counties has zero geographic query access, so provisioning is the only sanctioned create path. Fires the stand_up_workspace Dagster job and returns once the rows are persisted (5-15s for Neon create).

A local workspace — every workspace today — seeds its county rows claimed for the loader, and its county data loads asynchronously thereafter. A commons workspace is thin: its rows record the grant, no county load is queued, and the counties are available as soon as the call returns. Thin provisioning is refused unless the request also marks the workspace MAIA-staff, which is what keeps the path dark.

post/api/v1/internal/workspaces/provision

Request body

namestring required
initial_creditsinteger
region_idstring nullable
icp_category_idstring uuid nullable

Optional ICP category to assign at creation. Omit or pass null to leave the workspace unassigned.

county_data_residency'local' | 'commons'

Where a workspace's county data physically lives.

Orthogonal to WorkspaceType, which is a billing cohort: a discovery workspace and a thin workspace are independent facts, and folding one into the other would conflate plan with topology.

LOCAL is every deployed workspace: the counties it may query were copied into its own branch, so a statement over them is workspace-only. COMMONS is a thin workspace, whose branch holds none of them — it is entitled to counties the shared corpus holds, and that entitlement is what binds its model-authored statements to the commons router.

is_internalboolean

Mark the new workspace as a MAIA-staff workspace. Required alongside a 'commons' residency while the shared corpus is dark.

Response

Successful Response

idstring uuid required
namestring required
budget_authority'credits' | 'paid_balance' required

Which budget a metered run draws down.

Two members, because there are two budgets. Free usage and paid usage are the same balance on the same account, spent at the same prices and refused by the same check; what a workspace paid for that balance decides what its refusal offers next, not how the run is admitted. A third member for the free tier is what let the two drift — different prices, different exemptions, different per-run sizing — while both claimed to meter usage.

avatar_colorstring nullable required
available_enrichment_creditsinteger required
used_enrichment_creditsinteger required
remaining_creditsinteger required
is_suspendedboolean required
is_internalboolean required
icp_category_idstring uuid nullable required
member_countinteger required
project_countinteger required
created_atstring date-time nullable required
updated_atstring date-time nullable required

Changes