Dashboards
List Dashboards
List all dashboards that exist in Directus.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
How many items to skip when fetching data.
What metadata to return in the response.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Cursor for use in pagination. Often used in combination with limit.
Responses
Primary key of the dashboard;
Name of the dashboard.
Material icon for dashboard.
Descriptive text about the dashboard.
When the dashboard was created.
User that created the dashboard. Many-to-one to users.
Accent color for the dashboard.
Panels that are in this dashboard. One-to-may to panels.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
GET /dashboards
import { createDirectus, rest, (readDashboards } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readDashboards(query_object));
type Query {
dashboards: [directus_dashboards]
}
{
"data": [
{
"id": "a79bd1b2-beb2-49fc-8a26-0b3eec0e2697",
"name": "My dashboard",
"icon": "space_dashboard",
"note": "Test",
"date_created": "2023-01-25T19:16:49.009Z",
"user_created": "fd066644-c8e5-499d-947b-fe6c6e1a1473",
"color": null,
"panels": "22640672-eef0-4ee9-ab04-591f3afb2883"
}
],
"meta": {}
}
Create Multiple Dashboards
Create multiple new dashboards.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
What metadata to return in the response.
How many items to skip when fetching data.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Request Body
Primary key of the dashboard;
Name of the dashboard.
Material icon for dashboard.
Descriptive text about the dashboard.
When the dashboard was created.
User that created the dashboard. Many-to-one to users.
Accent color for the dashboard.
Panels that are in this dashboard. One-to-may to panels.
Responses
Primary key of the dashboard;
Name of the dashboard.
Material icon for dashboard.
Descriptive text about the dashboard.
When the dashboard was created.
User that created the dashboard. Many-to-one to users.
Accent color for the dashboard.
Panels that are in this dashboard. One-to-may to panels.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
POST /dashboards
import { createDirectus, rest, createDashboards } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(createDashboards(dashboard_object_array));
type Mutation {
create_dashboards_items(data: [create_directus_dashboards_input!]!): [directus_dashboards]
}
{
"data": [
{
"id": "a79bd1b2-beb2-49fc-8a26-0b3eec0e2697",
"name": "My dashboard",
"icon": "space_dashboard",
"note": "Test",
"date_created": "2023-01-25T19:16:49.009Z",
"user_created": "fd066644-c8e5-499d-947b-fe6c6e1a1473",
"color": null,
"panels": "22640672-eef0-4ee9-ab04-591f3afb2883"
}
],
"meta": {}
}
Delete Multiple Dashboards
Delete multiple existing dashboards.
Responses
DELETE /dashboards
import { createDirectus, rest, deleteDashboards } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(deleteDashboards(dashboard_id_array));
type Mutation {
delete_dashboards_items(ids: [ID!]!): delete_many
}
Update Multiple Dashboards
Update multiple dashboards at the same time.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
What metadata to return in the response.
How many items to skip when fetching data.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Request Body
Primary key of the dashboard;
Name of the dashboard.
Material icon for dashboard.
Descriptive text about the dashboard.
When the dashboard was created.
User that created the dashboard. Many-to-one to users.
Accent color for the dashboard.
Panels that are in this dashboard. One-to-may to panels.
Responses
Primary key of the dashboard;
Name of the dashboard.
Material icon for dashboard.
Descriptive text about the dashboard.
When the dashboard was created.
User that created the dashboard. Many-to-one to users.
Accent color for the dashboard.
Panels that are in this dashboard. One-to-may to panels.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
PATCH /dashboards
import { createDirectus, rest, updateDashboards } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(updateDashboards(dashboard_id_array, partial_dashboard_object));
type Mutation {
update_dashboards_items(ids: [ID!]!, data: update_directus_dashboards_input): [directus_dashboards]
}
{
"data": [
{
"id": "a79bd1b2-beb2-49fc-8a26-0b3eec0e2697",
"name": "My dashboard",
"icon": "space_dashboard",
"note": "Test",
"date_created": "2023-01-25T19:16:49.009Z",
"user_created": "fd066644-c8e5-499d-947b-fe6c6e1a1473",
"color": null,
"panels": "22640672-eef0-4ee9-ab04-591f3afb2883"
}
],
"meta": {}
}
Create a Dashboard
Create a new dashboard.
Query Parameters
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Primary key of the dashboard;
Name of the dashboard.
Material icon for dashboard.
Descriptive text about the dashboard.
When the dashboard was created.
User that created the dashboard. Many-to-one to users.
Accent color for the dashboard.
Panels that are in this dashboard. One-to-may to panels.
Responses
Primary key of the dashboard;
Name of the dashboard.
Material icon for dashboard.
Descriptive text about the dashboard.
When the dashboard was created.
User that created the dashboard. Many-to-one to users.
Accent color for the dashboard.
Panels that are in this dashboard. One-to-may to panels.
POST /dashboards
import { createDirectus, rest, createDashboard } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(createDashboard(dashboard_object));
type Mutation {
create_dashboards_item(data: create_directus_dashboards_input!): directus_dashboards
}
{
"data": {
"id": "a79bd1b2-beb2-49fc-8a26-0b3eec0e2697",
"name": "My dashboard",
"icon": "space_dashboard",
"note": "Test",
"date_created": "2023-01-25T19:16:49.009Z",
"user_created": "fd066644-c8e5-499d-947b-fe6c6e1a1473",
"color": null,
"panels": "22640672-eef0-4ee9-ab04-591f3afb2883"
}
}
Retrieve a Dashboard
List an existing dashboard by primary key.
Query Parameters
Unique identifier of the Dashboard.
Control what fields are being returned in the object.
What metadata to return in the response.
Responses
Primary key of the dashboard;
Name of the dashboard.
Material icon for dashboard.
Descriptive text about the dashboard.
When the dashboard was created.
User that created the dashboard. Many-to-one to users.
Accent color for the dashboard.
Panels that are in this dashboard. One-to-may to panels.
GET /dashboards/{id}
import { createDirectus, rest, readDashboard } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readDashboard(dashboard_id, query_object));
type Query {
dashboards_by_id(id: ID!): directus_dashboards
}
{
"data": {
"id": "a79bd1b2-beb2-49fc-8a26-0b3eec0e2697",
"name": "My dashboard",
"icon": "space_dashboard",
"note": "Test",
"date_created": "2023-01-25T19:16:49.009Z",
"user_created": "fd066644-c8e5-499d-947b-fe6c6e1a1473",
"color": null,
"panels": "22640672-eef0-4ee9-ab04-591f3afb2883"
}
}
Delete a Dashboard
Delete an existing dashboard.
Query Parameters
Unique identifier of the dashboard.
Responses
DELETE /dashboards/{id}
import { createDirectus, rest, deleteDashboard } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(deleteDashboard(dashboard_id));
type Mutation {
delete_dashboards_item(id: ID!): delete_one
}
Update a Dashboard
Update an existing dashboard.
Query Parameters
Unique identifier of the dashboard.
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Primary key of the dashboard;
Name of the dashboard.
Material icon for dashboard.
Descriptive text about the dashboard.
When the dashboard was created.
User that created the dashboard. Many-to-one to users.
Accent color for the dashboard.
Panels that are in this dashboard. One-to-may to panels.
Responses
Primary key of the dashboard;
Name of the dashboard.
Material icon for dashboard.
Descriptive text about the dashboard.
When the dashboard was created.
User that created the dashboard. Many-to-one to users.
Accent color for the dashboard.
Panels that are in this dashboard. One-to-may to panels.
PATCH /dashboards/{id}
import { createDirectus, rest, updateDashboard } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(updateDashboard(dashboard_id, partial_dashboard_object));
type Mutation {
update_dashboards_item(id: ID!, data: update_directus_dashboards_input): directus_dashboards
}
{
"data": {
"id": "a79bd1b2-beb2-49fc-8a26-0b3eec0e2697",
"name": "My dashboard",
"icon": "space_dashboard",
"note": "Test",
"date_created": "2023-01-25T19:16:49.009Z",
"user_created": "fd066644-c8e5-499d-947b-fe6c6e1a1473",
"color": null,
"panels": "22640672-eef0-4ee9-ab04-591f3afb2883"
}
}