# CueFrame Composition Apply (Transactional Batch Ops)

> CueFrame Composition Apply (Transactional Batch Ops) is a paid API for AI agents from api.cueframe.ai, paid per call via x402, $0.01/call, status unknown (last checked 2026-11-17).

Atomically applies an array of CompositionOps to a project's timeline, with ETag-based concurrency control and an optional dry-run validation mode.

## Facts

- Endpoint: POST https://api.cueframe.ai/v1/projects/:id/composition/apply?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/cueframe-composition-apply-transactional-batch-ops-207080e8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_aWabkdMKpqW2McgNNaJO7

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability cueframe-composition-apply-transactional-batch-ops-207080e8 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/cueframe-composition-apply-transactional-batch-ops-207080e8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.cueframe.ai](https://www.zero.xyz/host/api.cueframe.ai/llms.txt)
