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.onboardingDocmind / ManagementOrganisations, workspaces, and settings on the capture side. Moving to the Management API.
idp.captureDocmindDeprecated name for capture. Keycloak still issues this string today. Treat it as docmind.capture.
docbooks.onboardingDocbooksCreate and offboard organisations and workspaces (until Management API)
docbooks.bookingsDocbooksBooking runtime and booking feedback

Booking submit also needs capture on the same token (forwarded to the extractor). See Enable capture and booking.

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

EnvironmentProductBase URL
StageDocmindhttps://idp-stage.docpier.com/api/v1
ProductionDocmindhttps://idp.docpier.com/api/v1
StageDocbookshttps://stage.docpier.io/api/docbooks/v1
ProductionDocbookshttps://docpier.io/api/docbooks/v1

Identity provider (Keycloak)

Tokens are minted by Keycloak, not by the product APIs.

EnvironmentToken URL
Docmind stagehttps://auth-stage.docpier.com/realms/idp/protocol/openid-connect/token
Docmind productionhttps://auth.docpier.com/realms/idp/protocol/openid-connect/token
Docbooks stagehttps://stage.docpier.io/auth/realms/idp/protocol/openid-connect/token
Docbooks productionhttps://docpier.io/auth/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.