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));import requests
url = "https://api.dcycle.io/v2/dashboard"
payload = {
"project_id": "<string>",
"widgets": [{}],
"layouts": {}
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v2/dashboard \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"project_id": "<string>",
"widgets": [
{}
],
"layouts": {}
}
'{
"id": "<string>",
"project_id": "<string>",
"widgets": [
{}
],
"layouts": {},
"created_at": {},
"updated_at": {}
}Create Dashboard
Create a new dashboard for a project
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));import requests
url = "https://api.dcycle.io/v2/dashboard"
payload = {
"project_id": "<string>",
"widgets": [{}],
"layouts": {}
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v2/dashboard \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"project_id": "<string>",
"widgets": [
{}
],
"layouts": {}
}
'{
"id": "<string>",
"project_id": "<string>",
"widgets": [
{}
],
"layouts": {},
"created_at": {},
"updated_at": {}
}← Dashboards API
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
Body Parameters
UUID of the project to create the dashboard for. The project must belong to your organization.Retrieve available options from
GET /v1/projects/extendedExample: "a8315ef3-dd50-43f8-b7ce-d839e68d51fa"Initial list of widget configurations. Each widget has an
id, name, type, and config.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.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"
}'
import requests
import os
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
"Content-Type": "application/json",
}
response = requests.post(
"https://api.dcycle.io/v2/dashboard",
headers=headers,
json={"project_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa"},
)
dashboard = response.json()
print(f"Dashboard created: {dashboard['id']}")
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
'Content-Type': 'application/json',
};
axios.post('https://api.dcycle.io/v2/dashboard', {
project_id: 'a8315ef3-dd50-43f8-b7ce-d839e68d51fa',
}, { headers })
.then(response => console.log(`Created: ${response.data.id}`));
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."
}
Related Endpoints
Update Dashboard
Add widgets and configure layouts
List Dashboards
View all dashboards
Was this page helpful?