Skip to main content
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.
Self-Hosted Only: This endpoint is available only on self-hosted Databrain instances. It returns an error on cloud (SaaS) deployments.
Authentication Requirement: This endpoint requires an authenticated admin user (Bearer token from Create Admin JWT) and a subscribed account.

Authentication

Use a valid admin session token in the Authorization 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).
On error, the API returns a JSON object with error.code and error.message and an appropriate HTTP status (400 or 500).

Examples

HTTP Status Code Summary

Possible Errors