Grafana
Manage Grafana dashboards, folders, data sources and annotations, and run data source queries as rows. Typical uses: mark a deployment on dashboards, export a panel's data to a report.
grafana pinggrafana infografana folder_creategrafana folder_creategrafana foldersgrafana foldersgrafana datasource_creategrafana datasource_creategrafana datasourcesgrafana datasource_getgrafana datasource_querygrafana datasource_querygrafana datasource_deletegrafana dashboard_putgrafana dashboard_putgrafana dashboardsgrafana dashboardsgrafana dashboard_getgrafana annotation_creategrafana annotation_creategrafana annotationsgrafana annotationsgrafana annotation_deletegrafana alert_rulesgrafana usersgrafana orgsgrafana dashboard_deletegrafana folder_deletegrafana requestgrafana request

grafana ping <config>


Description

    Test the connection (no credentials needed). Returns {ok, version, database}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
grafana ping "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}"
mentdb
{"ok": true, "version": "11.3.0", "database": "ok"}

grafana info <config>


Description

    The version and the organization of the credentials (checks them). Returns {version, database, org_id, org_name}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
grafana info "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}"
mentdb
{"version": "11.3.0", "database": "ok", "org_id": 1, "org_name": "Main Org."}
A token over http to a remote host
admin
grafana info "{\"url\": \"http://grafana.example.com\", \"token\": \"glsa_xxxx\"}"
mentdb
ERROR: Sorry, an error appears (the credentials would travel in clear to 'grafana.example.com': use https, or set 'allow_plain' to true to accept it (http is only the default for localhost)).

grafana folder_create <config> <title>


Description

    Create a folder. Returns {uid, title, id, url}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    title:   The title - String - required
admin
grafana folder_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "Reports"
mentdb
{"uid": "ag4l6pzji2wowf", "title": "Reports", "id": 1, "url": "/dashboards/f/ag4l6pzji2wowf/reports"}

grafana folder_create <config> <title> <options_json>


Description

    Create a folder with options: uid, parent_uid (a sub folder, when nested folders are on)

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    title:   The title - String - required
    options_json:   The options - String - required
admin
grafana folder_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "MentDB jobs" "{\"uid\": \"mentdb-jobs\"}"
mentdb
{"uid": "mentdb-jobs", "title": "MentDB jobs", "id": 2, "url": "/dashboards/f/mentdb-jobs/mentdb-jobs"}

grafana folders <config>


Description

    The folders. Returns rows {uid, title, id, parent_uid}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
grafana folders "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}"
mentdb
[{"uid": "mentdb-jobs", "title": "MentDB jobs", "id": 2, "parent_uid": null}, {"uid": "ag4l6pzji2wowf", "title": "Reports", "id": 1, "parent_uid": null}]

grafana folders <config> <options_json>


