> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lehar.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update test suite

> Partially updates a test suite — send only `name`, `scenarios`, and/or `config` to change. Omitted fields are left untouched. Scope `sessions:write`.



## OpenAPI

````yaml /api-reference/openapi.json patch /agent-test-suites/{suite_id}
openapi: 3.1.0
info:
  title: Lehar API
  version: v0
  description: >-
    Customer-facing REST API for the Lehar voice-AI platform. Platform-admin
    endpoints are intentionally excluded from this reference. Regenerate with
    `npm run sync:openapi`.
servers:
  - url: https://api.lehar.ai/ca/api/v0
security:
  - ApiKeyAuth: []
  - BearerAuth: []
paths:
  /agent-test-suites/{suite_id}:
    patch:
      tags:
        - Agent Testing
      summary: Update test suite
      description: >-
        Partially updates a test suite — send only `name`, `scenarios`, and/or
        `config` to change. Omitted fields are left untouched. Scope
        `sessions:write`.
      operationId: update_suite_ca_api_v0_agent_test_suites__suite_id__patch
      parameters:
        - name: suite_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 200
                  description: >-
                    New name; if present must be a non-empty string of at most
                    200 chars.
                scenarios:
                  type: array
                  maxItems: 100
                  description: >-
                    Replacement scenarios list (same item shape as Create test
                    suite).
                  items:
                    type: object
                config:
                  type: object
                  description: Replacement config object (same shape as Create test suite).
            example:
              name: Renewal objections (v2)
              config:
                max_parallel: 4
      responses:
        '200':
          description: Updated test suite
          content:
            application/json:
              example:
                id: test_suite_01hzy8x2m4q7r8s9t0v1w2x3y4
                agent_id: agent_sales_hi
                name: Renewal objections (v2)
                scenarios:
                  - label: Price objection
                    instructions: >-
                      You are a budget-conscious customer who thinks the renewal
                      price is too high.
                    runs: 2
                    max_turns: 8
                config:
                  judges:
                    - task_completion
                    - safety
                  variables:
                    company: Acme
                  max_parallel: 4
                created_by_user_id: user_01EXAMPLE
                created_at: '2026-05-22T10:00:00Z'
                updated_at: '2026-05-22T10:20:00Z'
        '400':
          description: >-
            Validation failed — e.g. empty/oversized `name`, `scenarios` not a
            valid list, a scenario `runs`/`max_turns` out of range, invalid
            `variables`, or `config` not an object.
          content:
            application/json:
              example:
                error:
                  code: invalid_request
                  message: name must be a non-empty string
        '401':
          description: Missing or invalid credentials (code `unauthorized`).
        '403':
          description: >-
            The credential is missing the required `sessions:write` scope (code
            `forbidden`).
        '404':
          description: No suite with this id in the workspace.
          content:
            application/json:
              example:
                error:
                  code: not_found
                  message: Test suite not found
        '409':
          description: Another suite already uses the requested name.
          content:
            application/json:
              example:
                error:
                  code: conflict
                  message: A test suite with that name already exists in this workspace
        '500':
          description: Unexpected server error (code `internal_error`).
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
    BearerAuth:
      type: http
      scheme: bearer

````