Onboard
This page is a work in progress — onboarding and offboarding are expected to change before the Management API ships.
Until the Management API ships, Docbooks is how you create the Organisation and Workspace that booking needs. This is setup, not the daily job — the daily job is Propose a booking.
Create Organisations, then POST Workspaces under one. Workspaces are not nested in the organisation body. Scope: docbooks.onboarding and docmind.onboarding — setup only; the runtime scope for booking is docbooks.bookings and docmind.capture.
Both endpoints are batch endpoints: the body is actor plus an array, 1–100 items. There is no single-item form.
/api/docbooks/v1/onboarding/organisationsactorobjectbodyrequiredextRef required; email and name optional.
organisationsOrganisationOnboardingItem[]bodyrequired1–100 organisations.
Each item requires name (1–140), uid (^CHE\d{9}$), and extRef (your stable id, unique per Partner). Optional: address, legalForm, vatRegistrationNumber, and — worth setting now — chartOfAccounts and settings.
Booking needs an effective chart of accounts — without one it answers 400 MISSING_CHART_OF_ACCOUNTS. You can supply chartOfAccounts here and it is
persisted, but in this phase Docpier seeds it for you: agree the client's chart with
us as part of onboarding. Chart of accounts and
settings.
Then, per organisation:
/api/docbooks/v1/onboarding/organisations/{organisation_id}/workspacesBody is actor plus workspaces (1–100). A workspace item requires only name and extRef; uid is optional here, and chartOfAccounts / settings override the organisation's. Docbooks provisions each workspace in Docmind with your token, which is why the token needs docmind.onboarding.
Reading the outcome
Wait for ONBOARDING_FINALISED, then:
/api/docbooks/v1/onboarding/{onboarding_id}Job status is IN_PROGRESS, COMPLETED, COMPLETED_WITH_ERRORS, or FAILED. Per-item outcomes are in results[], keyed by your extRef, each CREATED, ALREADY_EXISTS, or FAILED (with an error). COMPLETED_WITH_ERRORS is the one to handle — read every item rather than trusting the job status alone.
Re-sending an existing extRef or uid is a no-op, recorded as ALREADY_EXISTS, so a retried batch is safe. Synchronous rejections are 400: BATCH_TOO_LARGE over 100 items, DUPLICATE_IN_BATCH when extRef or uid repeats inside one batch.
Offboard
Same scope. Organisation offboarding cascades to its workspaces; workspace offboarding does not.
/api/docbooks/v1/offboarding/organisationsBody: actor, organisationIds (1–100 ULIDs), optional reason (≤500).
/api/docbooks/v1/offboarding/workspacesBody: actor, workspaceIds (1–100 Docbooks ULIDs), optional reason.
Then GET the offboarding job after OFFBOARDING_FINALISED. Per-item status is OFFBOARDED, ALREADY_OFFBOARDED, or FAILED.