Works
Canvas API operations tagged Works.
Base URL: https://app.gavana.ai/api/canvas-agent/v1 · Authentication: HTTP bearer, token format cba_<token-id>.<secret>
Operations
| Operation | Purpose | Scopes |
|---|---|---|
POST /works | Prepare a Canvas-backed Work | canvas:read, canvas:write, asset:read |
GET /works/{workId} | Get the latest durable Work | canvas:read |
POST /works/{workId}/refresh | Reconcile Work provider progress | canvas:read, canvas:write, image:generate |
POST /works/{workId}/continue | Continue planning a Work | canvas:read, canvas:write |
POST /works/{workId}/execute | Execute the selected Work direction | canvas:read, canvas:write, asset:read, image:generate |
POST /works
Prepare a Canvas-backed Work
Creates or reuses a durable versioned social-campaign Template instance, inferred brief, exactly three directions, and one recommendation. Non-social-only requests are rejected so template applicability remains truthful. This is planning only: it never starts a paid image or video job. References must be durable node: or asset: handles; direct URL ingestion is not enabled.
- Operation id:
workPrepare - Scopes: Requires
canvas:read+canvas:write+asset:read. - CLI equivalent:
gavana work prepare
Request body (application/json, required)
| Field | Type | Required | Notes |
|---|---|---|---|
request | string | Yes | min length 1, max length 8000. |
canvasId | string | No | Optional existing canvas: handle. If omitted Gavana creates a deterministic Canvas for this Work. max length 560. |
references | array of WorkReference | No | Durable product or style references. URLs are not accepted. max items 12. |
idempotencyKey | string | Yes | Caller-stable retry key. Reuse only for the identical Work intent. min length 8, max length 200. |
Responses
| Status | Payload | Meaning |
|---|---|---|
200 | WorkResponse | A server-owned chat-first Work with its durable Canvas projection, versioned Template, decision gate, and run state. |
201 | WorkResponse | A server-owned chat-first Work with its durable Canvas projection, versioned Template, decision gate, and run state. |
default | ErrorResponse | A stable machine-readable error. The response always includes X-Request-ID. |
200 response body
| Field | Type | Required | Notes |
|---|---|---|---|
work | Work | Yes | — |
work.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.handle | string | Yes | Pattern ^work:. |
work.ownerUid | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.canvasId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.canvasHandle | string | Yes | Pattern ^canvas:. |
work.canvasRevision | string | Yes | — |
work.template | object | Yes | — |
work.template.id | any | Yes | One of social-campaign, cross-brand-social-campaign. |
work.template.handle | any | Yes | One of template:social-campaign@1.0.0, template:cross-brand-social-campaign@1.0.0. |
work.template.name | string | Yes | — |
work.template.label | string | Yes | — |
work.state | string | Yes | One of understanding, needs_input, directions_ready, waiting_for_choice, ready_to_run, running, completed, partially_failed, failed. |
work.brief | object | Yes | — |
work.brief.refinements | array of object | Yes | — |
work.brief.refinements[].kind | any | Yes | One of answer, adjustment. |
work.brief.refinements[].value | string | Yes | — |
work.assumptions | array of string | Yes | — |
work.directions | array of WorkDirection | Yes | min items 3, max items 3. |
work.directions[].id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.directions[].handle | string | Yes | Pattern ^direction:. |
work.directions[].label | string | Yes | — |
work.directions[].name | string | Yes | — |
work.directions[].summary | string | Yes | — |
work.directions[].executionPrompt | string | Yes | Durable prompt context used by execution unless the authoritative Canvas direction text is acknowledged and changed. |
work.directions[].creative | object | Yes | — |
work.directions[].creative.coreIdea | string | Yes | — |
work.directions[].creative.camera | string | Yes | — |
work.directions[].creative.composition | string | Yes | — |
work.directions[].creative.lighting | string | Yes | — |
work.directions[].creative.motionTexture | string | Yes | — |
work.directions[].creative.copyHierarchy | string | Yes | — |
work.directions[].rationale | string | Yes | — |
work.directions[].recommended | boolean | Yes | — |
work.directions[].branchNodeHandle | string | Yes | Pattern ^node:. |
work.directions[].targetNodeHandle | string | Yes | Pattern ^node:. |
work.decision | object | Yes | — |
work.decision.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.decision.handle | string | Yes | Pattern ^decision:. |
work.decision.selectedDirectionId | string | No | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.decision.status | any | Yes | One of open, made. |
work.selectedDirectionId | string | No | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.recommendation | object | Yes | — |
work.recommendation.directionId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.recommendation.reason | string | Yes | — |
work.deliverables | array of object | Yes | — |
work.costConfirmation | object | Yes | — |
work.costConfirmation.confirmed | boolean | Yes | — |
work.costConfirmation.paidJobsStarted | integer | Yes | min 0. |
work.cost | object | Yes | — |
work.cost.estimated | number | Yes | min 0. |
work.events | array of object | Yes | — |
work.runs | array of object | Yes | — |
work.runs[].id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.runs[].handle | string | Yes | Pattern ^run:. |
work.runs[].idempotencyKey | string | Yes | Caller-stable retry key. Reuse only for the identical Work intent. min length 8, max length 200. |
work.runs[].selectedDirectionId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.runs[].executionPrompt | string | Yes | — |
work.runs[].status | any | Yes | One of running, completed, partially_failed, failed. |
work.runs[].startedAt | string (date-time) | Yes | — |
work.runs[].completedAt | string (date-time) | No | — |
work.runs[].jobHandle | string | No | Pattern ^job:. |
work.runs[].outputHandles | array of string | Yes | — |
work.runs[].outputs | array of WorkOutput | Yes | — |
work.runs[].outputs[].nodeHandle | string | Yes | Pattern ^node:. |
work.runs[].outputs[].assetHandle | string | No | Pattern ^asset:. |
work.runs[].outputs[].status | string | Yes | One of pending, running, succeeded, failed. |
work.runs[].outputs[].previewUrl | string (uri) | No | — |
work.runs[].outputs[].downloadUrl | string (uri) | No | — |
work.runs[].outputs[].error | string | No | — |
work.runs[].outputs[].retryable | boolean | No | — |
work.createdAt | string (date-time) | Yes | — |
work.updatedAt | string (date-time) | Yes | — |
workId | string | Yes | Pattern ^work:. |
status | string | Yes | One of understanding, needs_input, directions_ready, waiting_for_choice, ready_to_run, running, completed, partially_failed, failed. |
replayed | boolean | No | — |
canvas | object | Yes | — |
canvas.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
canvas.handle | string | Yes | Pattern ^canvas:. |
canvas.revision | string | Yes | — |
canvas.href | string | Yes | — |
canvasSync | object | Yes | — |
canvasSync.sourceRevision | string | Yes | — |
canvasSync.currentRevision | string | Yes | — |
canvasSync.status | any | Yes | One of current, stale, blocked. |
canvasSync.affectedOutputIds | array of string | Yes | — |
permissions | object | Yes | — |
permissions.canEdit | boolean | Yes | True for owners and editors who may continue or execute the Work. |
permissions.canRefresh | boolean | Yes | True only for the Work owner, who may call workRefresh to reconcile provider progress. |
progress | object | Yes | — |
progress.state | string | Yes | — |
progress.completed | integer | Yes | min 0. |
progress.total | integer | Yes | min 0. |
retired | boolean | No | The historical source is read-only; no new execution may start there. |
replacementCanvasHandle | string | No | Owner-qualified replacement canvas after migration, if available. |
Example
curl -X POST "https://app.gavana.ai/api/canvas-agent/v1/works" \
-H "Authorization: Bearer $GAVANA_AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"request": "<request>",
"idempotencyKey": "2026-08-04-first-attempt"
}'GET /works/{workId}
Get the latest durable Work
Returns a read-only durable Work and Canvas sync snapshot. It never polls a provider and never writes Work or Canvas. A stale Canvas is reported rather than overwritten.
- Operation id:
workGet - Scopes: Requires
canvas:read. - CLI equivalent:
gavana work get
Parameters
| Parameter | In | Type | Required | Notes |
|---|---|---|---|---|
workId | path | string | Yes | Pattern ^(?:work:)?[A-Za-z0-9_-]{1,180}$. |
Responses
| Status | Payload | Meaning |
|---|---|---|
200 | WorkResponse | A server-owned chat-first Work with its durable Canvas projection, versioned Template, decision gate, and run state. |
default | ErrorResponse | A stable machine-readable error. The response always includes X-Request-ID. |
200 response body
| Field | Type | Required | Notes |
|---|---|---|---|
work | Work | Yes | — |
work.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.handle | string | Yes | Pattern ^work:. |
work.ownerUid | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.canvasId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.canvasHandle | string | Yes | Pattern ^canvas:. |
work.canvasRevision | string | Yes | — |
work.template | object | Yes | — |
work.template.id | any | Yes | One of social-campaign, cross-brand-social-campaign. |
work.template.handle | any | Yes | One of template:social-campaign@1.0.0, template:cross-brand-social-campaign@1.0.0. |
work.template.name | string | Yes | — |
work.template.label | string | Yes | — |
work.state | string | Yes | One of understanding, needs_input, directions_ready, waiting_for_choice, ready_to_run, running, completed, partially_failed, failed. |
work.brief | object | Yes | — |
work.brief.refinements | array of object | Yes | — |
work.brief.refinements[].kind | any | Yes | One of answer, adjustment. |
work.brief.refinements[].value | string | Yes | — |
work.assumptions | array of string | Yes | — |
work.directions | array of WorkDirection | Yes | min items 3, max items 3. |
work.directions[].id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.directions[].handle | string | Yes | Pattern ^direction:. |
work.directions[].label | string | Yes | — |
work.directions[].name | string | Yes | — |
work.directions[].summary | string | Yes | — |
work.directions[].executionPrompt | string | Yes | Durable prompt context used by execution unless the authoritative Canvas direction text is acknowledged and changed. |
work.directions[].creative | object | Yes | — |
work.directions[].creative.coreIdea | string | Yes | — |
work.directions[].creative.camera | string | Yes | — |
work.directions[].creative.composition | string | Yes | — |
work.directions[].creative.lighting | string | Yes | — |
work.directions[].creative.motionTexture | string | Yes | — |
work.directions[].creative.copyHierarchy | string | Yes | — |
work.directions[].rationale | string | Yes | — |
work.directions[].recommended | boolean | Yes | — |
work.directions[].branchNodeHandle | string | Yes | Pattern ^node:. |
work.directions[].targetNodeHandle | string | Yes | Pattern ^node:. |
work.decision | object | Yes | — |
work.decision.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.decision.handle | string | Yes | Pattern ^decision:. |
work.decision.selectedDirectionId | string | No | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.decision.status | any | Yes | One of open, made. |
work.selectedDirectionId | string | No | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.recommendation | object | Yes | — |
work.recommendation.directionId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.recommendation.reason | string | Yes | — |
work.deliverables | array of object | Yes | — |
work.costConfirmation | object | Yes | — |
work.costConfirmation.confirmed | boolean | Yes | — |
work.costConfirmation.paidJobsStarted | integer | Yes | min 0. |
work.cost | object | Yes | — |
work.cost.estimated | number | Yes | min 0. |
work.events | array of object | Yes | — |
work.runs | array of object | Yes | — |
work.runs[].id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.runs[].handle | string | Yes | Pattern ^run:. |
work.runs[].idempotencyKey | string | Yes | Caller-stable retry key. Reuse only for the identical Work intent. min length 8, max length 200. |
work.runs[].selectedDirectionId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.runs[].executionPrompt | string | Yes | — |
work.runs[].status | any | Yes | One of running, completed, partially_failed, failed. |
work.runs[].startedAt | string (date-time) | Yes | — |
work.runs[].completedAt | string (date-time) | No | — |
work.runs[].jobHandle | string | No | Pattern ^job:. |
work.runs[].outputHandles | array of string | Yes | — |
work.runs[].outputs | array of WorkOutput | Yes | — |
work.runs[].outputs[].nodeHandle | string | Yes | Pattern ^node:. |
work.runs[].outputs[].assetHandle | string | No | Pattern ^asset:. |
work.runs[].outputs[].status | string | Yes | One of pending, running, succeeded, failed. |
work.runs[].outputs[].previewUrl | string (uri) | No | — |
work.runs[].outputs[].downloadUrl | string (uri) | No | — |
work.runs[].outputs[].error | string | No | — |
work.runs[].outputs[].retryable | boolean | No | — |
work.createdAt | string (date-time) | Yes | — |
work.updatedAt | string (date-time) | Yes | — |
workId | string | Yes | Pattern ^work:. |
status | string | Yes | One of understanding, needs_input, directions_ready, waiting_for_choice, ready_to_run, running, completed, partially_failed, failed. |
replayed | boolean | No | — |
canvas | object | Yes | — |
canvas.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
canvas.handle | string | Yes | Pattern ^canvas:. |
canvas.revision | string | Yes | — |
canvas.href | string | Yes | — |
canvasSync | object | Yes | — |
canvasSync.sourceRevision | string | Yes | — |
canvasSync.currentRevision | string | Yes | — |
canvasSync.status | any | Yes | One of current, stale, blocked. |
canvasSync.affectedOutputIds | array of string | Yes | — |
permissions | object | Yes | — |
permissions.canEdit | boolean | Yes | True for owners and editors who may continue or execute the Work. |
permissions.canRefresh | boolean | Yes | True only for the Work owner, who may call workRefresh to reconcile provider progress. |
progress | object | Yes | — |
progress.state | string | Yes | — |
progress.completed | integer | Yes | min 0. |
progress.total | integer | Yes | min 0. |
retired | boolean | No | The historical source is read-only; no new execution may start there. |
replacementCanvasHandle | string | No | Owner-qualified replacement canvas after migration, if available. |
Example
curl "https://app.gavana.ai/api/canvas-agent/v1/works/%3CworkId%3E" \
-H "Authorization: Bearer $GAVANA_AGENT_TOKEN"POST /works/{workId}/refresh
Reconcile Work provider progress
Owner-side status operation that polls the selected provider job and may write durable Work progress, Canvas status, or finalized output metadata. Use workGet for read-only inspection.
- Operation id:
workRefresh - Scopes: Requires
canvas:read+canvas:write+image:generate. - CLI equivalent:
gavana work refresh
Parameters
| Parameter | In | Type | Required | Notes |
|---|---|---|---|---|
workId | path | string | Yes | Pattern ^(?:work:)?[A-Za-z0-9_-]{1,180}$. |
Responses
| Status | Payload | Meaning |
|---|---|---|
200 | WorkResponse | A server-owned chat-first Work with its durable Canvas projection, versioned Template, decision gate, and run state. |
default | ErrorResponse | A stable machine-readable error. The response always includes X-Request-ID. |
200 response body
| Field | Type | Required | Notes |
|---|---|---|---|
work | Work | Yes | — |
work.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.handle | string | Yes | Pattern ^work:. |
work.ownerUid | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.canvasId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.canvasHandle | string | Yes | Pattern ^canvas:. |
work.canvasRevision | string | Yes | — |
work.template | object | Yes | — |
work.template.id | any | Yes | One of social-campaign, cross-brand-social-campaign. |
work.template.handle | any | Yes | One of template:social-campaign@1.0.0, template:cross-brand-social-campaign@1.0.0. |
work.template.name | string | Yes | — |
work.template.label | string | Yes | — |
work.state | string | Yes | One of understanding, needs_input, directions_ready, waiting_for_choice, ready_to_run, running, completed, partially_failed, failed. |
work.brief | object | Yes | — |
work.brief.refinements | array of object | Yes | — |
work.brief.refinements[].kind | any | Yes | One of answer, adjustment. |
work.brief.refinements[].value | string | Yes | — |
work.assumptions | array of string | Yes | — |
work.directions | array of WorkDirection | Yes | min items 3, max items 3. |
work.directions[].id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.directions[].handle | string | Yes | Pattern ^direction:. |
work.directions[].label | string | Yes | — |
work.directions[].name | string | Yes | — |
work.directions[].summary | string | Yes | — |
work.directions[].executionPrompt | string | Yes | Durable prompt context used by execution unless the authoritative Canvas direction text is acknowledged and changed. |
work.directions[].creative | object | Yes | — |
work.directions[].creative.coreIdea | string | Yes | — |
work.directions[].creative.camera | string | Yes | — |
work.directions[].creative.composition | string | Yes | — |
work.directions[].creative.lighting | string | Yes | — |
work.directions[].creative.motionTexture | string | Yes | — |
work.directions[].creative.copyHierarchy | string | Yes | — |
work.directions[].rationale | string | Yes | — |
work.directions[].recommended | boolean | Yes | — |
work.directions[].branchNodeHandle | string | Yes | Pattern ^node:. |
work.directions[].targetNodeHandle | string | Yes | Pattern ^node:. |
work.decision | object | Yes | — |
work.decision.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.decision.handle | string | Yes | Pattern ^decision:. |
work.decision.selectedDirectionId | string | No | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.decision.status | any | Yes | One of open, made. |
work.selectedDirectionId | string | No | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.recommendation | object | Yes | — |
work.recommendation.directionId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.recommendation.reason | string | Yes | — |
work.deliverables | array of object | Yes | — |
work.costConfirmation | object | Yes | — |
work.costConfirmation.confirmed | boolean | Yes | — |
work.costConfirmation.paidJobsStarted | integer | Yes | min 0. |
work.cost | object | Yes | — |
work.cost.estimated | number | Yes | min 0. |
work.events | array of object | Yes | — |
work.runs | array of object | Yes | — |
work.runs[].id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.runs[].handle | string | Yes | Pattern ^run:. |
work.runs[].idempotencyKey | string | Yes | Caller-stable retry key. Reuse only for the identical Work intent. min length 8, max length 200. |
work.runs[].selectedDirectionId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.runs[].executionPrompt | string | Yes | — |
work.runs[].status | any | Yes | One of running, completed, partially_failed, failed. |
work.runs[].startedAt | string (date-time) | Yes | — |
work.runs[].completedAt | string (date-time) | No | — |
work.runs[].jobHandle | string | No | Pattern ^job:. |
work.runs[].outputHandles | array of string | Yes | — |
work.runs[].outputs | array of WorkOutput | Yes | — |
work.runs[].outputs[].nodeHandle | string | Yes | Pattern ^node:. |
work.runs[].outputs[].assetHandle | string | No | Pattern ^asset:. |
work.runs[].outputs[].status | string | Yes | One of pending, running, succeeded, failed. |
work.runs[].outputs[].previewUrl | string (uri) | No | — |
work.runs[].outputs[].downloadUrl | string (uri) | No | — |
work.runs[].outputs[].error | string | No | — |
work.runs[].outputs[].retryable | boolean | No | — |
work.createdAt | string (date-time) | Yes | — |
work.updatedAt | string (date-time) | Yes | — |
workId | string | Yes | Pattern ^work:. |
status | string | Yes | One of understanding, needs_input, directions_ready, waiting_for_choice, ready_to_run, running, completed, partially_failed, failed. |
replayed | boolean | No | — |
canvas | object | Yes | — |
canvas.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
canvas.handle | string | Yes | Pattern ^canvas:. |
canvas.revision | string | Yes | — |
canvas.href | string | Yes | — |
canvasSync | object | Yes | — |
canvasSync.sourceRevision | string | Yes | — |
canvasSync.currentRevision | string | Yes | — |
canvasSync.status | any | Yes | One of current, stale, blocked. |
canvasSync.affectedOutputIds | array of string | Yes | — |
permissions | object | Yes | — |
permissions.canEdit | boolean | Yes | True for owners and editors who may continue or execute the Work. |
permissions.canRefresh | boolean | Yes | True only for the Work owner, who may call workRefresh to reconcile provider progress. |
progress | object | Yes | — |
progress.state | string | Yes | — |
progress.completed | integer | Yes | min 0. |
progress.total | integer | Yes | min 0. |
retired | boolean | No | The historical source is read-only; no new execution may start there. |
replacementCanvasHandle | string | No | Owner-qualified replacement canvas after migration, if available. |
Example
curl -X POST "https://app.gavana.ai/api/canvas-agent/v1/works/%3CworkId%3E/refresh" \
-H "Authorization: Bearer $GAVANA_AGENT_TOKEN"POST /works/{workId}/continue
Continue planning a Work
Records an answer, an explicit direction selection, a brief adjustment, or an explicit Canvas acknowledgement. It never starts paid media generation.
- Operation id:
workContinue - Scopes: Requires
canvas:read+canvas:write. - CLI equivalent:
gavana work continue
Parameters
| Parameter | In | Type | Required | Notes |
|---|---|---|---|---|
workId | path | string | Yes | Pattern ^(?:work:)?[A-Za-z0-9_-]{1,180}$. |
Request body (application/json, required)
| Field | Type | Required | Notes |
|---|---|---|---|
(variant 1).action | “answer” | Yes | — |
(variant 1).answer | string | Yes | min length 1, max length 2000. |
(variant 1).idempotencyKey | string | Yes | Caller-stable retry key. Reuse only for the identical Work intent. min length 8, max length 200. |
(variant 2).action | “select_direction” | Yes | — |
(variant 2).directionId | string | Yes | A direction id or direction: handle from this Work. min length 1, max length 400. |
(variant 2).idempotencyKey | string | Yes | Caller-stable retry key. Reuse only for the identical Work intent. min length 8, max length 200. |
(variant 3).action | “adjust” | Yes | — |
(variant 3).adjustment | string | Yes | min length 1, max length 2000. |
(variant 3).idempotencyKey | string | Yes | Caller-stable retry key. Reuse only for the identical Work intent. min length 8, max length 200. |
(variant 4).action | “acknowledge_canvas” | Yes | — |
(variant 4).rebase | true | No | Acknowledge the current Canvas revision without overwriting a human edit. |
(variant 4).idempotencyKey | string | Yes | Caller-stable retry key. Reuse only for the identical Work intent. min length 8, max length 200. |
(variant 5).rebase | true | Yes | CLI-compatible shorthand for acknowledge_canvas. |
(variant 5).idempotencyKey | string | Yes | Caller-stable retry key. Reuse only for the identical Work intent. min length 8, max length 200. |
Responses
| Status | Payload | Meaning |
|---|---|---|
200 | WorkResponse | A server-owned chat-first Work with its durable Canvas projection, versioned Template, decision gate, and run state. |
default | ErrorResponse | A stable machine-readable error. The response always includes X-Request-ID. |
200 response body
| Field | Type | Required | Notes |
|---|---|---|---|
work | Work | Yes | — |
work.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.handle | string | Yes | Pattern ^work:. |
work.ownerUid | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.canvasId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.canvasHandle | string | Yes | Pattern ^canvas:. |
work.canvasRevision | string | Yes | — |
work.template | object | Yes | — |
work.template.id | any | Yes | One of social-campaign, cross-brand-social-campaign. |
work.template.handle | any | Yes | One of template:social-campaign@1.0.0, template:cross-brand-social-campaign@1.0.0. |
work.template.name | string | Yes | — |
work.template.label | string | Yes | — |
work.state | string | Yes | One of understanding, needs_input, directions_ready, waiting_for_choice, ready_to_run, running, completed, partially_failed, failed. |
work.brief | object | Yes | — |
work.brief.refinements | array of object | Yes | — |
work.brief.refinements[].kind | any | Yes | One of answer, adjustment. |
work.brief.refinements[].value | string | Yes | — |
work.assumptions | array of string | Yes | — |
work.directions | array of WorkDirection | Yes | min items 3, max items 3. |
work.directions[].id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.directions[].handle | string | Yes | Pattern ^direction:. |
work.directions[].label | string | Yes | — |
work.directions[].name | string | Yes | — |
work.directions[].summary | string | Yes | — |
work.directions[].executionPrompt | string | Yes | Durable prompt context used by execution unless the authoritative Canvas direction text is acknowledged and changed. |
work.directions[].creative | object | Yes | — |
work.directions[].creative.coreIdea | string | Yes | — |
work.directions[].creative.camera | string | Yes | — |
work.directions[].creative.composition | string | Yes | — |
work.directions[].creative.lighting | string | Yes | — |
work.directions[].creative.motionTexture | string | Yes | — |
work.directions[].creative.copyHierarchy | string | Yes | — |
work.directions[].rationale | string | Yes | — |
work.directions[].recommended | boolean | Yes | — |
work.directions[].branchNodeHandle | string | Yes | Pattern ^node:. |
work.directions[].targetNodeHandle | string | Yes | Pattern ^node:. |
work.decision | object | Yes | — |
work.decision.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.decision.handle | string | Yes | Pattern ^decision:. |
work.decision.selectedDirectionId | string | No | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.decision.status | any | Yes | One of open, made. |
work.selectedDirectionId | string | No | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.recommendation | object | Yes | — |
work.recommendation.directionId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.recommendation.reason | string | Yes | — |
work.deliverables | array of object | Yes | — |
work.costConfirmation | object | Yes | — |
work.costConfirmation.confirmed | boolean | Yes | — |
work.costConfirmation.paidJobsStarted | integer | Yes | min 0. |
work.cost | object | Yes | — |
work.cost.estimated | number | Yes | min 0. |
work.events | array of object | Yes | — |
work.runs | array of object | Yes | — |
work.runs[].id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.runs[].handle | string | Yes | Pattern ^run:. |
work.runs[].idempotencyKey | string | Yes | Caller-stable retry key. Reuse only for the identical Work intent. min length 8, max length 200. |
work.runs[].selectedDirectionId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.runs[].executionPrompt | string | Yes | — |
work.runs[].status | any | Yes | One of running, completed, partially_failed, failed. |
work.runs[].startedAt | string (date-time) | Yes | — |
work.runs[].completedAt | string (date-time) | No | — |
work.runs[].jobHandle | string | No | Pattern ^job:. |
work.runs[].outputHandles | array of string | Yes | — |
work.runs[].outputs | array of WorkOutput | Yes | — |
work.runs[].outputs[].nodeHandle | string | Yes | Pattern ^node:. |
work.runs[].outputs[].assetHandle | string | No | Pattern ^asset:. |
work.runs[].outputs[].status | string | Yes | One of pending, running, succeeded, failed. |
work.runs[].outputs[].previewUrl | string (uri) | No | — |
work.runs[].outputs[].downloadUrl | string (uri) | No | — |
work.runs[].outputs[].error | string | No | — |
work.runs[].outputs[].retryable | boolean | No | — |
work.createdAt | string (date-time) | Yes | — |
work.updatedAt | string (date-time) | Yes | — |
workId | string | Yes | Pattern ^work:. |
status | string | Yes | One of understanding, needs_input, directions_ready, waiting_for_choice, ready_to_run, running, completed, partially_failed, failed. |
replayed | boolean | No | — |
canvas | object | Yes | — |
canvas.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
canvas.handle | string | Yes | Pattern ^canvas:. |
canvas.revision | string | Yes | — |
canvas.href | string | Yes | — |
canvasSync | object | Yes | — |
canvasSync.sourceRevision | string | Yes | — |
canvasSync.currentRevision | string | Yes | — |
canvasSync.status | any | Yes | One of current, stale, blocked. |
canvasSync.affectedOutputIds | array of string | Yes | — |
permissions | object | Yes | — |
permissions.canEdit | boolean | Yes | True for owners and editors who may continue or execute the Work. |
permissions.canRefresh | boolean | Yes | True only for the Work owner, who may call workRefresh to reconcile provider progress. |
progress | object | Yes | — |
progress.state | string | Yes | — |
progress.completed | integer | Yes | min 0. |
progress.total | integer | Yes | min 0. |
retired | boolean | No | The historical source is read-only; no new execution may start there. |
replacementCanvasHandle | string | No | Owner-qualified replacement canvas after migration, if available. |
Example
curl -X POST "https://app.gavana.ai/api/canvas-agent/v1/works/%3CworkId%3E/continue" \
-H "Authorization: Bearer $GAVANA_AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "answer",
"answer": "<answer>",
"idempotencyKey": "2026-08-04-first-attempt"
}'POST /works/{workId}/execute
Execute the selected Work direction
Starts only the explicitly selected direction. Requires confirm: true and a caller-stable idempotencyKey because it may incur provider cost. It rejects unselected Work and never retries paid work automatically.
- Operation id:
workExecute - Scopes: Requires
canvas:read+canvas:write+asset:read+image:generate. - CLI equivalent:
gavana work execute
Parameters
| Parameter | In | Type | Required | Notes |
|---|---|---|---|---|
workId | path | string | Yes | Pattern ^(?:work:)?[A-Za-z0-9_-]{1,180}$. |
Request body (application/json, required)
| Field | Type | Required | Notes |
|---|---|---|---|
idempotencyKey | string | Yes | Caller-stable retry key. Reuse only for the identical Work intent. min length 8, max length 200. |
Responses
| Status | Payload | Meaning |
|---|---|---|
202 | WorkResponse | A server-owned chat-first Work with its durable Canvas projection, versioned Template, decision gate, and run state. |
default | ErrorResponse | A stable machine-readable error. The response always includes X-Request-ID. |
202 response body
| Field | Type | Required | Notes |
|---|---|---|---|
work | Work | Yes | — |
work.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.handle | string | Yes | Pattern ^work:. |
work.ownerUid | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.canvasId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.canvasHandle | string | Yes | Pattern ^canvas:. |
work.canvasRevision | string | Yes | — |
work.template | object | Yes | — |
work.template.id | any | Yes | One of social-campaign, cross-brand-social-campaign. |
work.template.handle | any | Yes | One of template:social-campaign@1.0.0, template:cross-brand-social-campaign@1.0.0. |
work.template.name | string | Yes | — |
work.template.label | string | Yes | — |
work.state | string | Yes | One of understanding, needs_input, directions_ready, waiting_for_choice, ready_to_run, running, completed, partially_failed, failed. |
work.brief | object | Yes | — |
work.brief.refinements | array of object | Yes | — |
work.brief.refinements[].kind | any | Yes | One of answer, adjustment. |
work.brief.refinements[].value | string | Yes | — |
work.assumptions | array of string | Yes | — |
work.directions | array of WorkDirection | Yes | min items 3, max items 3. |
work.directions[].id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.directions[].handle | string | Yes | Pattern ^direction:. |
work.directions[].label | string | Yes | — |
work.directions[].name | string | Yes | — |
work.directions[].summary | string | Yes | — |
work.directions[].executionPrompt | string | Yes | Durable prompt context used by execution unless the authoritative Canvas direction text is acknowledged and changed. |
work.directions[].creative | object | Yes | — |
work.directions[].creative.coreIdea | string | Yes | — |
work.directions[].creative.camera | string | Yes | — |
work.directions[].creative.composition | string | Yes | — |
work.directions[].creative.lighting | string | Yes | — |
work.directions[].creative.motionTexture | string | Yes | — |
work.directions[].creative.copyHierarchy | string | Yes | — |
work.directions[].rationale | string | Yes | — |
work.directions[].recommended | boolean | Yes | — |
work.directions[].branchNodeHandle | string | Yes | Pattern ^node:. |
work.directions[].targetNodeHandle | string | Yes | Pattern ^node:. |
work.decision | object | Yes | — |
work.decision.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.decision.handle | string | Yes | Pattern ^decision:. |
work.decision.selectedDirectionId | string | No | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.decision.status | any | Yes | One of open, made. |
work.selectedDirectionId | string | No | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.recommendation | object | Yes | — |
work.recommendation.directionId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.recommendation.reason | string | Yes | — |
work.deliverables | array of object | Yes | — |
work.costConfirmation | object | Yes | — |
work.costConfirmation.confirmed | boolean | Yes | — |
work.costConfirmation.paidJobsStarted | integer | Yes | min 0. |
work.cost | object | Yes | — |
work.cost.estimated | number | Yes | min 0. |
work.events | array of object | Yes | — |
work.runs | array of object | Yes | — |
work.runs[].id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.runs[].handle | string | Yes | Pattern ^run:. |
work.runs[].idempotencyKey | string | Yes | Caller-stable retry key. Reuse only for the identical Work intent. min length 8, max length 200. |
work.runs[].selectedDirectionId | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
work.runs[].executionPrompt | string | Yes | — |
work.runs[].status | any | Yes | One of running, completed, partially_failed, failed. |
work.runs[].startedAt | string (date-time) | Yes | — |
work.runs[].completedAt | string (date-time) | No | — |
work.runs[].jobHandle | string | No | Pattern ^job:. |
work.runs[].outputHandles | array of string | Yes | — |
work.runs[].outputs | array of WorkOutput | Yes | — |
work.runs[].outputs[].nodeHandle | string | Yes | Pattern ^node:. |
work.runs[].outputs[].assetHandle | string | No | Pattern ^asset:. |
work.runs[].outputs[].status | string | Yes | One of pending, running, succeeded, failed. |
work.runs[].outputs[].previewUrl | string (uri) | No | — |
work.runs[].outputs[].downloadUrl | string (uri) | No | — |
work.runs[].outputs[].error | string | No | — |
work.runs[].outputs[].retryable | boolean | No | — |
work.createdAt | string (date-time) | Yes | — |
work.updatedAt | string (date-time) | Yes | — |
workId | string | Yes | Pattern ^work:. |
status | string | Yes | One of understanding, needs_input, directions_ready, waiting_for_choice, ready_to_run, running, completed, partially_failed, failed. |
replayed | boolean | No | — |
canvas | object | Yes | — |
canvas.id | string | Yes | Pattern ^[A-Za-z0-9_-]{1,180}$. |
canvas.handle | string | Yes | Pattern ^canvas:. |
canvas.revision | string | Yes | — |
canvas.href | string | Yes | — |
canvasSync | object | Yes | — |
canvasSync.sourceRevision | string | Yes | — |
canvasSync.currentRevision | string | Yes | — |
canvasSync.status | any | Yes | One of current, stale, blocked. |
canvasSync.affectedOutputIds | array of string | Yes | — |
permissions | object | Yes | — |
permissions.canEdit | boolean | Yes | True for owners and editors who may continue or execute the Work. |
permissions.canRefresh | boolean | Yes | True only for the Work owner, who may call workRefresh to reconcile provider progress. |
progress | object | Yes | — |
progress.state | string | Yes | — |
progress.completed | integer | Yes | min 0. |
progress.total | integer | Yes | min 0. |
retired | boolean | No | The historical source is read-only; no new execution may start there. |
replacementCanvasHandle | string | No | Owner-qualified replacement canvas after migration, if available. |
Example
curl -X POST "https://app.gavana.ai/api/canvas-agent/v1/works/%3CworkId%3E/execute" \
-H "Authorization: Bearer $GAVANA_AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"confirm": true,
"idempotencyKey": "2026-08-04-first-attempt"
}'Errors
Every failure uses the shared error envelope described in Errors and X-Request-ID. The response always carries X-Request-ID; share that value with support instead of the request payload.