# Query Workflow Revisions

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

`POST /workflows/revisions/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`.

Query Workflow Revisions

## Parameters

- `workflow_id` (in query, string (uuid))
- `workflow_ids` (in query, array of string (uuid))
- `workflow_slug` (in query, string)
- `workflow_slugs` (in query, array of string)
- `workflow_variant_id` (in query, string (uuid))
- `workflow_variant_ids` (in query, array of string (uuid))
- `workflow_variant_slug` (in query, string)
- `workflow_variant_slugs` (in query, array of string)
- `workflow_revision_id` (in query, string (uuid))
- `workflow_revision_ids` (in query, array of string (uuid))
- `workflow_revision_slug` (in query, string)
- `workflow_revision_slugs` (in query, array of string)
- `workflow_revision_version` (in query, string)
- `workflow_revision_versions` (in query, array of string)
- `name` (in query, string)
- `description` (in query, string)
- `flags` (in query, string)
- `tags` (in query, string)
- `meta` (in query, string)
- `include_archived` (in query, boolean)
- `include_data` (in query, boolean)
- `next` (in query, string (uuid))
- `newest` (in query, string (date-time))
- `oldest` (in query, string (date-time))
- `limit` (in query, integer)
- `order` (in query, string, one of: "ascending", "descending")

## Request body schema

Content type: `application/json`

- `workflow_revision` (object, nullable): Attribute filter on workflow revisions.
  - `flags` (object, nullable)
    - `is_application` (boolean, nullable)
    - `is_evaluator` (boolean, nullable)
    - `is_snippet` (boolean, nullable)
    - `is_managed` (boolean, nullable)
    - `is_custom` (boolean, nullable)
    - `is_llm` (boolean, nullable)
    - `is_hook` (boolean, nullable)
    - `is_code` (boolean, nullable)
    - `is_match` (boolean, nullable)
    - `is_feedback` (boolean, nullable)
    - `is_agent` (boolean, nullable)
    - `is_skill` (boolean, nullable)
    - `is_chat` (boolean, nullable)
    - `has_url` (boolean, nullable)
    - `has_script` (boolean, nullable)
    - `has_handler` (boolean, nullable)
    - `is_static` (boolean, nullable)
  - `tags` (object, nullable)
  - `meta` (object, nullable)
  - `name` (string, nullable)
  - `description` (string, nullable)
  - `slug` (string, nullable)
  - `slugs` (array of string, nullable)
  - `author` (string (uuid), nullable)
  - `authors` (array of string (uuid), nullable)
  - `date` (string (date-time), nullable)
  - `dates` (array of string (date-time), nullable)
  - `message` (string, nullable)
- `workflow_refs` (array of object, nullable): Scope revisions to workflows matching these references.
  - `version` (string, nullable)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)
- `workflow_variant_refs` (array of object, nullable): Scope revisions to variants matching these references.
  - `version` (string, nullable)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)
- `workflow_revision_refs` (array of object, nullable): Restrict results to revisions matching these references (supports `version`).
  - `version` (string, nullable)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)
- `include_archived` (boolean, nullable): When true, include archived revisions.
- `include_data` (boolean, nullable): When false, omit each revision's `data` from the response.
- `grouping` (object, nullable): Divide matching revisions by artifact or variant and select one revision from each group.
  - `by` (string, one of: "artifact", "variant", required)
  - `get` (string, required)
- `windowing` (object, nullable): Cursor-based pagination controls.
  - `newest` (string (date-time), nullable)
  - `oldest` (string (date-time), nullable)
  - `next` (string (uuid), nullable)
  - `limit` (integer, nullable)
  - `order` (string, one of: "ascending", "descending", nullable)
  - `interval` (integer, nullable)
  - `rate` (number, nullable)

## Response schemas

### 200: Successful Response

- `count` (integer): Number of revisions in this page. Default: `0`.
- `workflow_revisions` (array of object): Workflow revisions matching the query, ordered by commit time.
  - `workflow_variant_slug` (string, nullable)
  - `variant_slug` (string, nullable)
  - `workflow_slug` (string, nullable)
  - `artifact_slug` (string, nullable)
  - `workflow_variant_id` (string (uuid), nullable)
  - `variant_id` (string (uuid), nullable)
  - `workflow_id` (string (uuid), nullable)
  - `artifact_id` (string (uuid), nullable)
  - `author` (string (uuid), nullable)
  - `date` (string (date-time), nullable)
  - `message` (string, nullable)
  - `flags` (object, nullable)
    - `is_application` (boolean) Default: `false`.
    - `is_evaluator` (boolean) Default: `false`.
    - `is_snippet` (boolean) Default: `false`.
    - `is_managed` (boolean) Default: `false`.
    - `is_custom` (boolean) Default: `false`.
    - `is_llm` (boolean) Default: `false`.
    - `is_hook` (boolean) Default: `false`.
    - `is_code` (boolean) Default: `false`.
    - `is_match` (boolean) Default: `false`.
    - `is_feedback` (boolean) Default: `false`.
    - `is_agent` (boolean) Default: `false`.
    - `is_skill` (boolean) Default: `false`.
    - `is_chat` (boolean) Default: `false`.
    - `has_url` (boolean) Default: `false`.
    - `has_script` (boolean) Default: `false`.
    - `has_handler` (boolean) Default: `false`.
    - `is_static` (boolean) Default: `false`.
  - `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)
  - `version` (string, nullable)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)
  - `data` (object, nullable)
    - `uri` (string, nullable)
    - `url` (string, nullable)
    - `headers` (object, nullable)
    - `runtime` (string, one of: "python", "typescript", "javascript", nullable)
    - `script` (string, nullable)
    - `schemas` (object, nullable)
    - `parameters` (object, nullable)
- `windowing` (object, nullable): Pagination cursor.
  - `newest` (string (date-time), nullable)
  - `oldest` (string (date-time), nullable)
  - `next` (string (uuid), nullable)
  - `limit` (integer, nullable)
  - `order` (string, one of: "ascending", "descending", nullable)
  - `interval` (integer, nullable)
  - `rate` (number, nullable)
- … more fields: see the OpenAPI specification.

### 422: Validation Error

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