---
title: "Complete Turn"
method: POST
path: "/sessions/turns/complete"
tags: ["Sessions"]
---

# Complete Turn

`POST /sessions/turns/complete`

## Request body

- SessionTurnCompleteRequest
  - `session_id` string, required
  - `turn_index` integer, required
  - `agent_session_id` string, nullable
  - `end_time` string, date-time, required

## Response `200`

Successful Response

- SessionTurnResponse
  - `count` integer
  - `turn` SessionTurn
    - `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
    - `id` string, uuid, nullable
    - `project_id` string, uuid, required
    - `session_id` string, required
    - `turn_id` string, uuid, nullable
    - `stream_id` string, uuid, required
    - `turn_index` integer, required
    - `harness_kind` 'pi_core' | 'claude' | 'pi_agenta' | 'codex', required — The coding agent program a run drives. A backend declares which it supports. ``pi_core`` is plain Pi; ``pi_agenta`` is Pi with Agenta's forced skills, prompt, and policy. Both drive the same ``pi`` ACP agent in the runner; ``claude`` drives Claude Code.
    - `agent_session_id` string, nullable
    - `sandbox_id` string, nullable
    - `references` Reference[], nullable
      - `version` string, nullable
      - `slug` string, nullable
      - `id` string, uuid, nullable
    - `trace_id` string, uuid, nullable
    - `span_id` string, nullable
    - `start_time` string, date-time, nullable
    - `end_time` string, date-time, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/agenta-ai/apis/agenta-api.md) · [All operations](https://skmtc.net/agenta-ai/apis/agenta-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/agenta-ai/agenta-api/versions/ea6421d829f1/schema)
