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/commitsHeader parameters
Idempotency-KeystringReplay-safe identifier; derive it from the business event, not a random value. Same key + same body returns the same receipt.
Request body
requiredapplication/jsonoperationsCommitOperation[]requiredmin items 1
Show propertiesHide properties
Array of
CommitOperationactionstringrequiredMutation verb. `data` is required for create/update and omitted for delete/archive/unarchive.
Allowed:
createupdatedeletearchiveunarchiveidstringrequiredTarget row id. Generate it before a create so retries address the same row.
transactionIdstring | nullOptional per-operation correlation id. The SDK uses it to recognize the confirming sync delta for an optimistic write.
readAtinteger | nullWatermark 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 | nullConflict policy when `readAt` is stale: reject the commit, overwrite the newer value, or commit and return a notification.
Allowed:
rejectoverwritenotifynullmodelstringrequiredTarget model in your pushed schema.
dataobjectRow payload for create/update.
readsReadDependency[]Batch-level read dependencies. If a premise moved, its `onStale` policy applies to the whole batch.
Show propertiesHide properties
Array of
ReadDependencymodelstringidstringgroupstringreadAtintegerfieldsstring[]Responses
200Commit receipt.
objectstringrequiredclientTxIdstringrequiredserverTxIdstringrequiredsuccessbooleanrequiredstatusstringrequiredAllowed:
confirmedrejectedlastSyncIdintegeropsintegermissingIdsstring[]Ids of any UPDATE/DELETE that matched zero rows (omitted when nothing missed).
notificationsStaleNotification[]Held-write advisories from `onStale: "notify"`.
Show propertiesHide properties
Array of
StaleNotificationobjectstringmodelstringidstringreadAtintegerobservedSyncIdintegerconflictingFieldsstring[]currentValuesobjectwrittenBystringgroupstringerrorobjectShow propertiesHide properties
codestringmessagestringfieldstringrequiredCapabilityRequiredCapabilityOn a 403, the scope the caller was missing.
Show propertiesHide properties
canstringmodelstringsyncGroupstring401Missing or invalid credential.
typestringrequiredCoarse error class (e.g. `AbloValidationError`, `AbloPermissionError`).
codestringStable machine code for the specific error.
paramstringOffending model/field path, when parameter-specific.
messagestringrequiredHuman-readable explanation.
doc_urlstringLink to the docs page for this code.
request_idstringRequest correlation id, echoed on the `x-request-id` response header.
403Capability denied — body carries `requiredCapability`.
typestringrequiredCoarse error class (e.g. `AbloValidationError`, `AbloPermissionError`).
codestringStable machine code for the specific error.
paramstringOffending model/field path, when parameter-specific.
messagestringrequiredHuman-readable explanation.
doc_urlstringLink to the docs page for this code.
request_idstringRequest 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"
]
}
]
}'const response = await fetch("https://api.abloatai.com/api/v1/commits", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"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"
]
}
]
})
});import requests
response = requests.post(
"https://api.abloatai.com/api/v1/commits",
headers={
"Content-Type": "application/json"
},
json={
"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"
}
}
}{
"type": "string",
"code": "string",
"param": "string",
"message": "string",
"doc_url": "string",
"request_id": "string"
}{
"type": "string",
"code": "string",
"param": "string",
"message": "string",
"doc_url": "string",
"request_id": "string"
}