POST /harness/sessions/{sessionId}/sync
Sync session state
ivy_ API key (Authorization: Bearer ivy_… or X-Ivy-Api-Key), a Clerk session JWT (Authorization: Bearer …) or the Clerk __session cookie (browser sessions). See Authentication.Push local changes to the server using version vectors for conflict detection.
Conflict resolution modes:
merge(default) — LWW; returnsconflictsarray when true concurrent edits detectedforce_local— client state wins unconditionallyforce_remote— server state wins; response includes fullstate
Request
Path parameters
Session UUID (UUIDv7 — time-ordered)
Request body
Identifier of the client submitting changes
Client's last-known session version number
Map of clientId → logical clock counter. Used for conflict detection in multi-client sync.
Changes to apply — empty array performs a read-only pull
Responses
200 OK
Response shape:
Server version after applying changes
Map of clientId → logical clock counter. Used for conflict detection in multi-client sync.
Changes from the server not yet seen by this client
Full session state snapshot persisted in Supabase
Non-empty when status is conflict — client must resolve before retrying
400 Bad Request
Response shape: object
401 Unauthorized
Response shape: object
404 Not Found
Response shape: object
Was this page helpful?