Create a new composition (video) in a project
Add an empty composition to a project, for a second video or another format in the same project. Returns its id and ETag for the first edit; format defaults to the project's, and a project's first composition becomes the active one.
API key auth. Prefix cf_live_ for production orgs, cf_test_ for sandbox.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
POST /projects/:id/compositions body — create a new video (composition) in the project. format defaults to the project's compositionFormat when omitted.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/projects/string/compositions" \ -H "Content-Type: application/json" \ -d '{}'{ "compositionId": "string", "format": { "aspectRatio": "16:9", "fps": 24, "resolution": "hd", "platform": "string" }, "etag": "string"}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "x402Version": 2, "accepts": [ {} ], "error": "string"}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}List a project's compositions GET
List every composition in a project with its format, ETag, and whether it is the active one. Call it to choose which timeline to edit, preview, or render when a project holds several videos or aspect ratios.
Replace a project's composition PUT
Replaces the whole composition. Send `If-Match` with the ETag you observed (409 stale_etag on mismatch), or `If-None-Match: *` to create the first composition (409 conflict if one exists). Without either the write is refused with 428 precondition_required; `If-Match: *` is refused.