---
title: "Improve evaluator scenarios"
method: POST
path: "/ai/tests/test_framework/v1/scenarios/scenario-agent"
tags: ["AI Tests"]
---

# Improve evaluator scenarios

`POST /ai/tests/test_framework/v1/scenarios/scenario-agent`

## Request

- Base URL: `https://api.telnyx.com/v2`
- URL: `https://api.telnyx.com/v2/ai/tests/test_framework/v1/scenarios/scenario-agent`
- Auth: HTTP bearer

Starts an interactive session that improves selected evaluator scenarios from a natural-language instruction. Returns a progress ID to poll with the improve-scenarios-progress endpoint.

## Request body

- ImproveScenariosRequest
  - `user_message` string, required: What the assistant should improve about the selected scenarios.
  - `scenarios` union, required: Scenario IDs to improve, or the literal string 'all'.
    - unknown[]
      - unknown
    - string
  - `agent_id` integer, nullable
  - `session_id` integer, nullable
  - `context` object[], nullable
    - `role` string
    - `content` string
    - `timestamp` string
  - `apply_changes` boolean
  - `updated_scenarios` object[]
  - `num_scenarios` integer
  - `knowledge_base` integer[]
  - `agent_resolution_response` string
  - `scenarios_needing_agent` integer[]
  - `pending_tool_calls` object[], nullable

## Response `200`

Improvement session initiated.

- ImproveScenariosResponse
  - `progress_id` string, required
  - `session_id` integer, nullable

## Other responses

- `400`: Bad Request. The AI Tests service rejected the request.
- `401`: Unauthorized. Missing or invalid API key.
- `404`: Not Found. The requested resource does not exist or is not enabled for your account.
- `422`: Unprocessable Entity. A validation error occurred.
- `429`: Too Many Requests. The AI Tests service rate-limited the request.
- `503`: Service Unavailable. The AI Tests service is unavailable.

## Changes

> 152 revisions in range; 1 not diffed.

- **2026-10-22** `09b2e45a88da`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/team-telnyx/apis/telnyx-api-2/changes/ai/tests/test_framework/v1/scenarios/scenario-agent/post.md)

---

[API](https://skmtc.dev/team-telnyx/apis/telnyx-api-2.md) - [All operations](https://skmtc.dev/team-telnyx/apis/telnyx-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/team-telnyx/apis/telnyx-api-2/revisions/f82938f53ff4?raw)
