Skip to main content
curl --request POST \
  --url https://api.usedatabrain.com/api/v2/data-app \
  --header 'Authorization: Bearer service_token_xyz...' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Customer Portal Analytics"
  }'
{
  "name": "Customer Portal Analytics"
}
POST
https://api.usedatabrain.com
/
api
/
v2
/
data-app
curl --request POST \
  --url https://api.usedatabrain.com/api/v2/data-app \
  --header 'Authorization: Bearer service_token_xyz...' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Customer Portal Analytics"
  }'
{
  "name": "Customer Portal Analytics"
}
Create a new Data App in your organization. Data Apps serve as containers for organizing embed configurations, API tokens, and access controls for your embedded analytics.
Data Apps are the top-level organizational unit for embedded analytics. Each Data App can contain multiple embed configurations and has its own set of API tokens for authentication.
Authentication Requirement: This endpoint requires a service token (not a data app API key). Service tokens have elevated permissions to manage Data Apps across your organization.

Endpoint Formats

Authentication

This endpoint requires a service token in the Authorization header. Service tokens differ from data app API keys and provide organization-level permissions. To access your service token:
  1. Go to your Databrain dashboard and open Settings.
  2. Navigate to Settings.
  3. Find the Service Tokens section.
  4. Click the “Generate Token” button to generate a new service token if you don’t have one already.
Use this token as the Bearer value in your Authorization header.

Headers

Authorization
string
required
Bearer token for API authentication. Use your service token (not data app API key).
Authorization: Bearer service_token_xyz...
Content-Type
string
required
Must be set to application/json for all requests.
Content-Type: application/json

Request Body

name
string
required
The unique name for the Data App. This name must be unique within your organization.

Response

name
string
The name of the newly created Data App.
error
object
Error object returned only when the request fails. Not included in successful responses.

Examples

HTTP Status Code Summary

Status CodeDescription
200OK - Data App created successfully
400Bad Request - Invalid request parameters
500Internal Server Error - Server error occurred

Possible Errors

Error CodeHTTP StatusDescription
INVALID_REQUEST_BODY400Missing or invalid name parameter
DATA_APP_ALREADY_EXISTS400Data App with same name already exists
AUTHENTICATION_ERROR400Invalid or missing service token
INTERNAL_SERVER_ERROR500Server error

Quick Start Guide

1

Get your service token

Go to your Databrain dashboard, navigate to Settings > Service Tokens, and generate a new service token if you don’t have one.
2

Create the Data App

Make a POST request with a unique name for your Data App:
curl --request POST \
  --url https://api.usedatabrain.com/api/v2/data-app \
  --header 'Authorization: Bearer service_token_xyz...' \
  --header 'Content-Type: application/json' \
  --data '{"name": "My Analytics App"}'
3

Create an API token for the Data App

After creating the Data App, create an API token to use for embed operations. See the Create API Token endpoint.
4

Create embed configurations

Use the API token to create embed configurations for your dashboards and metrics.

Next Steps