# Query Folders

Source: https://agenta.ai/docs/reference/api/query-folders

`POST /folders/query`

Base URL: `https://us.cloud.agenta.ai/api` (US cloud), `https://eu.cloud.agenta.ai/api` (EU cloud) or `$AGENTA_HOST/api` (self-hosted). Authentication: `Authorization: ApiKey YOUR_API_KEY`.

Filter folders inside the caller's project.

Follows the general response envelope described in the
[Query Pattern](https://agenta.ai/docs/reference/api-guide/query-pattern.md) guide, but
does not accept `windowing` or `include_archived` — folders are
hard-deleted and the response always returns the full filtered
set. Filters include `id`/`ids`, `slug`/`slugs`, `kind`/`kinds`,
`parent_id`/`parent_ids` (use `parent_id: null` for root folders),
`path`/`paths`, and `prefix`/`prefixes` for subtree lookup.

## Request body schema

Content type: `application/json` (required)

- `folder` (object, required): Filter object. Any combination of `id`/`ids`, `slug`/`slugs`, `kind`/`kinds`, `parent_id`/`parent_ids`, `path`/`paths`, and `prefix`/`prefixes` narrows the result.
  - `flags` (object, nullable)
  - `tags` (object, nullable)
  - `meta` (object, nullable)
  - `name` (string, nullable)
  - `description` (string, nullable)
  - `id` (string (uuid), nullable): Match a single folder id.
  - `ids` (array of string (uuid), nullable): Match any of the given folder ids.
  - `slug` (string, nullable): Match a folder by slug, regardless of its position in the tree.
  - `slugs` (array of string, nullable): Match folders whose slug is in the given list.
  - `kind` (string, one of: "applications", nullable): Match folders of a single resource family.
  - `kinds` (boolean | array of string, one of: "applications", nullable): Filter by presence of a kind. `false` returns folders with no kind, `true` returns folders where `kind` is set, and an array restricts to the given kinds.
  - `parent_id` (string (uuid), nullable): Match folders whose parent is this id. Send `null` to return only root folders.
  - `parent_ids` (array of string (uuid), nullable): Match folders whose parent is any of the given ids.
  - `path` (string, nullable): Exact match on the materialized `path` (e.g. `support.prod`).
  - `paths` (array of string, nullable): Exact match on any of the given paths.
  - `prefix` (string, nullable): Subtree lookup: returns the folder at this path and every descendant.
  - `prefixes` (array of string, nullable): Subtree lookup across multiple prefixes, OR-ed together.

## Response schemas

### 200: Successful Response

- `count` (integer): Number of folders in `folders`. Default: `0`.
- `folders` (array of object): Matching folders for the query. Ordering is not guaranteed.
  - `flags` (object, nullable)
  - `tags` (object, nullable)
  - `meta` (object, nullable)
  - `name` (string, nullable)
  - `description` (string, nullable)
  - `created_at` (string (date-time), nullable)
  - `updated_at` (string (date-time), nullable)
  - `deleted_at` (string (date-time), nullable)
  - `created_by_id` (string (uuid), nullable)
  - `updated_by_id` (string (uuid), nullable)
  - `deleted_by_id` (string (uuid), nullable)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)
  - `kind` (string, one of: "applications", nullable): Resource family this folder organizes. Only `applications` is defined today, and it also covers workflows, evaluators, and testsets (they share the artifact table).
  - `path` (string, nullable): Dot-separated materialized path built from the folder's slug and its ancestors' slugs. Read-only; derived by the server.
  - `parent_id` (string (uuid), nullable): Id of the parent folder, or `null` for a root folder.

### 422: Validation Error

- `detail` (array of object)
  - `loc` (array of string | integer, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (Context)
