Skip to main content

Authentication

Send an API key as a Bearer token in the Authorization header of every request:

Authorization: Bearer <API key>

Create the key in API Key Management. A key created there acts as the user who creates it, and is limited by that user's Portal permissions. Scopes explains how scopes apply to keys.

This page covers the REST operations. The MCP endpoint /api/v1/mcp signs in differently and is not covered here.

Who a request acts as​

A request acts as one user. An operation returns only what that user can see, and refuses what the user may not do. Each operation page lists the Portal permissions the operation needs under Portal permissions.

  • A key created in API Key Management acts as the user who created it.
  • A key created earlier for a user acts as that user.
  • A full-control key, created earlier, acts as the user who created it, with that user's own Portal permissions.

A key created earlier holds scope names, and reaches only the operations they allow: see Scopes.

When a key is refused​

StatusCodeWhen
401unauthenticatedThe request has no bearer token the API accepts.
401token_expiredThe token has expired or was revoked.
403token_owner_inactiveThe key's user is deactivated.
403forbiddenThe key's user, or the user who created the key, is a Docwize employee whose access the company has not approved.
421wrong_regionThe key's company is served by another region. base_url gives that region's base URL.
503tenant_unavailableThe company database is unavailable. Retry later.

A 401 carries WWW-Authenticate: Bearer error="invalid_token". A 403 token_owner_inactive has no WWW-Authenticate header.

A key that is accepted can still be refused by an operation: with insufficient_scope when its scope names do not reach the operation, and with forbidden when its user does not have a Portal permission the operation needs.