Preferences HTTP API
Note
Available in Grafana 13.2 and later.
This API complies with the new Grafana API structure. To learn more refer to documentation about the API structure in Grafana.
The legacy Preferences API is still available, and removal will be announced well in advance to avoid disruptions. Refer to Migrate from the legacy Preferences API to learn more about how both APIs match, and how to migrate.
This document may not contain the latest version of the API. For the most up-to-date list of available endpoints, refer to preferences.grafana.app/v1 in Swagger.
Use this API to read and change user, team, and organization preferences, such as the theme, timezone, home dashboard, and language.
Requirements
Access depends on who owns the preferences, not on role-based access control actions. You can read and change your own preferences. Team members can read team preferences, and users who can edit the team can change them. Every user in the organization can read organization preferences, and users with the Admin role can change them. Organization administrators can’t read or change the preferences of other users. For more information, refer to Organization preferences.
Endpoints
The following table lists the main endpoints. The Swagger documentation also includes the parameters for watching changes.
Base path: /apis/preferences.grafana.app/v1/namespaces/{namespace}/
Replace {namespace} with your namespace. To learn which namespace to use, refer to the
API overview.
Preference names and precedence
Each preferences object belongs to a user, a team, or the whole organization. Its name, metadata.name, identifies the owner:
{user_uid} and {team_uid} are UIDs, not numeric IDs or logins. To get your user UID, use the uid field returned by GET /api/user.
When Grafana applies preferences, it uses the first value set for each field, in this order:
- The user preferences.
- The preferences of the user’s teams, in team UID order. Grafana only considers the first 25 teams.
- The organization preferences.
- The defaults in the Grafana configuration.
To get the result, use Get merged preferences.
Preferences fields
The spec of a preferences object has the following fields. All fields are optional. A field that isn’t set falls back to the next level, as described in Preference names and precedence.
- theme – The interface theme. For example,
light,dark, orsystem. An empty string uses the default. - timezone – A valid IANA timezone, such as
America/New_YorkorEurope/London,utc,browser, or an empty string. - weekStart – The first day of the week, in lowercase. For example,
monday. - language – The interface language. For example,
en-US. - homeDashboardUID – The UID of the home dashboard. The reserved value
global-homeuses the instance default home page instead of the home dashboard set at a lower level. An empty string clears the preference. - navbar.bookmarkUrls – The URLs bookmarked in the navigation menu.
- queryHistory.homeTab – The default tab of the Explore query history:
query,starred, or an empty string. - homeURL – Read-only. The home URL from the
home_pagesetting in the Grafana configuration. You can’t set it through the API.
Get merged preferences
GET /apis/preferences.grafana.app/v1/namespaces/{namespace}/preferences/merged
Returns the preferences that apply to you, after combining your user, team, and organization preferences with the configured defaults.
Path parameters:
{namespace}: To learn more about which namespace to use, refer to the API overview.
Required permissions: None. The response only includes the preferences that apply to you.
Example request
The following example shows a request to get merged preferences:
GET /apis/preferences.grafana.app/v1/namespaces/default/preferences/merged HTTP/1.1
Accept: application/json
Authorization: Bearer <SERVICE_ACCOUNT_TOKEN>Example response
The following example shows the response:
HTTP/1.1 200
Content-Type: application/json
{
"kind": "Preferences",
"apiVersion": "preferences.grafana.app/v1",
"metadata": {
"resourceVersion": "1762327800000",
"creationTimestamp": "2026-11-05T07:30:00Z",
"annotations": {
"preferences.grafana.app/source": "user-a1b2c3d4,namespace"
}
},
"spec": {
"theme": "dark",
"timezone": "utc",
"weekStart": "monday",
"language": "en-US",
"homeDashboardUID": "jcIIG-07z"
}
}The preferences.grafana.app/source annotation lists the preferences objects that were combined, from highest to lowest precedence. The resourceVersion changes when any of them changes.
List preferences
GET /apis/preferences.grafana.app/v1/namespaces/{namespace}/preferences
Returns the preferences objects that apply to you: your user preferences, the preferences of your first 25 teams, and the organization preferences. Objects that don’t exist aren’t included. Service accounts only get the organization preferences.
Path parameters:
{namespace}: To learn more about which namespace to use, refer to the API overview.
Query parameters:
fieldSelector(optional): Usemetadata.name=<NAME>to get a single preferences object. No other field selector is supported.
The API doesn’t support pagination with continue, or filtering with labelSelector.
Required permissions: None. The response only includes the preferences you can read.
Example request
The following example shows a request to list preferences:
GET /apis/preferences.grafana.app/v1/namespaces/default/preferences HTTP/1.1
Accept: application/json
Authorization: Bearer <SERVICE_ACCOUNT_TOKEN>Example response
The following example shows the response:
HTTP/1.1 200
Content-Type: application/json
{
"kind": "PreferencesList",
"apiVersion": "preferences.grafana.app/v1",
"metadata": {},
"items": [
{
"kind": "Preferences",
"apiVersion": "preferences.grafana.app/v1",
"metadata": {
"name": "user-a1b2c3d4",
"namespace": "default",
"resourceVersion": "1762327800000",
"creationTimestamp": "2026-11-05T07:30:00Z"
},
"spec": {
"theme": "dark",
"homeDashboardUID": "jcIIG-07z"
}
},
{
"kind": "Preferences",
"apiVersion": "preferences.grafana.app/v1",
"metadata": {
"name": "namespace",
"namespace": "default",
"resourceVersion": "1762320000000",
"creationTimestamp": "2026-11-05T05:20:00Z"
},
"spec": {
"timezone": "utc",
"weekStart": "monday"
}
}
]
}Get preferences
GET /apis/preferences.grafana.app/v1/namespaces/{namespace}/preferences/{name}
Returns the preferences object with the given name.
Path parameters:
{namespace}: To learn more about which namespace to use, refer to the API overview.{name}:user-{user_uid},team-{team_uid}, ornamespace.
Required permissions: Read access for the owner. Refer to Requirements.
Example request
The following example shows a request to get preferences:
GET /apis/preferences.grafana.app/v1/namespaces/default/preferences/user-a1b2c3d4 HTTP/1.1
Accept: application/json
Authorization: Bearer <SERVICE_ACCOUNT_TOKEN>Example response
The following example shows the response:
HTTP/1.1 200
Content-Type: application/json
{
"kind": "Preferences",
"apiVersion": "preferences.grafana.app/v1",
"metadata": {
"name": "user-a1b2c3d4",
"namespace": "default",
"resourceVersion": "1762327800000",
"creationTimestamp": "2026-11-05T07:30:00Z"
},
"spec": {
"theme": "dark",
"homeDashboardUID": "jcIIG-07z"
}
}Create preferences
POST /apis/preferences.grafana.app/v1/namespaces/{namespace}/preferences
Creates the preferences for a user, a team, or the organization. You can also use Update preferences, which creates the object if it doesn’t exist yet.
Path parameters:
{namespace}: To learn more about which namespace to use, refer to the API overview.
Required permissions: Only access-policy tokens with explicit permissions can create preferences with POST. User and service account requests return 403. Use Update preferences or Patch preferences instead.
Example request
The following example shows a request to create preferences:
POST /apis/preferences.grafana.app/v1/namespaces/default/preferences HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer <SERVICE_ACCOUNT_TOKEN>
{
"metadata": {
"name": "team-ef5gh6ij"
},
"spec": {
"theme": "light",
"homeDashboardUID": "jcIIG-07z"
}
}JSON body schema:
- metadata.name – Required.
user-{user_uid},team-{team_uid}, ornamespace. - spec – The preferences. For details, refer to Preferences fields.
Example response
The following example shows the response:
HTTP/1.1 201
Content-Type: application/json
{
"kind": "Preferences",
"apiVersion": "preferences.grafana.app/v1",
"metadata": {
"name": "team-ef5gh6ij",
"namespace": "default",
"resourceVersion": "1762328000000",
"creationTimestamp": "2026-11-05T07:33:20Z"
},
"spec": {
"theme": "light",
"homeDashboardUID": "jcIIG-07z"
}
}Update preferences
PUT /apis/preferences.grafana.app/v1/namespaces/{namespace}/preferences/{name}
Replaces the preferences with the given name. If no preferences exist for the owner yet, Grafana creates them. Fields you omit are cleared, so they fall back to the next level.
Path parameters:
{namespace}: To learn more about which namespace to use, refer to the API overview.{name}:user-{user_uid},team-{team_uid}, ornamespace.
Required permissions: Write access for the owner. Refer to Requirements.
Example request
The following example shows a request to update preferences:
PUT /apis/preferences.grafana.app/v1/namespaces/default/preferences/namespace HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer <SERVICE_ACCOUNT_TOKEN>
{
"metadata": {
"name": "namespace"
},
"spec": {
"theme": "",
"timezone": "utc",
"weekStart": "monday",
"homeDashboardUID": "jcIIG-07z"
}
}JSON body schema:
- metadata.name – Required. It must match
namein the path. - metadata.resourceVersion – Optional. The resource version you’re updating. If the preferences changed since you read them, the request fails with
409. - spec – The complete preferences. For details, refer to Preferences fields.
The response contains the updated preferences.
Example response
The response contains the updated preferences. For an example, refer to the response in Get preferences.
Patch preferences
PATCH /apis/preferences.grafana.app/v1/namespaces/{namespace}/preferences/{name}
Updates one or more preferences without changing the others. If no preferences exist for the owner yet, Grafana creates them.
Path parameters:
{namespace}: To learn more about which namespace to use, refer to the API overview.{name}:user-{user_uid},team-{team_uid}, ornamespace.
Required permissions: Write access for the owner. Refer to Requirements.
Example request
The following example shows a request to patch preferences:
PATCH /apis/preferences.grafana.app/v1/namespaces/default/preferences/user-a1b2c3d4 HTTP/1.1
Accept: application/json
Content-Type: application/merge-patch+json
Authorization: Bearer <SERVICE_ACCOUNT_TOKEN>
{
"spec": {
"theme": "dark"
}
}Example response
The response contains the updated preferences. For an example, refer to the response in Get preferences.
Delete preferences
DELETE /apis/preferences.grafana.app/v1/namespaces/{namespace}/preferences/{name}
Deletes the preferences with the given name. After that, every field falls back to the next level.
Path parameters:
{namespace}: To learn more about which namespace to use, refer to the API overview.{name}:user-{user_uid},team-{team_uid}, ornamespace.
Required permissions: Write access for the owner. Refer to Requirements.
Example request
The following example shows a request to delete preferences:
DELETE /apis/preferences.grafana.app/v1/namespaces/default/preferences/user-a1b2c3d4 HTTP/1.1
Accept: application/json
Authorization: Bearer <SERVICE_ACCOUNT_TOKEN>Example response
The response contains a Status object that confirms the deletion.
Status codes
The endpoints on this page return the following status codes:
Migrate from the legacy Preferences API
The legacy API has separate endpoints for the current user, the current organization, and teams. The new API uses one resource, and the name selects the owner:
When you migrate, consider the following differences:
- Team preferences: The legacy team preferences endpoints use the numeric team ID. The new API uses the team UID.
- Home dashboard:
homeDashboardIdisn’t available. UsehomeDashboardUID. - Effective preferences: The legacy API has no equivalent of Get merged preferences.
- Responses: Updates return the saved preferences object instead of a
{"message":"Preferences updated"}message.