Description

    The folders with options: parent_uid (the sub folders of a folder), limit (1000)

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    options_json:   The options - String - required
admin
grafana folders "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "{\"limit\": 1}"
mentdb
[{"uid": "mentdb-jobs", "title": "MentDB jobs", "id": 2, "parent_uid": null}]

grafana datasource_create <config> <datasource_json>


Description

    Create a data source: {name, type, url, access (proxy), uid, basicAuth, user, database, jsonData, secureJsonData}. Returns {uid, id, name}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    datasource_json:   The data source as a JSON object - String - required
admin
grafana datasource_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "{\"name\": \"Prometheus\", \"uid\": \"prom-main\", \"type\": \"prometheus\", \"url\": \"http://127.0.0.1:9090\", \"jsonData\": {\"httpMethod\": \"POST\"}}"
mentdb
{"uid": "prom-main", "id": 1, "name": "Prometheus"}
a Loki data source (fixed result: real Grafana OSS 11.3.0)
admin
grafana datasource_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "{\"name\": \"Loki\", \"uid\": \"loki-main\", \"type\": \"loki\", \"url\": \"http://127.0.0.1:3100\"}"
mentdb
{"uid": "loki-main", "id": 2, "name": "Loki"}

grafana datasource_create <config> <datasource_json> <options_json>


Description

    Create a data source with options: secure (secureJsonData fields read from secrets of the server: {"password": "PG_PASSWORD"}; the value appears nowhere)

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    datasource_json:   The data source - String - required
    options_json:   The options - String - required
admin
grafana datasource_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "{\"name\": \"Shop DB\", \"uid\": \"pg-shop\", \"type\": \"grafana-postgresql-datasource\", \"url\": \"127.0.0.1:5432\", \"user\": \"grafana\", \"jsonData\": {\"database\": \"shop\", \"sslmode\": \"disable\"}}" "{\"secure\": {\"password\": \"PG_PASSWORD\"}}"
mentdb
{"uid": "pg-shop", "id": 3, "name": "Shop DB"}

grafana datasources <config>


Description

    The data sources. Returns rows {uid, name, type, url, access, is_default, database, read_only, id}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
grafana datasources "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}"
mentdb
[{"uid": "loki-main", "name": "Loki", "type": "loki", "url": "http://127.0.0.1:3100", "access": "proxy", "is_default": false, "database": null, "read_only": false, "id": 2}, {"uid": "prom-main", "name": "Prometheus", "type": "prometheus", "url": "http://127.0.0.1:9090", "access": "proxy", "is_default": true, "database": null, "read_only": false, "id": 1}, {"uid": "pg-shop", "name": "Shop DB", "type": "grafana-postgresql-datasource", "url": "127.0.0.1:5432", "access": "proxy", "is_default": false, "database": null, "read_only": false, "id": 3}]

grafana datasource_get <config> <uid_or_name>


Description

    A data source by uid, or else by name (the secrets are only flagged in secureJsonFields)

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    uid_or_name:   The uid or the name - String - required
admin
grafana datasource_get "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "pg-shop"
mentdb
{"id": 3, "uid": "pg-shop", "orgId": 1, "name": "Shop DB", "type": "grafana-postgresql-datasource", "typeLogoUrl": "public/app/plugins/datasource/grafana-postgresql-datasource/img/postgresql_logo.svg", "access": "proxy", "url": "127.0.0.1:5432", "user": "grafana", "database": "", "basicAuth": false, "basicAuthUser": "", "withCredentials": false, "isDefault": false, "jsonData": {"database": "shop", "sslmode": "disable"}, "secureJsonFields": {"password": true}, "version": 1, "readOnly": false, "apiVersion": ""}
not found (fixed result: real Grafana OSS 11.3.0)
admin
grafana datasource_get "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "nothing here"
mentdb
ERROR: Sorry, an error appears (Grafana has no data source with the uid or the name 'nothing here').

grafana datasource_query <config> <datasource_uid> <query_json>


Description

    Run a query of a data source through Grafana, on the last hour. Returns rows

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    datasource_uid:   The uid of the data source - String - required
    query_json:   The query (a JSON object, or an array of queries), in the format of the data source - String - required
admin
grafana datasource_query "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "prom-main" "{\"expr\": \"sum by (job) (up)\", \"instant\": true}"
mentdb
[{"job": "pushgateway", "Time": "2026-11-17T16:08:51.044Z", "Value": 1}, {"job": "prometheus", "Time": "2026-11-17T16:08:51.044Z", "Value": 1}]
a query error (fixed result: real Grafana OSS 11.3.0)
admin
grafana datasource_query "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "prom-main" "{\"expr\": \"sum(rate(\"}"
mentdb
ERROR: Sorry, an error appears (Grafana query A failed: bad_data: invalid parameter "query": 1:10: parse error: unclosed left parenthesis).

grafana datasource_query <config> <datasource_uid> <query_json> <options_json>


Description

    Run queries with options: from (now-1h), to (now), max_data_points (1000), interval_ms (by default (to - from) / max_data_points, at least 1000), limit (100000 rows), raw (true: the answer of Grafana as it is), time_format

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    datasource_uid:   The uid of the data source - String - required
    query_json:   The queries - String - required
    options_json:   The options - String - required
admin
grafana datasource_query "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "loki-main" "[{\"expr\": \"{app=\\"billing\\"} |= \\"invoice\\"\", \"queryType\": \"range\", \"maxLines\": 2}, {\"expr\": \"sum(count_over_time({source=\\"mentdb\\"}[2m]))\", \"queryType\": \"instant\"}]" "{\"from\": \"2026-11-17T14:59:00Z\", \"to\": \"2026-11-17T15:01:00Z\"}"
mentdb
[{"ref_id": "A", "labels": {"app": "billing", "detected_level": "error", "level": "error", "service_name": "billing", "source": "mentdb"}, "Time": "2026-11-17T15:00:01Z", "Line": "invoice 43 rejected", "tsNs": "1794927601000000000", "labelTypes": {"app": "I", "detected_level": "S", "level": "I", "service_name": "I", "source": "I"}, "id": "1794927601000000000_dd1620ce"}, {"ref_id": "A", "labels": {"app": "billing", "detected_level": "info", "level": "info", "service_name": "billing", "source": "mentdb"}, "Time": "2026-11-17T15:00:00.123Z", "Line": "invoice 42 sent", "tsNs": "1794927600123456789", "labelTypes": {"app": "I", "detected_level": "S", "level": "I", "service_name": "I", "source": "I"}, "id": "1794927600123456789_703ea37d"}, {"ref_id": "B", "Time": "2026-11-17T15:01:00Z", "Value": 3}]

grafana datasource_delete <config> <uid>


Description

    Delete a data source by uid. Returns {deleted}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    uid:   The uid - String - required
admin
grafana datasource_delete "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "pg-shop"
mentdb
{"deleted": "pg-shop"}

grafana dashboard_put <config> <dashboard_json>


Description

    Create a dashboard (the dashboard JSON model, or {dashboard, meta} from grafana dashboard_get). Returns {uid, id, url, version, status}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    dashboard_json:   The dashboard as a JSON object - String - required
admin
grafana dashboard_put "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "{\"uid\": \"mentdb-imports\", \"title\": \"MentDB imports\", \"tags\": [\"mentdb\"], \"panels\": [{\"id\": 1, \"type\": \"timeseries\", \"title\": \"Rows imported\", \"gridPos\": {\"x\": 0, \"y\": 0, \"w\": 12, \"h\": 8}, \"datasource\": {\"uid\": \"prom-main\"}, \"targets\": [{\"expr\": \"import_rows\", \"refId\": \"A\"}]}]}"
mentdb
{"uid": "mentdb-imports", "id": 3, "url": "/d/mentdb-imports/mentdb-imports", "version": 1, "status": "success"}
the same uid again, without overwrite (fixed result: real Grafana OSS 11.3.0)
admin
grafana dashboard_put "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "{\"uid\": \"mentdb-imports\", \"title\": \"MentDB imports\"}"
mentdb
ERROR: Sorry, an error appears (Grafana refused the dashboard (HTTP 412): a dashboard with the same uid or title exists in the folder, or it changed since it was read; set the option overwrite to true to replace it).

grafana dashboard_put <config> <dashboard_json> <options_json>


Description

    Create or replace a dashboard with options: folder_uid, overwrite (false), message (the version note), keep_id (false: the numeric id is removed, so the dashboard is matched by uid)

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    dashboard_json:   The dashboard - String - required
    options_json:   The options - String - required
admin
grafana dashboard_put "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "{\"uid\": \"mentdb-imports\", \"title\": \"MentDB imports\", \"tags\": [\"mentdb\", \"v2\"], \"panels\": [{\"id\": 1, \"type\": \"timeseries\", \"title\": \"Rows imported\", \"gridPos\": {\"x\": 0, \"y\": 0, \"w\": 24, \"h\": 8}, \"datasource\": {\"uid\": \"prom-main\"}, \"targets\": [{\"expr\": \"import_rows\", \"refId\": \"A\"}]}]}" "{\"folder_uid\": \"mentdb-jobs\", \"overwrite\": true, \"message\": \"from MentDB\"}"
mentdb
{"uid": "mentdb-imports", "id": 3, "url": "/d/mentdb-imports/mentdb-imports", "version": 2, "status": "success"}

grafana dashboards <config>


Description

    Search the dashboards. Returns rows {uid, title, folder_uid, folder_title, tags, url, id}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
grafana dashboards "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}"
mentdb
[{"uid": "mentdb-imports", "title": "MentDB imports", "folder_uid": "mentdb-jobs", "folder_title": "MentDB jobs", "tags": ["mentdb", "v2"], "url": "/d/mentdb-imports/mentdb-imports", "id": 3}]

grafana dashboards <config> <options_json>


Description

    Search with options: query (in the title), tags (a text or an array: all are required), folder_uid, starred, limit (1000)

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    options_json:   The options - String - required
admin
grafana dashboards "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "{\"tags\": \"v2\", \"query\": \"imports\"}"
mentdb
[{"uid": "mentdb-imports", "title": "MentDB imports", "folder_uid": "mentdb-jobs", "folder_title": "MentDB jobs", "tags": ["mentdb", "v2"], "url": "/d/mentdb-imports/mentdb-imports", "id": 3}]

grafana dashboard_get <config> <uid>


Description

    A dashboard by uid: {meta, dashboard}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    uid:   The uid - String - required
admin
grafana dashboard_get "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "mentdb-imports"
mentdb
{"meta": {"type": "db", "canSave": true, "canEdit": true, "canAdmin": true, "canStar": true, "canDelete": true, "slug": "mentdb-imports", "url": "/d/mentdb-imports/mentdb-imports", "expires": "0001-01-01T00:00:00Z", "created": "2026-11-17T20:08:54+04:00", "updated": "2026-11-17T20:08:55+04:00", "updatedBy": "Anonymous", "createdBy": "Anonymous", "version": 2, "hasAcl": false, "isFolder": false, "folderId": 2, "folderUid": "mentdb-jobs", "folderTitle": "MentDB jobs", "folderUrl": "/dashboards/f/mentdb-jobs/mentdb-jobs", "provisioned": false, "provisionedExternalId": "", "annotationsPermissions": {"dashboard": {"canAdd": true, "canEdit": true, "canDelete": true}, "organization": {"canAdd": true, "canEdit": true, "canDelete": true}}}, "dashboard": {"id": 3, "panels": [{"datasource": {"uid": "prom-main"}, "gridPos": {"h": 8, "w": 24, "x": 0, "y": 0}, "id": 1, "targets": [{"expr": "import_rows", "refId": "A"}], "title": "Rows imported", "type": "timeseries"}], "tags": ["mentdb", "v2"], "title": "MentDB imports", "uid": "mentdb-imports", "version": 2}}

grafana annotation_create <config> <text>


Description

    Add an annotation now, to the whole organization. Returns {id}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    text:   The text of the annotation - String - required
admin
grafana annotation_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "Deploy of MentDB 4.2.4"
mentdb
{"id": 1}

grafana annotation_create <config> <text> <options_json>


Description

    Add an annotation with options: tags, time, time_end (a region), dashboard_uid and panel_id (only on that dashboard or panel)

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    text:   The text - String - required
    options_json:   The options - String - required
admin
grafana annotation_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "Nightly import: 1200 rows" "{\"tags\": [\"mentdb\", \"import\"], \"time\": \"2026-11-17T15:00:00Z\", \"time_end\": \"2026-11-17T15:03:00Z\"}"
mentdb
{"id": 2}
on a panel of a dashboard (fixed result: real Grafana OSS 11.3.0)
admin
grafana annotation_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "3 rows rejected" "{\"dashboard_uid\": \"mentdb-imports\", \"panel_id\": 1, \"time\": \"2026-11-17T15:02:00Z\", \"tags\": [\"import\"]}"
mentdb
{"id": 3}

grafana annotations <config>


Description

    The last 100 annotations. Returns rows {id, time, time_end, text, tags, dashboard_uid, panel_id, login}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
grafana annotations "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}"
mentdb
[{"id": 1, "time": "2026-11-17T16:08:58.881Z", "time_end": null, "text": "Deploy of MentDB 4.2.4", "tags": [], "dashboard_uid": null, "panel_id": null, "login": "sa-1-mentdb"}, {"id": 2, "time": "2026-11-17T15:00:00Z", "time_end": "2026-11-17T15:03:00Z", "text": "Nightly import: 1200 rows", "tags": ["mentdb", "import"], "dashboard_uid": null, "panel_id": null, "login": "sa-1-mentdb"}, {"id": 3, "time": "2026-11-17T15:02:00Z", "time_end": null, "text": "3 rows rejected", "tags": ["import"], "dashboard_uid": "mentdb-imports", "panel_id": 1, "login": "sa-1-mentdb"}]

grafana annotations <config> <options_json>


Description

    The annotations with options: from, to, tags (all required), dashboard_uid, limit (100), time_format

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    options_json:   The options - String - required
admin
grafana annotations "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "{\"tags\": \"import\", \"from\": \"2026-11-17T00:00:00Z\", \"to\": \"2026-11-18T00:00:00Z\", \"time_format\": \"unix_ms\"}"
mentdb
[{"id": 2, "time": 1794927600000, "time_end": 1794927780000, "text": "Nightly import: 1200 rows", "tags": ["mentdb", "import"], "dashboard_uid": null, "panel_id": null, "login": "sa-1-mentdb"}, {"id": 3, "time": 1794927720000, "time_end": null, "text": "3 rows rejected", "tags": ["import"], "dashboard_uid": "mentdb-imports", "panel_id": 1, "login": "sa-1-mentdb"}]

grafana annotation_delete <config> <id>


Description

    Delete an annotation by id. Returns {deleted}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    id:   The id - String - required
admin
grafana annotation_delete "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "1"
mentdb
{"deleted": 1}

grafana alert_rules <config>


Description

    The Grafana alert rules (provisioning API). Returns rows {uid, title, folder_uid, rule_group, condition, for, is_paused, no_data_state, exec_err_state, labels, annotations}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
grafana alert_rules "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}"
mentdb
[{"uid": "fg4l6r1i80vlsa", "title": "Import too slow", "folder_uid": "mentdb-jobs", "rule_group": "mentdb", "condition": "C", "for": "5m", "is_paused": false, "no_data_state": "OK", "exec_err_state": "Error", "labels": {"team": "data"}, "annotations": {"summary": "The nightly import took more than 10 minutes"}}]

grafana users <config>


Description

    The users of the current organization. Returns rows {user_id, login, email, name, role, last_seen_at}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
grafana users "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}"
mentdb
[{"user_id": 1, "login": "admin", "email": "admin@localhost", "name": "", "role": "Admin", "last_seen_at": "2026-11-17T20:07:18+04:00"}]

grafana orgs <config>


Description

    The organizations (needs a Grafana server administrator). Returns rows {id, name}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
admin
grafana orgs "{\"url\": \"http://127.0.0.1:3000\", \"username\": \"admin\", \"password\": \"grafana_password\"}"
mentdb
[{"id": 1, "name": "Main Org."}]
a service account token is refused (fixed result: real Grafana OSS 11.3.0)
admin
grafana orgs "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}"
mentdb
ERROR: Sorry, an error appears (Grafana error HTTP 403 (authentication or permission refused): You'll need additional permissions to perform this action. Permissions needed: orgs:read).

grafana dashboard_delete <config> <uid>


Description

    Delete a dashboard by uid. Returns {deleted, title}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    uid:   The uid - String - required
admin
grafana dashboard_delete "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "mentdb-imports"
mentdb
{"deleted": "mentdb-imports", "title": "MentDB imports"}

grafana folder_delete <config> <uid>


Description

    Delete a folder and its dashboards. Returns {deleted}

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    uid:   The uid - String - required
admin
grafana folder_delete "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "mentdb-jobs"
mentdb
{"deleted": "mentdb-jobs"}

grafana request <config> <method> <path>


Description

    Any request to the API (path under the url, with its query string). Returns the answer text

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    method:   The HTTP method - String - required
    path:   The path - String - required
admin
grafana request "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "GET" "/api/v1/provisioning/contact-points"
mentdb
[{"uid":"","name":"email receiver","type":"email","settings":{"addresses":"\u003cexample@email.com\u003e"},"disableResolveMessage":false}]

grafana request <config> <method> <path> <body_json>


Description

    Any request with a JSON body

Parameters

    config:   The configuration as JSON: url (http://127.0.0.1:3000, or https://grafana.example.com with its sub path if any), token (a service account token, the normal way), or username with password (basic authentication), org_id (the organization, header X-Grafana-Org-Id), timeout_ms (30000: the longest silence of the server; a whole answer must arrive within 10 x timeout_ms), max_bytes (64 MB, 256 MB at most: the largest answer read), ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is this machine) - String - required
    method:   The HTTP method - String - required
    path:   The path - String - required
    body_json:   The JSON body - String - required
admin
grafana request "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"grafana_token\"}" "POST" "/api/teams" "{\"name\": \"Data team\"}"
mentdb
{"message":"Team created","teamId":1,"uid":"dg4l6rc3bj6rka"}