curl --request PUT \
--url https://api.usedatabrain.com/api/v2/data-app/embeds \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"embedId": "embed_abc123def456",
"accessSettings": {
"isAllowMetricCreation": false,
"isAllowUnderlyingData": true,
"joinModel": "multi",
"tableTenancySettings": [
{
"name": "updated_sales_data",
"clientColumn": "customer_id"
}
]
}
}'
{
"id": "embed_abc123def456",
"error": null
}
curl --request PUT \
--url https://api.usedatabrain.com/api/v2/data-app/embeds \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"embedId": "embed_abc123def456",
"accessSettings": {
"isAllowMetricCreation": false,
"isAllowUnderlyingData": true,
"joinModel": "multi",
"tableTenancySettings": [
{
"name": "updated_sales_data",
"clientColumn": "customer_id"
}
]
}
}'
{
"id": "embed_abc123def456",
"error": null
}
Update an existing embed to modify access settings, permissions, and datamart associations.
curl --request PUT \
--url https://api.usedatabrain.com/api/v2/data-app/embeds \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"embedId": "embed_abc123def456",
"accessSettings": {
"isAllowMetricCreation": false,
"isAllowUnderlyingData": true,
"joinModel": "multi",
"tableTenancySettings": [
{
"name": "updated_sales_data",
"clientColumn": "customer_id"
}
]
}
}'
{
"id": "embed_abc123def456",
"error": null
}
curl --request PUT \
--url https://api.usedatabrain.com/api/v2/data-app/embeds \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"embedId": "embed_abc123def456",
"accessSettings": {
"isAllowMetricCreation": false,
"isAllowUnderlyingData": true,
"joinModel": "multi",
"tableTenancySettings": [
{
"name": "updated_sales_data",
"clientColumn": "customer_id"
}
]
}
}'
{
"id": "embed_abc123def456",
"error": null
}
/api/v2/data-app/embeds. The old endpoint /api/v2/dataApp/embeds will be deprecated soon. Please update your integrations to use the new endpoint format.PUT https://api.usedatabrain.com/api/v2/data-app/embeds
POST https://api.usedatabrain.com/api/v2/dataApp/embed/update
Content-Type: application/json
{
"embedId": "embed_abc123def456",
"accessSettings": { ... }
}
Authorization: Bearer dbn_live_abc123...
application/json for all requests.Content-Type: application/json
Show Finding embed IDs
single: single worksheet mode (tables are pre-joined into one worksheet)multi: multi-sheet mode (joins are resolved dynamically based on fields used in each chart)accessSettings.joinModel instead.null for successful requests.| Status Code | Description |
|---|---|
200 | OK - Embed configuration updated successfully |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Insufficient permissions to update |
404 | Not Found - Embed configuration not found |
409 | Conflict - Update conflicts with existing configuration |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Server error occurred |
| Error Code | HTTP Status | Description |
|---|---|---|
EMBED_NOT_FOUND | 404 | Embed configuration not found |
INVALID_WORKSPACE_NAME | 404 | Workspace not found |
INVALID_DATAMART | 404 | Datamart not found |
INSUFFICIENT_PERMISSIONS | 403 | No permission to update |
AUTHENTICATION_ERR | 401 | Invalid API key |
INVALID_ACCESS_SETTINGS | 400 | Invalid access settings |
CONFLICTING_UPDATE | 409 | Update conflicts with existing config |
RATE_LIMIT_EXCEEDED | 429 | Too many requests |
INTERNAL_SERVER_ERROR | 500 | Server error |
Permission escalation
// Enable metric creation for power users
await updateEmbed({
embedId: 'embed_123',
accessSettings: {
isAllowMetricCreation: true,
metricCreationMode: 'CHAT'
}
});
Datamart migration
await updateEmbed({
embedId: 'embed_123',
accessSettings: {
datamartName: 'new-datamart'
}
});
// Upgrade basic embed to include AI features
await updateEmbed({
embedId: 'embed_basic',
accessSettings: {
isAllowEmailReports: true,
metricCreationMode: 'CHAT'
}
});
// Move embed to updated datamart
await updateEmbed({
embedId: 'embed_old',
accessSettings: {
datamartName: 'updated-sales-data',
tableTenancySettings: [
{
name: 'new_customer_table',
clientColumn: 'tenant_id'
}
]
}
});
// Temporarily reduce permissions during maintenance
await updateEmbed({
embedId: 'embed_maintenance',
accessSettings: {
isAllowMetricCreation: false,
isAllowMetricUpdate: false,
isAllowMetricDeletion: false
}
});
// Update permissions based on user tier
const updatePermissionsForTier = async (embedId, userTier) => {
const permissions = {
basic: {
isAllowMetricCreation: false,
isAllowUnderlyingData: false
},
premium: {
isAllowMetricCreation: true,
isAllowUnderlyingData: true,
metricCreationMode: 'CHAT'
}
};
await updateEmbed({
embedId,
accessSettings: permissions[userTier]
});
};
// Update multiple embeds with same settings
const bulkUpdateEmbeds = async (embedIds, updates) => {
const promises = embedIds.map(embedId =>
updateEmbed({
embedId,
accessSettings: updates
})
);
const results = await Promise.all(promises);
return results;
};
Find your embed ID
curl --request GET \
--url https://api.usedatabrain.com/api/v2/data-app/embeds \
--header 'Authorization: Bearer dbn_live_abc123...'
Update specific permissions
curl --request PUT \
--url https://api.usedatabrain.com/api/v2/data-app/embeds \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"embedId": "embed_abc123def456",
"accessSettings": {
"isAllowMetricCreation": true
}
}'
Migrate to new datamart
curl --request PUT \
--url https://api.usedatabrain.com/api/v2/data-app/embeds \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"embedId": "embed_abc123def456",
"accessSettings": {
"datamartName": "new-datamart-name"
}
}'