Skip to main content
POST
/
v2
/
dashboard
Create Dashboard
const options = {
  method: 'POST',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({project_id: '<string>', widgets: [{}], layouts: {}})
};

fetch('https://api.dcycle.io/v2/dashboard', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "<string>",
  "project_id": "<string>",
  "widgets": [
    {}
  ],
  "layouts": {},
  "created_at": {},
  "updated_at": {}
}

Create Dashboard

Create a new dashboard for a project in your organization. The project must belong to the organization specified in the header.
You can create the dashboard empty (widgets and layouts default to empty) and add widgets later via the Update Dashboard endpoint.

Request

Headers

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Body Parameters

project_id
string
required
UUID of the project to create the dashboard for. The project must belong to your organization.Example: "a8315ef3-dd50-43f8-b7ce-d839e68d51fa"
widgets
array
default:"[]"
Initial list of widget configurations. Each widget has an id, name, type, and config.
layouts
object
default:"{}"
Responsive grid layouts. Keys are breakpoints: lg, md, sm, xs, xxs. Each contains an array of layout items with i (widget ID), x, y, w, h.

Response

Returns the created dashboard object with HTTP 201.
id
string
Dashboard UUID (auto-generated)
project_id
string
UUID of the associated project
widgets
array
List of widget configurations (empty if not provided)
layouts
object
Responsive grid layouts (empty breakpoints if not provided)
created_at
datetime
Creation timestamp (ISO 8601)
updated_at
datetime | null
Last update timestamp (ISO 8601)

Example

curl -X POST "https://api.dcycle.io/v2/dashboard" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa"
  }'

Successful Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "project_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
  "widgets": [],
  "layouts": {
    "lg": [],
    "md": [],
    "sm": [],
    "xs": [],
    "xxs": []
  },
  "created_at": "2024-11-24T10:30:00Z",
  "updated_at": "2024-11-24T10:30:00Z"
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}

403 Forbidden

Cause: The user is not a member of the organization, or the project does not belong to your organization
{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}
{
  "detail": "Project doesn't belong to organization."
}

Update Dashboard

Add widgets and configure layouts

List Dashboards

View all dashboards