---
title: "Star or unstar a query history entry"
method: PATCH
path: "/api/{org_id}/query_history/{id}"
tags: ["Query History"]
---

# Star or unstar a query history entry

`PATCH /api/{org_id}/query_history/{id}`

## Request

- Base URL: `https://api.openobserve.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.openobserve.ai/api/{org_id}/query_history/{id}`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/:org_id/query_history/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Starred entries are kept until deleted. A user can star at most 200 entries per organization, shared across every source (logs, traces, metrics, dbm, profiles).

## Path parameters

- `org_id` string, required
- `id` string, required

## Request body

- QueryHistoryStarRequest
  - `starred` boolean, required: `true` stars the entry, `false` unstars it.

## Response `200`

Success

- QueryHistoryEntry
  - `context` unknown, required
  - `created_at` integer, required: First run, in microseconds since the epoch; the last run on entries recorded by v1.1.x.
  - `id` string, required: Entry id.
  - `query` string, required: The query text.
  - `query_key` string, nullable: Hex sha256 of the merge key; null on entries recorded before keys existed.
  - `run_count` integer, required: How many runs merged into this entry; 1 on entries recorded by v1.1.x.
  - `source` string, required: Page the query ran on.
  - `starred` boolean, required: Starred entries are kept until deleted.
  - `status` string, required: `ok` or `error`, from the latest run; `ok` on entries recorded by v1.1.x.
  - `streams` string[], required: Streams the query ran on.
  - `updated_at` integer, required: Latest run, in microseconds since the epoch.

## Other responses

- `400`: Starred entry limit reached
- `404`: Not found
- `413`: Request body larger than 128 KB
- `500`: Failure

---

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