Stars HTTP API


目录

{{< admonition type="note" >}} Available in Grafana 13 and later.

This API complies with the new Grafana API structure. To learn more refer to documentation about the API structure in Grafana.

This document may not contain the latest version of the API. For the most up-to-date list of available endpoints, refer to collections.grafana.app/v1 in Swagger.

{{< /admonition >}}

Also known as the collections API, /apis/collections.grafana.app/* allows you to star and unstar your resources in Grafana.

This API replaces POST and DELETE /api/user/stars/dashboard/uid/{dashboard_uid}, which are now are deprecated, although they keep working with no functional change. Use the generic Collections Stars API for any new integrations.

Endpoints

These are the available endpoints:

Method Summary URI Replaced endpoint
PUT/POST Star a resource /apis/collections.grafana.app/v1alpha1/namespaces/{namespace}/stars/user-{user_uid}/update/{group}/{kind}/{id} /api/user/stars/dashboard/uid/{dashboard_uid}
DELETE Unstar a resource /apis/collections.grafana.app/v1alpha1/namespaces/{namespace}/stars/user-{user_uid}/update/{group}/{kind}/{id} /api/user/stars/dashboard/uid/{dashboard_uid}

Path parameters

Parameters include:

One endpoint shape now covers every starrable resource instead of one endpoint per kind. For a given resource, {group} / {kind} / {id}: identify the resource being starred/unstarred:

Star a resource

PUT /apis/collections.grafana.app/v1alpha1/namespaces/{namespace}/stars/user-{user_uid}/update/{group}/{kind}/{id}

Stars a resource for the signed-in user.

Example request:

None. The star target is fully encoded in the URL path; no JSON body is required or read.

Example response:

Status Codes:

Unstar a resource

DELETE /apis/collections.grafana.app/v1alpha1/namespaces/{namespace}/stars/user-{user_uid}/update/{group}/{kind}/{id}

Unstars a resource for the signed-in user.

Refer to Star a resource for more details.

Migration steps

To migrate from /api/user/stars/* to /apis/collections.grafana.app/* follow these steps:

  1. Identify every direct caller of POST/PUT or DELETE /api/user/stars/dashboard/uid/{uid} in your integration. Skip the Grafana UI itself, which already calls the new API.
  2. Use GET /api/user to resolve the signed-in user's UID and cache it for the session.
  3. Determine the namespace your Grafana instance or stack uses for App Platform API calls.
  4. Replace the call with PUT (star) or DELETE (unstar) against /apis/collections.grafana.app/v1alpha1/namespaces/{namespace}/stars/user-{uid}/update/dashboard.grafana.app/Dashboard/{dashboard_uid}, with no request body.
  5. Update response handling. Treat 200 as success for both star and unstar, and 204 as a no-op success when unstarring something that wasn't starred.
  6. Leave any code that reads GET /api/user/stars as-is; it's unaffected by this change.

Migration example

The following call in the legacy API:

  curl -X POST \
    -H "Authorization: Bearer $TOKEN" \
    "https://<your-grafana>/api/user/stars/dashboard/uid/abc123"

Becomes:

  USER_UID=$(curl -s -H "Authorization: Bearer $TOKEN" \
    "https://<your-grafana>/api/user" | jq -r .uid)

  curl -X PUT \
    -H "Authorization: Bearer $TOKEN" \
    "https://<your-grafana>/apis/collections.grafana.app/v1alpha1/namespaces/default/stars/user-${USER_UID}/update/dashboard.grafana.app/Dashboard/abc123"

Unstarring has an identical behavior, with DELETE instead of PUT/POST.


版本号 #2
由 壳壳虫 创建于 2026-10-31 16:10:13 UTC
由 壳壳虫 更新于 2026-10-31 16:10:15 UTC