Data App CRUD
Create a data app
Make a data app to hold the embeds of one of your products.
POST
curl --request POST https://api.usedatabrain.com/api/v2/data-app \ --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "name": "Customer portal" }'Before you start
- You have a service token. See Authentication.
- Your plan includes embedding. Check with Check embed access.
ServiceTokenheader
AuthorizationBearer <token>A service token. A data app API token is refused.
Body
The data app name. No other data app in your organization may have it.
Unknown fields are refused.
Response
{ "name": "Customer portal" }The data app is an embedded data app. It has no API token and no embeds yet.
Errors
| Status | error.code | Why |
|---|---|---|
| 400 | INVALID_REQUEST_BODY | name is missing or empty, or a field is unknown |
| 400 | DATA_APP_ALREADY_EXISTS | A data app has this name |
| 403 | AUTHENTICATION_ERROR | You used a data app API token |
| 403 | entitlement_required | Your plan does not include embedding |
| 500 | INTERNAL_SERVER_ERROR | The data app could not be saved |
For errors that every endpoint returns, see Authentication.
Next, create an API token for it.
curl -X POST 'https://api.usedatabrain.com/api/v2/data-app' \ -H 'Content-Type: application/json' \ -d '{ "name": "Customer portal"}'Example Response
{ "name": "Customer portal"}