v106

OpenAPI 3.0.3Apache 2.0raw.githubusercontent.com2026-08-03812347972.4 KB
draft

upsert (or clear) the current user's draft at a path

post/w/{workspace}/drafts/update/{kind}/{path}

Path parameters

workspacestring required
kind'script' | 'flow' | 'app' | 'raw_app' | 'resource' | 'variable' | 'trigger_schedule' | 'trigger_webhook' | 'trigger_default_email' | 'trigger_email' | 'trigger_http' | 'trigger_websocket' | 'trigger_postgres' | 'trigger_kafka' | 'trigger_nats' | 'trigger_mqtt' | 'trigger_amqp' | 'trigger_sqs' | 'trigger_gcp' | 'trigger_azure' | 'trigger_poll' | 'trigger_cli' | 'trigger_nextcloud' | 'trigger_google' | 'trigger_github' | 'data_pipeline' required

Closed set of item kinds a user can autosave as a draft. Mirrors the Postgres DRAFT_KIND enum and the backend UserDraftItemKind.

pathstring required

Request body

{"stackTrail":"paths:/w/{workspace}/drafts/update/{kind}/{path}:post:requestBody:content:application/json:schema:properties:value","oasType":"schema","type":"unknown","description":"Draft content to save. `null` (or omitted) signals a delete — the row is removed under the same conflict rules.","nullable":true}
last_syncstring date-time

Server timestamp of the client's last known sync for this draft. Omit on first save.

forceboolean

Skip the conflict check and overwrite the server copy.

legacyboolean

Delete-only. Target the legacy workspace-level row (email NULL) instead of the current user's row. Used to discard a legacy draft from the review page.

created_atstring date-time

Upsert-only override for the stored creation timestamp. Normal saves omit it (stamped server-side); the localStorage→DB migration passes the draft's original write time so migrated drafts keep their age.

Response

save result

status'saved' | 'conflict' required
current_timestampstring date-time required