Skip to content
AbloAblo
Esc
navigateopen⌘Jpreview

Commit one or more mutations

Submit a batch of typed mutations. Atomic: if any operation is denied or fails, the entire commit is rejected. Successful commits broadcast a typed SyncDelta to every co-present peer.

POST/v1/commits
Header parameters
Idempotency-Keystring
Replay-safe identifier; derive it from the business event, not a random value. Same key + same body returns the same receipt.
Request body
requiredapplication/json
operationsCommitOperation[]required
min items 1
Show properties
Array of CommitOperation
actionstringrequired
Mutation verb. `data` is required for create/update and omitted for delete/archive/unarchive.
Allowed:createupdatedeletearchiveunarchive
idstringrequired
Target row id. Generate it before a create so retries address the same row.
transactionIdstring | null
Optional per-operation correlation id. The SDK uses it to recognize the confirming sync delta for an optimistic write.
readAtinteger | null
Watermark from when the caller reasoned about the target. The server detects writes since this id and applies `onStale`. SDK-managed; leave unset for last-writer-wins.
onStalestring | null
Conflict policy when `readAt` is stale: reject the commit, overwrite the newer value, or commit and return a notification.
Allowed:rejectoverwritenotifynull
modelstringrequired
Target model in your pushed schema.
dataobject
Row payload for create/update.
readsReadDependency[]
Batch-level read dependencies. If a premise moved, its `onStale` policy applies to the whole batch.
Show properties
Array of ReadDependency
modelstring
idstring
groupstring
readAtinteger
fieldsstring[]
Responses
200Commit receipt.
objectstringrequired
clientTxIdstringrequired
serverTxIdstringrequired
successbooleanrequired
statusstringrequired
Allowed:confirmedrejected
lastSyncIdinteger
opsinteger
missingIdsstring[]
Ids of any UPDATE/DELETE that matched zero rows (omitted when nothing missed).
notificationsStaleNotification[]
Held-write advisories from `onStale: "notify"`.
Show properties
Array of StaleNotification
objectstring
modelstring
idstring
readAtinteger
observedSyncIdinteger
conflictingFieldsstring[]
currentValuesobject
writtenBystring
groupstring
errorobject
Show properties
codestring
messagestring
fieldstring
requiredCapabilityRequiredCapability
On a 403, the scope the caller was missing.
Show properties
canstring
modelstring
syncGroupstring
401Missing or invalid credential.
typestringrequired
Coarse error class (e.g. `AbloValidationError`, `AbloPermissionError`).
codestring
Stable machine code for the specific error.
paramstring
Offending model/field path, when parameter-specific.
messagestringrequired
Human-readable explanation.
doc_urlstring
Link to the docs page for this code.
request_idstring
Request correlation id, echoed on the `x-request-id` response header.
403Capability denied — body carries `requiredCapability`.
typestringrequired
Coarse error class (e.g. `AbloValidationError`, `AbloPermissionError`).
codestring
Stable machine code for the specific error.
paramstring
Offending model/field path, when parameter-specific.
messagestringrequired
Human-readable explanation.
doc_urlstring
Link to the docs page for this code.
request_idstring
Request correlation id, echoed on the `x-request-id` response header.
Request
curl -X POST "https://api.abloatai.com/api/v1/commits" \
  -H "Content-Type: application/json" \
  -d '{
  "operations": [
    {
      "action": "create",
      "id": "string",
      "transactionId": "string",
      "readAt": 0,
      "onStale": "reject",
      "model": "task",
      "data": {}
    }
  ],
  "reads": [
    {
      "model": "string",
      "id": "string",
      "group": "string",
      "readAt": 0,
      "fields": [
        "string"
      ]
    }
  ]
}'
Response
{
  "object": "commit_receipt",
  "clientTxId": "string",
  "serverTxId": "string",
  "success": true,
  "status": "confirmed",
  "lastSyncId": 0,
  "ops": 0,
  "missingIds": [
    "string"
  ],
  "notifications": [
    {
      "object": "stale_notification",
      "model": "string",
      "id": "string",
      "readAt": 0,
      "observedSyncId": 0,
      "conflictingFields": [
        "string"
      ],
      "currentValues": {},
      "writtenBy": "string",
      "group": "string"
    }
  ],
  "error": {
    "code": "string",
    "message": "string",
    "field": "string",
    "requiredCapability": {
      "can": "string",
      "model": "string",
      "syncGroup": "string"
    }
  }
}