Embeds
Set the allowed domains
Choose which websites may show your Databrain embeds.
PUT
The list is for your whole organization: every data app uses it. PUT replaces the whole list.
curl --request PUT https://api.usedatabrain.com/api/v2/data-app/whitelist-domains \ --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "domains": ["app.example.com", "*.example.com", "localhost:3000"] }'To read the list:
curl https://api.usedatabrain.com/api/v2/data-app/whitelist-domains \ --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN"Auth
A service token. See Authentication.
ApiTokenheader
AuthorizationBearer <token>A service token or a data app API token.
Body (PUT)
The allowed domains. [] empties the list.
Each item is one of:
- A domain, with no
http://orhttps://and no port, for exampleapp.example.com. Start with*.for all subdomains:*.example.com. - An IPv4 address, with or without a port:
203.0.113.10:8080. localhost, with or without a port:localhost:3000.
Items are saved as you send them.
Response
GET:
{ "data": ["app.example.com", "*.example.com", "localhost:3000"] }PUT:
{ "data": { "domains": ["app.example.com", "*.example.com", "localhost:3000"] } }Errors
| Status | error.code | Why |
|---|---|---|
| 400 | INVALID_REQUEST_BODY | domains is missing, or an item is not valid: Invalid domain format. Please enter domain/IP without http:// or https:// |
| 500 | INTERNAL_SERVER_ERROR | The list could not be saved |
For errors that every endpoint returns, see Authentication.
curl -X PUT 'https://api.usedatabrain.com/api/v2/data-app/whitelist-domains' \ -H 'Content-Type: application/json' \ -d '{ "domains": [ "app.example.com", "*.example.com", "localhost:3000" ]}'Example Response
{ "data": [ "app.example.com", "*.example.com", "localhost:3000" ]}