---
title: "Apply run outputs to project"
method: POST
path: "/api/v1/runs/{run_id}/apply-to-project"
tags: ["Runs"]
---

# Apply run outputs to project

`POST /api/v1/runs/{run_id}/apply-to-project`

## Request

- Base URL: `https://api.studio.kaitoi.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.studio.kaitoi.io/api/v1/runs/{run_id}/apply-to-project`
- Auth: HTTP bearer

Persists outputs from a succeeded saved-project run back into that saved project. This is the public API equivalent of saving the server-owned run result state after execution; it does not accept client-supplied output values. The request uses optimistic concurrency and fails if the project changed after the run was created.

## Path parameters

- `run_id` string, required

## Headers

- `Idempotency-Key` string, nullable
- `authorization` string, nullable

## Request body

- PublicRunApplyOutputsRequest
  - `expectedVersion` integer, required: Project version the run was created from. Applying outputs fails if the saved project changed after the run was created.
  - `outputKeys` string[], nullable: Optional subset of run output keys to persist. Omit to apply all outputs recorded on the succeeded saved-project run.

## Response `200`

Project version and output keys that were applied.

- PublicRunApplyOutputsResponse
  - `runId` string, required
  - `projectId` string, required
  - `version` integer, required: New saved project version after applying outputs.
  - `appliedOutputs` integer, required: Number of run outputs applied to the project.
  - `outputKeys` string[], required: Run output keys applied to the saved project.

## Other responses

- `400`: The output selection is invalid.
- `401`: Missing, malformed, expired, or revoked bearer token.
- `403`: The API key lacks the required scope or account capability.
- `404`: The run, project, or run output file was not found.
- `409`: The run is not applicable or the project version is stale.
- `422`: Validation Error
- `429`: The client or API key exceeded the REST API rate limit.
- `503`: The shared REST API rate limiter is temporarily unavailable.

---

[API](https://skmtc.dev/kaitoi/apis/kaitoi-rest-api.md) · [All operations](https://skmtc.dev/kaitoi/apis/kaitoi-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kaitoi/apis/kaitoi-rest-api/revisions/239a74aa2c64?raw)
