Skip to main content
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": {
      "isAllowAiPilot": true,
      "isAllowMetricCreation": false,
      "isAllowUnderlyingData": true,
      "tableTenancySettings": [
        {
          "name": "updated_sales_data",
          "clientColumn": "customer_id"
        }
      ]
    }
  }'
{
  "id": "embed_abc123def456",
  "error": null
}
PUT
/
api
/
v2
/
data-app
/
embeds
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": {
      "isAllowAiPilot": true,
      "isAllowMetricCreation": false,
      "isAllowUnderlyingData": true,
      "tableTenancySettings": [
        {
          "name": "updated_sales_data",
          "clientColumn": "customer_id"
        }
      ]
    }
  }'
{
  "id": "embed_abc123def456",
  "error": null
}
Modify existing embed configurations to update access settings, change permissions, or associate with different datamarts. This allows you to evolve your embedded analytics without recreating configurations.
Endpoint Migration Notice: We’re transitioning to kebab-case endpoints. The new endpoint is /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.
Updates to embed configurations take effect immediately for all active embedded dashboards and metrics using this configuration.

Endpoint Formats

Authentication

All API requests must include your API key in the Authorization header. Get your API token when creating a data app - see our data app creation guide for details. Finding your API token: For detailed instructions, see the API Token guide.

Headers

Authorization
string
required
Bearer token for API authentication. Use your API key from the data app.
Authorization: Bearer dbn_live_abc123...
Content-Type
string
required
Must be set to application/json for all requests.
Content-Type: application/json

Request Body

embedId
string
required
The unique identifier of the embed configuration to update. Get this from the create embed response or list embeds API.
accessSettings
object
required
Updated access control settings for the embedded view. Only provided fields will be updated.
accessSettings.datamartName
string
Change the datamart used by this embed configuration.
accessSettings.isAllowAiPilot
boolean
Update AI pilot features permission.
accessSettings.isAllowEmailReports
boolean
Update email reports permission.
accessSettings.isAllowManageMetrics
boolean
Update metrics management permission.
accessSettings.isAllowMetricCreation
boolean
Update metric creation permission.
accessSettings.isAllowMetricDeletion
boolean
Update metric deletion permission.
accessSettings.isAllowMetricLayoutChange
boolean
Update metric layout change permission.
accessSettings.isAllowMetricUpdate
boolean
Update metric modification permission.
accessSettings.isAllowUnderlyingData
boolean
Update underlying data access permission.
accessSettings.isAllowCreateDashboardView
boolean
Update dashboard view creation permission.
accessSettings.metricCreationMode
'DRAG_DROP' | 'CHAT'
Update the metric creation mode.
accessSettings.tableTenancySettings
array
Update multi-tenant table access configuration.
accessSettings.tableTenancySettings.name
string
Table name for tenancy configuration.
accessSettings.tableTenancySettings.clientColumn
string
Column name for client-level filtering.

Response

id
string
The ID of the updated embed configuration.
error
null | object
Error object if the request failed, otherwise null for successful requests.

Examples

Error Codes

EMBED_NOT_FOUND
string
Embed configuration not found - The specified embed ID doesn’t exist in the workspace
INVALID_WORKSPACE_NAME
string
Workspace not found - The specified workspace doesn’t exist or you don’t have access
INVALID_DATAMART
string
Invalid datamart - The specified datamart doesn’t exist in the workspace
INSUFFICIENT_PERMISSIONS
string
Insufficient permissions - You don’t have permission to update this embed configuration
AUTHENTICATION_ERR
string
Invalid API key - Check your API key in dashboard settings

HTTP Status Code Summary

Status CodeDescription
200OK - Embed configuration updated successfully
400Bad Request - Invalid request parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions to update
404Not Found - Embed configuration not found
409Conflict - Update conflicts with existing configuration
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Server error occurred

Possible Errors

