Skip to main content
This guide provides example REST API endpoints for dashboard operations in your backend.

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.
Create a new dashboard for a tenant.
Request:
Response:

Get Dashboard by Tenant

Retrieve the dashboard for a specific tenant.
Request:
Response:

Generate Iframe Token

Generate a secure token for embedding a dashboard.
Request:
Response:

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

Rate Limiting

Implement rate limiting to prevent abuse:

Next Steps

Security Best Practices

Learn about security considerations for production

Frontend Setup

Set up the frontend to embed dashboards