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"
}'
const response = await fetch('https://api.usedatabrain.com/api/v2/data-app', {
method: 'POST',
headers: {
'Authorization': 'Bearer service_token_xyz...',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Customer Portal Analytics'
})
});
const data = await response.json();
console.log('Created Data App:', data.name);
import requests
url = "https://api.usedatabrain.com/api/v2/data-app"
headers = {
"Authorization": "Bearer service_token_xyz...",
"Content-Type": "application/json"
}
payload = {
"name": "Customer Portal Analytics"
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(f"Created Data App: {data['name']}")
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class CreateDataApp {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String requestBody = """
{
"name": "Customer Portal Analytics"
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.usedatabrain.com/api/v2/data-app"))
.header("Authorization", "Bearer service_token_xyz...")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(requestBody))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println("Response: " + response.body());
}
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
type CreateDataAppRequest struct {
Name string `json:"name"`
}
type CreateDataAppResponse struct {
Name string `json:"name"`
Error interface{} `json:"error"`
}
func main() {
requestBody := CreateDataAppRequest{
Name: "Customer Portal Analytics",
}
jsonData, _ := json.Marshal(requestBody)
req, _ := http.NewRequest("POST", "https://api.usedatabrain.com/api/v2/data-app", bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer service_token_xyz...")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result CreateDataAppResponse
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("Created Data App: %s\n", result.Name)
}
<?php
$curl = curl_init();
$data = [
'name' => 'Customer Portal Analytics'
];
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.usedatabrain.com/api/v2/data-app',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer service_token_xyz...',
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
curl_close($curl);
$result = json_decode($response, true);
echo 'Created Data App: ' . $result['name'];
?>
require 'net/http'
require 'json'
uri = URI('https://api.usedatabrain.com/api/v2/data-app')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer service_token_xyz...'
request['Content-Type'] = 'application/json'
request.body = {
name: 'Customer Portal Analytics'
}.to_json
response = http.request(request)
result = JSON.parse(response.body)
puts "Created Data App: #{result['name']}"
{
"name": "Customer Portal Analytics"
}
{
"error": {
"code": "INVALID_REQUEST_BODY",
"message": "\"name\" is required"
}
}
{
"error": {
"code": "DATA_APP_ALREADY_EXISTS",
"message": "Data app with the same name already exists"
}
}
{
"error": {
"code": "AUTHENTICATION_ERROR",
"message": "Invalid Service Token"
}
}
{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "INTERNAL_SERVER_ERROR"
}
}
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"
}'
const response = await fetch('https://api.usedatabrain.com/api/v2/data-app', {
method: 'POST',
headers: {
'Authorization': 'Bearer service_token_xyz...',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Customer Portal Analytics'
})
});
const data = await response.json();
console.log('Created Data App:', data.name);
import requests
url = "https://api.usedatabrain.com/api/v2/data-app"
headers = {
"Authorization": "Bearer service_token_xyz...",
"Content-Type": "application/json"
}
payload = {
"name": "Customer Portal Analytics"
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(f"Created Data App: {data['name']}")
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class CreateDataApp {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String requestBody = """
{
"name": "Customer Portal Analytics"
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.usedatabrain.com/api/v2/data-app"))
.header("Authorization", "Bearer service_token_xyz...")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(requestBody))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println("Response: " + response.body());
}
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
type CreateDataAppRequest struct {
Name string `json:"name"`
}
type CreateDataAppResponse struct {
Name string `json:"name"`
Error interface{} `json:"error"`
}
func main() {
requestBody := CreateDataAppRequest{
Name: "Customer Portal Analytics",
}
jsonData, _ := json.Marshal(requestBody)
req, _ := http.NewRequest("POST", "https://api.usedatabrain.com/api/v2/data-app", bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer service_token_xyz...")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result CreateDataAppResponse
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("Created Data App: %s\n", result.Name)
}
<?php
$curl = curl_init();
$data = [
'name' => 'Customer Portal Analytics'
];
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.usedatabrain.com/api/v2/data-app',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer service_token_xyz...',
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
curl_close($curl);
$result = json_decode($response, true);
echo 'Created Data App: ' . $result['name'];
?>
require 'net/http'
require 'json'
uri = URI('https://api.usedatabrain.com/api/v2/data-app')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer service_token_xyz...'
request['Content-Type'] = 'application/json'
request.body = {
name: 'Customer Portal Analytics'
}.to_json
response = http.request(request)
result = JSON.parse(response.body)
puts "Created Data App: #{result['name']}"
{
"name": "Customer Portal Analytics"
}
{
"error": {
"code": "INVALID_REQUEST_BODY",
"message": "\"name\" is required"
}
}
{
"error": {
"code": "DATA_APP_ALREADY_EXISTS",
"message": "Data app with the same name already exists"
}
}
{
"error": {
"code": "AUTHENTICATION_ERROR",
"message": "Invalid Service Token"
}
}
{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "INTERNAL_SERVER_ERROR"
}
}
Data App CRUD
Create Data App
Create a new Data App to organize and manage your embedded analytics.
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"
}'
const response = await fetch('https://api.usedatabrain.com/api/v2/data-app', {
method: 'POST',
headers: {
'Authorization': 'Bearer service_token_xyz...',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Customer Portal Analytics'
})
});
const data = await response.json();
console.log('Created Data App:', data.name);
import requests
url = "https://api.usedatabrain.com/api/v2/data-app"
headers = {
"Authorization": "Bearer service_token_xyz...",
"Content-Type": "application/json"
}
payload = {
"name": "Customer Portal Analytics"
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(f"Created Data App: {data['name']}")
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class CreateDataApp {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String requestBody = """
{
"name": "Customer Portal Analytics"
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.usedatabrain.com/api/v2/data-app"))
.header("Authorization", "Bearer service_token_xyz...")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(requestBody))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println("Response: " + response.body());
}
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
type CreateDataAppRequest struct {
Name string `json:"name"`
}
type CreateDataAppResponse struct {
Name string `json:"name"`
Error interface{} `json:"error"`
}
func main() {
requestBody := CreateDataAppRequest{
Name: "Customer Portal Analytics",
}
jsonData, _ := json.Marshal(requestBody)
req, _ := http.NewRequest("POST", "https://api.usedatabrain.com/api/v2/data-app", bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer service_token_xyz...")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result CreateDataAppResponse
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("Created Data App: %s\n", result.Name)
}
<?php
$curl = curl_init();
$data = [
'name' => 'Customer Portal Analytics'
];
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.usedatabrain.com/api/v2/data-app',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer service_token_xyz...',
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
curl_close($curl);
$result = json_decode($response, true);
echo 'Created Data App: ' . $result['name'];
?>
require 'net/http'
require 'json'
uri = URI('https://api.usedatabrain.com/api/v2/data-app')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer service_token_xyz...'
request['Content-Type'] = 'application/json'
request.body = {
name: 'Customer Portal Analytics'
}.to_json
response = http.request(request)
result = JSON.parse(response.body)
puts "Created Data App: #{result['name']}"
{
"name": "Customer Portal Analytics"
}
{
"error": {
"code": "INVALID_REQUEST_BODY",
"message": "\"name\" is required"
}
}
{
"error": {
"code": "DATA_APP_ALREADY_EXISTS",
"message": "Data app with the same name already exists"
}
}
{
"error": {
"code": "AUTHENTICATION_ERROR",
"message": "Invalid Service Token"
}
}
{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "INTERNAL_SERVER_ERROR"
}
}
POST
/
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"
}'
const response = await fetch('https://api.usedatabrain.com/api/v2/data-app', {
method: 'POST',
headers: {
'Authorization': 'Bearer service_token_xyz...',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Customer Portal Analytics'
})
});
const data = await response.json();
console.log('Created Data App:', data.name);
import requests
url = "https://api.usedatabrain.com/api/v2/data-app"
headers = {
"Authorization": "Bearer service_token_xyz...",
"Content-Type": "application/json"
}
payload = {
"name": "Customer Portal Analytics"
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(f"Created Data App: {data['name']}")
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class CreateDataApp {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String requestBody = """
{
"name": "Customer Portal Analytics"
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.usedatabrain.com/api/v2/data-app"))
.header("Authorization", "Bearer service_token_xyz...")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(requestBody))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println("Response: " + response.body());
}
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
type CreateDataAppRequest struct {
Name string `json:"name"`
}
type CreateDataAppResponse struct {
Name string `json:"name"`
Error interface{} `json:"error"`
}
func main() {
requestBody := CreateDataAppRequest{
Name: "Customer Portal Analytics",
}
jsonData, _ := json.Marshal(requestBody)
req, _ := http.NewRequest("POST", "https://api.usedatabrain.com/api/v2/data-app", bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer service_token_xyz...")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result CreateDataAppResponse
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("Created Data App: %s\n", result.Name)
}
<?php
$curl = curl_init();
$data = [
'name' => 'Customer Portal Analytics'
];
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.usedatabrain.com/api/v2/data-app',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer service_token_xyz...',
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
curl_close($curl);
$result = json_decode($response, true);
echo 'Created Data App: ' . $result['name'];
?>
require 'net/http'
require 'json'
uri = URI('https://api.usedatabrain.com/api/v2/data-app')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer service_token_xyz...'
request['Content-Type'] = 'application/json'
request.body = {
name: 'Customer Portal Analytics'
}.to_json
response = http.request(request)
result = JSON.parse(response.body)
puts "Created Data App: #{result['name']}"
{
"name": "Customer Portal Analytics"
}
{
"error": {
"code": "INVALID_REQUEST_BODY",
"message": "\"name\" is required"
}
}
{
"error": {
"code": "DATA_APP_ALREADY_EXISTS",
"message": "Data app with the same name already exists"
}
}
{
"error": {
"code": "AUTHENTICATION_ERROR",
"message": "Invalid Service Token"
}
}
{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "INTERNAL_SERVER_ERROR"
}
}
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.
Use this endpoint for all new integrations. This is the recommended endpoint format.This endpoint still works but will be deprecated. Please migrate to the new endpoint format.
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
- New Endpoint (Recommended)
- Legacy Endpoint (Deprecated Soon)
POST https://api.usedatabrain.com/api/v2/data-app
POST https://api.usedatabrain.com/api/v2/dataApp
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:- In Settings page, navigate to the Service Tokens section.
- Click the “Generate Token” button to create a new service token if you don’t have one already.
Headers
Bearer token for API authentication. Use your service token (not data app API key).
Authorization: Bearer service_token_xyz...
Must be set to
application/json for all requests.Content-Type: application/json
Request Body
The unique name for the Data App. This name must be unique within your organization.
Show Naming guidelines
Show Naming guidelines
- Names must be unique within your organization
- Use descriptive names that indicate the purpose (e.g., “Customer Portal Analytics”, “Partner Dashboard”)
- Avoid special characters that might cause URL encoding issues
Response
The name of the newly created Data App.
Examples
HTTP Status Code Summary
| Status Code | Description |
|---|---|
200 | OK - Data App created successfully |
400 | Bad Request - Invalid request parameters |
500 | Internal Server Error - Server error occurred |
Possible Errors
| Error Code | HTTP Status | Description |
|---|---|---|
INVALID_REQUEST_BODY | 400 | Missing or invalid name parameter |
DATA_APP_ALREADY_EXISTS | 400 | Data App with same name already exists |
AUTHENTICATION_ERROR | 400 | Invalid or missing service token |
INTERNAL_SERVER_ERROR | 500 | Server error |
Quick Start Guide
Get your service token
In Settings page, navigate to the Service Tokens section. Click the “Generate Token” button to create a new service token if you don’t have one already.
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"}'
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.
Next Steps
List Data Apps
View all Data Apps in your organization
Create API Token
Generate API tokens for your Data App
Create Embed
Create embed configurations for dashboards
Delete Data App
Remove Data Apps you no longer need
⌘I

