Panels

Panels are modular units of data visualization that exist within the Insights module. Each panel exists within a Dashboard and can be positioned and resized as needed.

List panels

List all panels that exist in Directus.

Query Parameters

fields
array

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

offset
integer

How many items to skip when fetching data.

meta
string

What metadata to return in the response.

sort
array

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.

filter

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

page
integer

Cursor for use in pagination. Often used in combination with limit.

Response

Successful request

data
array
meta
object
GET /panels
Response Example
{
  "data": [
    {
      "id": "22640672-eef0-4ee9-ab04-591f3afb288",
      "dashboard": "a79bd1b2-beb2-49fc-8a26-0b3eec0e269",
      "name": "30-day sales",
      "icon": "paid",
      "color": null,
      "show_header": true,
      "note": "Overview of the sales numbers in the last 30 day",
      "type": "time-series",
      "position_x": 1,
      "position_y": 1,
      "width": 1,
      "height": 1,
      "options": {},
      "date_created": "2023-01-05T19:05:51.884Z",
      "user_created": "fd066644-c8e5-499d-947b-fe6c6e1a1473"
    }
  ],
  "meta": {}
}

Create Multiple panels

Create multiple new panels.

Query Parameters

fields
array

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

meta
string

What metadata to return in the response.

offset
integer

How many items to skip when fetching data.

sort
array

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.

filter

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

Request Body

data
array

Response

Successful request

data
array
meta
object
POST /panels
Response Example
{
  "data": [
    {
      "id": "22640672-eef0-4ee9-ab04-591f3afb288",
      "dashboard": "a79bd1b2-beb2-49fc-8a26-0b3eec0e269",
      "name": "30-day sales",
      "icon": "paid",
      "color": null,
      "show_header": true,
      "note": "Overview of the sales numbers in the last 30 day",
      "type": "time-series",
      "position_x": 1,
      "position_y": 1,
      "width": 1,
      "height": 1,
      "options": {},
      "date_created": "2023-01-05T19:05:51.884Z",
      "user_created": "fd066644-c8e5-499d-947b-fe6c6e1a1473"
    }
  ],
  "meta": {}
}

Delete Multiple panels

Delete multiple existing panels.

Request Body

An array of panel primary keys.

[array]
array
DELETE /panels

Update Multiple panels

Update multiple panels at the same time.

Query Parameters

fields
array

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

meta
string

What metadata to return in the response.

offset
integer

How many items to skip when fetching data.

sort
array

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.

filter

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

Request Body

data
object
keys
array

Response

Successful request

data
array
meta
object
PATCH /panels
Response Example
{
  "data": [
    {
      "id": "22640672-eef0-4ee9-ab04-591f3afb288",
      "dashboard": "a79bd1b2-beb2-49fc-8a26-0b3eec0e269",
      "name": "30-day sales",
      "icon": "paid",
      "color": null,
      "show_header": true,
      "note": "Overview of the sales numbers in the last 30 day",
      "type": "time-series",
      "position_x": 1,
      "position_y": 1,
      "width": 1,
      "height": 1,
      "options": {},
      "date_created": "2023-01-05T19:05:51.884Z",
      "user_created": "fd066644-c8e5-499d-947b-fe6c6e1a1473"
    }
  ],
  "meta": {}
}

Create a panel

Create a new panel.

Query Parameters

fields
array

Control what fields are being returned in the object.

meta
string

What metadata to return in the response.

Request Body

[object]
object

Response

Successful request

data
object
POST /panels‎
Response Example
{
  "data": {
    "id": "22640672-eef0-4ee9-ab04-591f3afb288",
    "dashboard": "a79bd1b2-beb2-49fc-8a26-0b3eec0e269",
    "name": "30-day sales",
    "icon": "paid",
    "color": null,
    "show_header": true,
    "note": "Overview of the sales numbers in the last 30 day",
    "type": "time-series",
    "position_x": 1,
    "position_y": 1,
    "width": 1,
    "height": 1,
    "options": {},
    "date_created": "2023-01-05T19:05:51.884Z",
    "user_created": "fd066644-c8e5-499d-947b-fe6c6e1a1473"
  }
}

Retrieve a panel

List an existing panel by primary key.

Query Parameters

id
string

Unique identifier of the panel.

fields
array

Control what fields are being returned in the object.

meta
string

What metadata to return in the response.

Response

Successful request

data
object
GET /panels/{id}
Response Example
{
  "data": {
    "id": "22640672-eef0-4ee9-ab04-591f3afb288",
    "dashboard": "a79bd1b2-beb2-49fc-8a26-0b3eec0e269",
    "name": "30-day sales",
    "icon": "paid",
    "color": null,
    "show_header": true,
    "note": "Overview of the sales numbers in the last 30 day",
    "type": "time-series",
    "position_x": 1,
    "position_y": 1,
    "width": 1,
    "height": 1,
    "options": {},
    "date_created": "2023-01-05T19:05:51.884Z",
    "user_created": "fd066644-c8e5-499d-947b-fe6c6e1a1473"
  }
}

Delete an panel

Delete an existing panel.

Query Parameters

id
string

Unique identifier of the panel.

DELETE /panels/{id}

Update a panel

Update an existing panel.

Query Parameters

id
string

Unique identifier of the panel.

fields
array

Control what fields are being returned in the object.

meta
string

What metadata to return in the response.

Request Body

[object]
object

Response

Successful request

data
object
PATCH /panels/{id}
Response Example
{
  "data": {
    "id": "22640672-eef0-4ee9-ab04-591f3afb288",
    "dashboard": "a79bd1b2-beb2-49fc-8a26-0b3eec0e269",
    "name": "30-day sales",
    "icon": "paid",
    "color": null,
    "show_header": true,
    "note": "Overview of the sales numbers in the last 30 day",
    "type": "time-series",
    "position_x": 1,
    "position_y": 1,
    "width": 1,
    "height": 1,
    "options": {},
    "date_created": "2023-01-05T19:05:51.884Z",
    "user_created": "fd066644-c8e5-499d-947b-fe6c6e1a1473"
  }
}