Provision Workspace (Partners)
Create a fully configured workspace for a client and receive an API token scoped to it
201 response that creates the workspace, and Penbox stores nothing but its hash — it can never be retrieved again. Persist it before you do anything else with the response.Idempotency
The call is idempotent onintegration.legalops.source_workspace_id: one Penbox workspace per workspace on your side. Calling it again with the same source_workspace_id returns the workspace that already exists, with a 200 instead of a 201 and without a token.
Use the status code to tell the two apart:
Partial success
Provisioning never fails halfway: if an optional step does not complete, the workspace is still created and the response carries awarnings array describing what was skipped — a case template that could not be copied, for instance. Log the warnings — they are not errors.Authorizations
API token (starts with pnbx_). Create at https://app.penbox.io/workspace/settings/api. Include as: Authorization: Bearer {token}
Body
Workspace name. The slug is derived from it, with a numeric suffix when that slug is already taken.
3 - 64"Acme Legal"
The client's administrator. Created as a silent member: Penbox never emails them.
Identifies the client workspace on your side. This is what makes the call idempotent.
Case templates to copy into the new workspace.
Response
A workspace already exists for this source_workspace_id. Same payload, without token.
False when this call created the workspace, true when it returned one that already existed.
The Penbox workspace
The link back to the workspace on your side
API token scoped to the new workspace. Returned exactly ONCE, in the 201 that created it: Penbox stores only its hash and can never show it again. Absent from a replay.
"pnbx_0f1e2d3c4b5a69788796a5b4c3d2e1f00112233445566778"
Optional steps that did not complete. The workspace is fully created either way — these are not errors. Absent when there is nothing to report.