{"uid":"cap_aWabkdMKpqW2McgNNaJO7","slug":"cueframe-composition-apply-transactional-batch-ops-207080e8","name":"CueFrame Composition Apply (Transactional Batch Ops)","description":"Atomically applies an array of CompositionOps. All ops succeed or none do (transactional). A write must carry `if_match`, the composition ETag it observed (409 stale_etag on mismatch), or the stronger `concurrency` admission; with neither it is refused with 428 precondition_required. Pass `dry_run: true` to validate the batch — runs the same apply + projection accept/reject guards WITHOUT persisting, returning `{ valid, errors }` with `locator.op_index` on the first failing op.","url":"https://api.cueframe.ai/v1/projects/:id/composition/apply?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"properties":{}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"pathParams":{"type":"object"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OvIk6-HRfVU0gEq0FiNhz","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Atomically applies an array of CompositionOps to a project's timeline, with ETag-based concurrency control and an optional dry-run validation mode.","exampleAgentPrompt":"Apply these three composition ops to my CueFrame project (ID: proj_abc123) — trim clip at track 2 to start at 5s, move clip 7 to position 12s, and set the fade-out to 1.5s — using the ETag 'etag_xyz99' I got from my last composition read. If any op fails, roll the whole thing back.","exampleUseCases":[{"title":"Safe concurrent timeline edit","prompt":"I'm editing my CueFrame project proj_abc123 and want to atomically apply two ops — insert a title card at 0s and trim the outro clip to 3s — but only if the composition hasn't changed since I last fetched it; my ETag is 'etag_0042'. Roll back both if either fails."},{"title":"Dry-run validation before committing","prompt":"Before I actually save anything, can you validate this batch of five composition ops against my CueFrame project proj_def456? Run it as a dry run using ETag 'etag_1199' so I can see which op (if any) would fail and why."},{"title":"Automated pipeline batch apply","prompt":"My render pipeline for project proj_gh789 just generated 10 composition ops from the script — apply them all at once to CueFrame using the latest ETag 'etag_7755', and if there's an ETag mismatch because someone else edited it, let me know so I can re-fetch and retry."}],"resultDescription":"On success: the updated composition object with a new ETag reflecting the applied state. On dry_run: a {valid, errors} object indicating whether all ops pass validation, with locator.op_index pointing to the first failing op if any. On ETag mismatch: 409 stale_etag. On missing concurrency token: 428 precondition_required.","failureModes":["409 stale_etag — the ETag provided doesn't match the current composition; client must re-fetch and retry","428 precondition_required — write attempted without if_match or concurrency token","Partial op failure causes full rollback — none of the ops are persisted","Invalid op schema causes validation error with op_index pointing to the offending op","Project ID not found returns 404","Malformed CompositionOps array returns 400 with details"],"whenToPreferThis":"Use this endpoint when you need to apply multiple composition changes atomically to a CueFrame video project — especially when concurrent editors may be present (optimistic locking via ETags) or when you want to validate a batch before committing (dry_run). Prefer this over single-op or non-transactional approaches whenever you cannot afford partial failure in a multi-step timeline edit.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-17T18:51:39.350Z","isFirstParty":false,"canonicalSlug":"cueframe-composition-apply-transactional-batch-ops-207080e8"}