---
title: "Update comment for query in query history."
method: PATCH
path: "/query-history/{query_history_uid}"
tags: ["query_history"]
---

# Update comment for query in query history.

`PATCH /query-history/{query_history_uid}`

## Request

- Base URL: `/api` (relative, and the document’s source URL is not known)
- URL: `/api/query-history/{query_history_uid}`
- Auth: one of:
  - HTTP basic
  - API key in header `Authorization`

Updates comment for query in query history as specified by the UID.

## Path parameters

- `query_history_uid` string, required

## Request body

- PatchQueryCommentInQueryHistoryCommand: PatchQueryCommentInQueryHistoryCommand is the command for updating comment for query in query history
  - `comment` string: Updated comment

## Response `200`

(empty)

- QueryHistoryResponse: QueryHistoryResponse is a response struct for QueryHistoryDTO
  - `result` QueryHistoryDTO
    - `comment` string
    - `createdAt` integer
    - `createdBy` integer
    - `datasourceUid` string
    - `queries` Json
    - `starred` boolean
    - `uid` string

## Other responses

- `400`: BadRequestError is returned when the request is invalid and it cannot be processed.
- `401`: UnauthorizedError is returned when the request is not authenticated.
- `500`: InternalServerError is a general error indicating something went wrong internally.

---

[API](https://skmtc.dev/grafana/apis/grafana-http-api.md) - [All operations](https://skmtc.dev/grafana/apis/grafana-http-api/llms.txt) - [OpenAPI document](https://skmtc.dev/grafana/apis/grafana-http-api/revisions/df55ba1718ba?raw)
