Data App CRUD
Update a data app
Rename a data app, or choose which organizations its customers may import dashboards from.
PUT
curl --request PUT https://api.usedatabrain.com/api/v2/data-app \ --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "name": "Customer portal", "updateName": "Customer portal EU" }'Auth
A service token. See Authentication.
ServiceTokenheader
AuthorizationBearer <token>A service token. A data app API token is refused.
Body
Send name and at least one of updateName or allowedImportSources.
The data app's current name.
updateNamestring
The new name. Databrain does not check that it is unique, so pick one no other data app has.
allowedImportSourcesstring[]
Organization ids whose dashboard exports this data app's customers may import. Up to 50, each 1 to 200 characters. Replaces the list. [] empties it.
Max items:
50Embeds and API tokens stay with the data app when you rename it. Use the new name in later calls.
Response
{ "name": "Customer portal EU" }When you send allowedImportSources, the response has it too.
Errors
| Status | error.code | Why |
|---|---|---|
| 400 | INVALID_REQUEST_BODY | A field is missing or wrong |
| 400 | DATA_APP_NOT_FOUND | No data app has this name |
| 403 | AUTHENTICATION_ERROR | You used a data app API token |
| 500 | INTERNAL_SERVER_ERROR | The update failed |
For errors that every endpoint returns, see Authentication.
curl -X PUT 'https://api.usedatabrain.com/api/v2/data-app' \ -H 'Content-Type: application/json' \ -d '{ "name": "Customer portal", "updateName": "Customer portal EU"}'Example Response
{ "name": "Customer portal EU", "allowedImportSources": [ "org-id-1" ]}