---
title: "Query raw general-ledger entries with filters: version, period, entity, business unit, account prefix (e.g"
method: POST
path: "/api/v1/query_gl"
---

# Query raw general-ledger entries with filters: version, period, entity, business unit, account prefix (e.g

`POST /api/v1/query_gl`

## Request

- Base URL: `https://k-phi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://k-phi.com/api/v1/query_gl`
- Auth: HTTP bearer

Query raw general-ledger entries with filters: version, period, entity, business unit, account prefix (e.g. "411" for all AR accounts under French PCG), and free-text search on the entry description. Returns matching rows (capped by limit, default 100, max 500) plus aggregates (total count, sum of debits and credits) computed over ALL matches, not just the returned page.

## Request body

- object
  - `version` string: GL version label (e.g. "2026-06"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one.
  - `period` string: Filter to a single period (YYYY-MM). Omit to include all periods in the version.
  - `entity` string: Filter to a single entity code. Omit for consolidated view across all entities.
  - `bu` string: Filter to a single business unit. Omit for all BUs.
  - `acct_prefix` string: Account number prefix filter, e.g. "411" or "70".
  - `search` string: Case-insensitive substring match on the entry description.
  - `limit` integer: Max rows to return (default 100, max 500).

## Response `200`

OK

- object
  - `data` object
  - `meta` object
    - `api` string
    - `capability` string
    - `at` string

## Other responses

- `401`: No or invalid credential
- `403`: Scope, extension or Builder Mode refused
- `422`: The capability refused the input
- `429`: Rate or daily quota reached

---

[API](https://skmtc.dev/k-phi/apis/k-api.md) · [All operations](https://skmtc.dev/k-phi/apis/k-api/llms.txt) · [OpenAPI document](https://skmtc.dev/k-phi/apis/k-api/revisions/60b28690ec35?raw)
