Overview
Your API should expose endpoints for:- Creating dashboards for tenants
- Retrieving tenant dashboards
- Generating iframe embed tokens
- Managing dashboard access
Authentication Middleware
All endpoints should require authentication. Here’s an example middleware:Create Dashboard Endpoint
The
create_dashboard function being called in the endpoint below should have already been created in
the Creating Dashboards guide.Get Dashboard by Tenant
Retrieve the dashboard for a specific tenant.Generate Iframe Token
Generate a secure token for embedding a dashboard.List All Dashboards (Optional)
List all dashboards for the authenticated user’s organization.Delete Dashboard (Optional)
Delete a dashboard for a tenant.Error Handling
Implement consistent error handling across all endpoints:Common Error Codes
| Code | Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid authentication |
FORBIDDEN | 403 | User doesn’t have access to resource |
NOT_FOUND | 404 | Resource not found |
VALIDATION_ERROR | 422 | Invalid request parameters |
SERVER_ERROR | 500 | Internal server error |

