---
title: "Submit a turn to an API-chat run"
method: POST
path: "/test_framework/v1/runs/{id}/chat/"
tags: ["Runs"]
---

# Submit a turn to an API-chat run

`POST /test_framework/v1/runs/{id}/chat/`

## Request

- Base URL: `https://api.cekura.ai`
- URL: `https://api.cekura.ai/test_framework/v1/runs/{id}/chat/`
- Auth: one of:
  - API key in header `X-CEKURA-API-KEY`
  - HTTP bearer
  - HTTP bearer
  - API key in header `X-VOCERA-SHAREABLE-LINK-TOKEN`
  - HTTP bearer

Submit your agent-under-test's latest message on a customer-driven (API chat) run. The simulated user's reply is generated in the background — the response returns a `turn_id` immediately; poll GET /runs/{run_id}/chat/{turn_id}/ until its `status` is `ready` to read the reply, then submit the next turn. Submitting a new turn while one is still generating interrupts it: the older turn is marked `dropped` but its message is kept, and the newest turn's reply answers all messages received since the last reply. Repeat until `ended` is true (or call end-chat).

## Path parameters

- `id` integer, required

## Request body

- ApiChatTurn: Request body for POST /runs/{run_id}/chat/ (submit one turn). Same message shape as the websocket chat integration: a normal message (`content`), optional `metadata` merged into the run, and/or a function call (`role` + `data`).
  - `content` string: Your agent-under-test's latest message. Submitting it returns a `turn_id`; poll GET /runs/{run_id}/chat/{turn_id}/ for the simulated user's reply.
  - `metadata` object: Optional metadata merged into the run (last-write-wins). Can be sent alone.
  - `role` 'Function Call' | 'Function Call Result': Set to record a tool call instead of a message (no reply is generated). * `Function Call` - Function Call * `Function Call Result` - Function Call Result
  - `data` object: Function-call payload: {id, name, arguments} for a call, {id, result} for a result.

## Response `202`

- ApiChatTurnSubmitResponse: Response for POST /runs/{run_id}/chat/ (turn accepted).
  - `run_id` integer, required
  - `result_id` integer, required
  - `turn_id` integer, required: Poll this turn for the simulated user's reply.
  - `status` string, required: Turn status; poll for the reply if 'generating'.

## Other responses

- `409`: Run is still starting, or has already ended.

## Changes

- **2026-11-03** `a6fb6a739212`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cekura/apis/cekura-api/changes/test_framework/v1/runs/:id/chat/post.md)

---

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