---
title: "A run started with an API key finished a turn"
method: POST
path: "runFinished"
tags: ["Webhooks"]
---

# A run started with an API key finished a turn

`POST runFinished` (webhook)

Sent to the `webhook_url` set on the API key that started the run (PATCH /o/{org}/api-keys/{key}), within about 30 seconds of a turn finishing: one per turn of a resumable run. Signed per Standard Webhooks with the key's `whsec_` secret. Any 2xx within 5 seconds acknowledges it; anything else is retried 2, 4 and 6 minutes after the first attempt with the same `webhook-id`, then dropped. Revoking the key or clearing its webhook drops pending retries.

## Headers

- `webhook-id` string, required
- `webhook-timestamp` string, required
- `webhook-signature` string, required

## Payload

- object
  - `type` 'run.completed' | 'run.failed' | 'run.cancelled', required
  - `timestamp` string, date-time, required: When the turn finished.
  - `data` object, required
    - `execution_id` string, required
    - `org_id` string, required
    - `project_id` string, uuid: The Project the console ran the session in; absent for none.
    - `status` string, required: completed, needs_review, failed or cancelled.
    - `result` string: The turn's final answer; absent when there is none or it is over 16 KiB (GET session_url).
    - `total_cost_usd` number
    - `session_url` string, uri, required: The session, with its full answer and artifacts.
    - `events_url` string, uri, required

## Acknowledgement `200`

Any 2xx acknowledges the delivery.

---

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