---
title: "Save a revision of a Remotion source tree"
method: PUT
path: "/projects/{projectId}/source"
tags: ["Creative Source"]
---

# Save a revision of a Remotion source tree

`PUT /projects/{projectId}/source`

## Request

- Base URL: `https://blitzreels.com/api/v1`
- URL: `https://blitzreels.com/api/v1/projects/{projectId}/source`
- Auth: API key in header `Authorization`

Save a revision of a Remotion source tree.

## Path parameters

- `projectId` string, uuid, required

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `expectedRevision` integer, required
  - `source` object, required
    - `entrypoint` string, required
    - `controls` object
      - `file` string, ends_with, required
      - `fields` union[], required
        - union
          - object
            - `key` string, required
            - `label` string, required
            - `type` 'text', required
            - `maxLength` integer, required
          - object
            - `key` string, required
            - `label` string, required
            - `type` 'color', required
          - object
            - `key` string, required
            - `label` string, required
            - `type` 'media', required
          - object
            - `key` string, required
            - `label` string, required
            - `type` 'timing', required
            - `min` number, required
            - `max` number, required
            - `step` number, required
    - `build` object
      - `packageJson` string, required: Exact package.json text with pinned remotion and locked React dependencies. Projects using another Remotion version must include matching @remotion/bundler and @remotion/renderer. Compatible public npm dependencies are supported.
      - `packageLock` string, required: Exact npm lockfileVersion 3 text, with public registry.npmjs.org tarball URLs and integrity hashes. Local/git/private dependencies are not supported by this runtime.
      - `commands` string[], required: Shell commands after npm ci, executed in order inside disposable isolation within the shared 660-second process deadline.
    - `rendering` object
      - `gl` 'swangle' | 'default', required: swangle preserves software WebGL support. default lets Chromium choose its backend; benchmark and inspect every scene before using it for a 2D project.
      - `encoding` 'quality' | 'social', required: quality preserves the runtime's CRF render. social produces H.264 8 Mbps, AAC 128 kbps, 48 kHz, BT.709 for matching native exports without a second encode.
    - `files` object[], required
      - `path` string, required
      - `content` string, required
    - `assets` object[]
      - `path` string, required
      - `hash` string, required
      - `bytes` integer, required
      - `remoteUrl` string, uri, nullable, required
      - `assetId` string, uuid, required: Existing workspace media asset. Bytes and SHA-256 must match this immutable source binding.

## Response `200`

Successful response

- object
  - `id` string, uuid, required
  - `projectId` string, uuid, required
  - `revision` integer, required
  - `sourceHash` string, required
  - `entrypoint` string, required
  - `fileCount` integer, required
  - `createdAt` string, required

## Other responses

- `400`: Invalid input data
- `401`: Authorization not provided
- `403`: Insufficient access
- `404`: Not found
- `500`: Internal server error

---

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