---
title: "Query Logs Post"
method: POST
path: "/v0/logs/query"
tags: ["Logs"]
---

# Query Logs Post

`POST /v0/logs/query`

Query logs via POST request.

This endpoint accepts the exact same parameters as GET /logs, but via request body
instead of query parameters. This is useful for:
- Large filter expressions that would exceed URL length limits
- Filter expressions containing base64-encoded images (e.g., embed_image('data:image/png;base64,...'))
- Complex sorting expressions

Example with image embedding:
```json
{
    "project_name": "my-project",
    "filter_expr": "cosine(image_embedding, embed_image('data:image/png;base64,iVBORw0KG...')) < 0.3",
    "limit": 10
}
```

## Request body

- QueryLogsPostBody — Request body for POST /logs/query endpoint. Accepts the same parameters as GET /logs, but via request body instead of query parameters. This is useful for queries with large filter expressions or base64-encoded images that would exceed URL length limits. Example with image embedding: ```json { "project_name": "my-project", "filter_expr": "cosine(image_embedding, embed_image('data:image/png;base64,iVBORw0KG...')) < 0.3" } ```
  - `project_name` string, required — Project name
  - `context` string, nullable — Context name
  - `column_context` string, nullable — The context (prepending '/' seperated field names) from which to retrieve the logs.
  - `filter_expr` string, nullable — Boolean string to filter entries. Supports embed_image() for image similarity queries.
  - `sorting` string, nullable — JSON-encoded dict mapping either static column names (e.g. `timestamp`) or full Python2SQL expressions (e.g. `cosine(embed('search text'), embedding_vector)`) to sort directions (`"ascending"` or `"descending"`). The first key is the primary sort field; subsequent keys break ties.
  - `group_sorting` string, nullable — Sorting configuration for groups when using group_by
  - `from_ids` string, nullable — Log IDs to include
  - `exclude_ids` string, nullable — Log IDs to exclude
  - `from_fields` string, nullable — Fields to include
  - `exclude_fields` string, nullable — Fields to exclude
  - `limit` integer, nullable
  - `offset` integer
  - `group_by` string[], nullable — Fields to group by
  - `group_limit` integer, nullable — Maximum number of groups to return at each level
  - `group_offset` integer — Number of groups to skip at each level
  - `group_depth` integer, nullable — Maximum depth of nested groups to return
  - `nested_groups` boolean — If True, groups are returned as a nested structure
  - `groups_only` boolean — If True, only return groups without full logs list
  - `return_timestamps` boolean — When groups_only is True, return timestamps with log IDs
  - `return_ids_only` boolean — If True, return only log IDs instead of full entries
  - `randomize` boolean — If true, return logs in a deterministic random order
  - `seed` string, nullable — Seed for deterministic random ordering
  - `value_limit` integer, nullable — Maximum number of characters to return for string values
  - `group_threshold` integer, nullable — When set, entries that appear in at least this many logs will be grouped together

## Response `200`

Successful Response

- unknown

## Other responses

- `404` — Project Not Found
- `422` — Validation Error

---

[API](https://skmtc.net/unify/apis/unifyai-http-api-reference.md) · [All operations](https://skmtc.net/unify/apis/unifyai-http-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/unify/unifyai-http-api-reference/revisions/900377f918b6/schema)
