# Edit Simple Query

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

`PUT /simple/queries/{query_id}`

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`.

Edit Simple Query

## Parameters

- `query_id` (in path, string (uuid), required)

## Request body schema

Content type: `application/json` (required)

- `query` (object, required)
  - `name` (string, nullable)
  - `description` (string, nullable)
  - `id` (string (uuid), nullable)
  - `flags` (object, nullable)
  - `tags` (object, nullable)
  - `meta` (object, nullable)
  - `data` (object, nullable)
    - `formatting` (object, nullable)
      - `focus` (string, one of: "trace", "span", nullable)
      - `format` (string, one of: "agenta", "opentelemetry", nullable)
    - `filtering` (object, nullable)
      - `operator` (string, one of: "and", "or", "not", "nand", "nor") Default: `"and"`.
      - `conditions` (array of object | Filtering (recursive)) Default: `[]`.
    - `windowing` (object, nullable)
      - `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)
    - `trace_ids` (array of string, nullable)
    - `traces` (array of object, nullable)
      - `spans` (object, nullable)
      - `trace_id` (string, nullable)
- … more fields: see the OpenAPI specification.

## Response schemas

### 200: Successful Response

- `count` (integer) Default: `0`.
- `query` (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)
  - `flags` (object, nullable)
  - `tags` (object, nullable)
  - `meta` (object, nullable)
  - `data` (object, nullable)
    - `formatting` (object, nullable)
    - `filtering` (object, nullable)
    - `windowing` (object, nullable)
    - `trace_ids` (array of string, nullable)
    - `traces` (array of object, nullable)
  - `variant_id` (string (uuid), nullable)
  - `revision_id` (string (uuid), 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)
