Self-Hosted APIs
Create Service Token (Self-Hosted)
Create or save a service token for your self-hosted Databrain instance. Available only on self-hosted deployments.
POST
Create or register a service token for your self-hosted instance. If no service token exists, a new one is created; if one already exists, it is updated with the provided token value. Service tokens are used for organization-level operations such as managing Data Apps and API tokens.
On error, the API returns a JSON object with
Authentication
Use a valid admin session token in theAuthorization header. Obtain one by calling Create Admin JWT first.
Headers
string
required
Bearer token for an authenticated admin user.
string
required
Must be
application/json when sending a JSON body.Request Body
string
required
The service token value. Must be a valid UUID (e.g. RFC 4122). The backend stores this as the service token ID for your company. Generate a UUID (e.g. via
uuidv4) and send it here.Response
On success, the API returns 200 with a JSON object:string
The service token (UUID). Use this value as the Bearer token for service-level API calls (e.g. creating Data App API tokens, export/import dashboard).
error.code and error.message and an appropriate HTTP status (400 or 500).
Examples
HTTP Status Code Summary
Possible Errors
Related
- Rotate Service Token – Rotate the service token with an expiration window
- Create Admin Account – Create the first admin account (self-hosted)
- Create Admin JWT – Get an access token for admin APIs

