Skip to main content

Authentication

Both live partner APIs use OAuth 2.0 client credentials (server-to-server). The token is bound to the Partner; you never send partnerId in bodies. End users do not log in to Docpier.

POST/realms/idp/protocol/openid-connect/token
Tip

Cache tokens and refresh before expires_in (typically 300 seconds). Request only the scopes you need. Never commit client_secret.

Token request​

Content-Typestringheaderrequired

application/x-www-form-urlencoded

grant_typestringbodyrequired

Always client_credentials.

client_idstringbodyrequired

Issued by Docpier. Email support@docpier.com.

client_secretstringbodyrequired

Partner secret for this client.

scopestringbodyrequired

Space-separated scopes.

Scopes​

ScopeProductPurpose
docmind.captureDocmindExtract documents: read and write workspace documents
docmind.onboardingDocmindOrganisations, workspaces, and settings on the Docmind side (until Management API)
idp.captureDocmindDeprecated name for docmind.capture, still accepted. Request docmind.capture for new clients.
docbooks.onboardingDocbooksCreate and offboard organisations and workspaces (until Management API)
docbooks.bookingsDocbooksBooking runtime and booking feedback

Submitting and reading a booking need docmind.capture on the same token as docbooks.bookings — Docbooks forwards the token to Docmind. See Combine analysis and booking.

Onboarding needs docmind.onboarding on the same token as docbooks.onboarding. Keycloak does not grant either Docmind scope automatically — request it explicitly alongside the Docbooks scope.

A bookings-only token cannot onboard.

Calling the API​

Authorizationstringheaderrequired

Bearer <access_token>

401 and 403 responses have no body. Retry 401 after refreshing the token.

API hosts​

ProductStageProduction
Docmindhttps://idp-stage.docpier.com/api/v1https://idp.docpier.com/api/v1
Docbookshttps://stage.docpier.io/api/docbooks/v1not yet available

Identity provider (Keycloak)​

Tokens are minted by Keycloak, not by the product APIs. One realm, idp, serves both products — the same token URL, whichever API you call.

EnvironmentToken URL
Stagehttps://auth-stage.docpier.com/realms/idp/protocol/openid-connect/token
Productionhttps://auth.docpier.com/realms/idp/protocol/openid-connect/token
Note

Paste a stage token into Try It. Keep Stage selected. Try It servers are the origin (https://idp-stage.docpier.com/api, https://stage.docpier.io) because /v1 is already on the operation path.