---
title: "Complete Run"
method: POST
path: "/auto-agent/run/{run_id}/complete"
tags: ["auto-agent"]
---

# Complete Run

`POST /auto-agent/run/{run_id}/complete`

Sandbox completion callback — called by the Modal agent when it finishes.

Validates the one-time callback token, writes results to the DB, and clears
the token. No user auth required — the token IS the auth.

Args:
    run_id: Run UUID from the path.
    body: JSON payload with deliverables_json, final_report, curation_report,
          tool_calls_made, message_history, error_message.
    callback_token: One-time token issued at run creation (X-Callback-Token header).

Raises:
    HTTPException 401: Token invalid or already used.
    HTTPException 404: Run not found.
    HTTPException 400: Validation error.

## Path parameters

- `run_id` string, required

## Headers

- `X-Callback-Token` string, required

## Request body

- object

## Response `204`

Successful Response

## Other responses

- `422` — Validation Error

---

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