---
title: "Update project timeline"
method: PUT
path: "/api/v1/projects/{project_id}/timeline"
tags: ["Timelines"]
---

# Update project timeline

`PUT /api/v1/projects/{project_id}/timeline`

## 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/projects/{project_id}/timeline`
- Auth: HTTP bearer

Replaces a saved project's active timeline with a Kaitoi Timeline Document v1 using optimistic concurrency. Use Idempotency-Key so network retries can replay the saved response. This replaces the whole project timeline; if the project currently has multiple timeline scenes, they are collapsed to the single timeline contained in the document.

## Path parameters

- `project_id` string, required

## Headers

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

## Request body

- PublicProjectTimelineReplaceRequest
  - `expectedVersion` integer, required: Last project version observed by the client.
  - `document` object, required: Kaitoi Timeline Document v1 JSON to apply.

## Response `200`

Saved project timeline document and summary.

- PublicProjectTimelineApplyResponse
  - `projectId` string, required: Stable project identifier.
  - `version` integer, required: New optimistic concurrency version after the write.
  - `mode` 'replace', required: Apply mode used for this write.
  - `document` object, required: Resulting project timeline exported as Kaitoi Timeline Document v1.
  - `summary` PublicTimelineSummary, required
    - `trackCount` integer, required: Number of tracks in the timeline.
    - `clipCount` integer, required: Number of clips in the timeline.
    - `durationSeconds` number, required: Timeline project duration in seconds.

## Other responses

- `400`: The timeline document is invalid.
- `401`: Missing, malformed, expired, or revoked bearer token.
- `403`: The API key lacks the required scope or account capability.
- `404`: Project not found.
- `409`: The expected 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)
