2020-07-13 21:09:24 +00:00
---
stage: Monitor
2021-03-18 15:09:04 +00:00
group: Monitor
2020-11-26 06:09:20 +00:00
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2020-07-13 21:09:24 +00:00
type: concepts, howto
---
2021-01-28 06:08:59 +00:00
# User-starred metrics dashboards API **(FREE)**
2020-05-13 18:08:47 +00:00
The starred dashboard feature makes navigating to frequently-used dashboards easier
by displaying favorited dashboards at the top of the select list.
## Add a star to a dashboard
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/31316) in GitLab 13.0.
```plaintext
POST /projects/:id/metrics/user_starred_dashboards
```
Parameters:
| Attribute | Type | Required | Description |
|:---------------|:---------------|:---------|:-----------------------------------------------------------------------------|
2021-06-28 15:08:03 +00:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) |
2020-05-13 18:08:47 +00:00
| `dashboard_path` | string | yes | URL-encoded path to file defining the dashboard which should be marked as favorite. |
```shell
2020-12-09 06:09:41 +00:00
curl --header 'Private-Token: < your_access_token > ' "https://gitlab.example.com/api/v4/projects/20/metrics/user_starred_dashboards" \
2020-05-13 18:08:47 +00:00
--data-urlencode "dashboard_path=config/prometheus/dashboards/common_metrics.yml"
```
Example Response:
```json
{
"id": 5,
"dashboard_path": "config/prometheus/common_metrics.yml",
"user_id": 1,
"project_id": 20
}
```
2020-05-14 12:08:21 +00:00
## Remove a star from a dashboard
2021-08-30 18:10:36 +00:00
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/31892) in GitLab 13.0.
2020-05-14 12:08:21 +00:00
```plaintext
DELETE /projects/:id/metrics/user_starred_dashboards
```
Parameters:
| Attribute | Type | Required | Description |
|:---------------|:---------------|:---------|:-----------------------------------------------------------------------------|
2021-06-28 15:08:03 +00:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) |
2020-11-18 15:09:08 +00:00
| `dashboard_path` | string | no | URL-encoded path to file defining the dashboard which should no longer be marked as favorite. When not supplied, all dashboards within given projects are removed from favorites. |
2020-05-14 12:08:21 +00:00
```shell
2020-12-09 06:09:41 +00:00
curl --request DELETE --header 'Private-Token: < your_access_token > ' "https://gitlab.example.com/api/v4/projects/20/metrics/user_starred_dashboards" \
2020-05-14 12:08:21 +00:00
--data-urlencode "dashboard_path=config/prometheus/dashboards/common_metrics.yml"
```
Example Response:
```json
{
"deleted_rows": 1
}
```