Error CodeHTTP StatusDescriptionSolution
EMBED_NOT_FOUND404Embed configuration not foundVerify embed ID exists in workspace
INVALID_WORKSPACE_NAME404Workspace not foundVerify workspace name and access
INVALID_DATAMART404Datamart not foundVerify datamart exists in workspace
INSUFFICIENT_PERMISSIONS403No permission to updateContact admin for embed update permissions
AUTHENTICATION_ERR401Invalid API keyVerify your API key is correct
INVALID_ACCESS_SETTINGS400Invalid access settingsCheck accessSettings object structure
CONFLICTING_UPDATE409Update conflicts with existing configResolve configuration conflicts
RATE_LIMIT_EXCEEDED429Too many requestsImplement exponential backoff
INTERNAL_SERVER_ERROR500Server errorContact support if error persists

Update Strategies

1

Incremental updates

Update only the fields you need to change:
// Only update AI pilot permission
await updateEmbed({
  embedId: 'embed_123',
  accessSettings: {
    isAllowAiPilot: true
  }
});
2

Permission escalation

Gradually increase permissions based on user needs:
// Enable metric creation for power users
await updateEmbed({
  embedId: 'embed_123',
  accessSettings: {
    isAllowMetricCreation: true,
    metricCreationMode: 'CHAT'
  }
});
3

Datamart migration

Move embed to a different datamart:
await updateEmbed({
  embedId: 'embed_123',
  accessSettings: {
    datamartName: 'new-datamart'
  }
});
4

Security tightening

Reduce permissions when needed:
await updateEmbed({
  embedId: 'embed_123',
  accessSettings: {
    isAllowMetricDeletion: false,
    isAllowUnderlyingData: false
  }
});

Common Update Scenarios

Enable Advanced Features

// Upgrade basic embed to include AI features
await updateEmbed({
  embedId: 'embed_basic',
  accessSettings: {
    isAllowAiPilot: true,
    isAllowEmailReports: true,
    metricCreationMode: 'CHAT'
  }
});

Migrate to New Datamart

// Move embed to updated datamart
await updateEmbed({
  embedId: 'embed_old',
  accessSettings: {
    datamartName: 'updated-sales-data',
    tableTenancySettings: [
      {
        name: 'new_customer_table',
        clientColumn: 'tenant_id'
      }
    ]
  }
});

Temporary Permission Reduction

// Temporarily reduce permissions during maintenance
await updateEmbed({
  embedId: 'embed_maintenance',
  accessSettings: {
    isAllowMetricCreation: false,
    isAllowMetricUpdate: false,
    isAllowMetricDeletion: false
  }
});

Best Practices

Change Management

  • Document all configuration changes
  • Test updates in staging first
  • Notify stakeholders of permission changes
  • Maintain change history and rollback plans

Security

  • Follow principle of least privilege
  • Regular permission audits
  • Monitor for unauthorized changes
  • Validate datamart access before updates

Performance

  • Batch multiple updates when possible
  • Monitor embed performance after changes
  • Test with production data volumes
  • Update during low-usage periods

User Experience

  • Communicate feature changes to users
  • Provide training for new capabilities
  • Gradual rollout of new permissions
  • Collect feedback on configuration changes

Advanced Configuration

Dynamic Permission Updates

// Update permissions based on user tier
const updatePermissionsForTier = async (embedId, userTier) => {
  const permissions = {
    basic: {
        isAllowAiPilot: false,
      isAllowMetricCreation: false,
      isAllowUnderlyingData: false
    },
    premium: {
      isAllowAiPilot: true,
      isAllowMetricCreation: true,
      isAllowUnderlyingData: true,
      metricCreationMode: 'CHAT'
    }
  };
  
  await updateEmbed({
    embedId,
    accessSettings: permissions[userTier]
  });
};

Bulk Updates

// 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;
};

Quick Start Guide

1

Find your embed ID

List your existing embed configurations to find the one you want to update:
curl --request GET \
  --url https://api.usedatabrain.com/api/v2/data-app/embeds \
  --header 'Authorization: Bearer dbn_live_abc123...'
2

Update specific permissions

Update only the settings you want to change. For example, to enable AI pilot:
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": {
      "isAllowAiPilot": true
    }
  }'
3

Migrate to new datamart

Change the datamart associated with your embed:
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"
    }
  }'
4

Verify the update

The API will return the embed ID on success:
const updateResult = await updateEmbed({
  embedId: 'embed_123',
  accessSettings: { isAllowAiPilot: true }
});

console.log('Updated embed ID:', updateResult.id);
console.log('Success:', !updateResult.error);

Next Steps

I