Skip to content

Commits

Commits are the only write path for repository data. A single commit can contain multiple operations — adding things, revising data, creating assertions, and managing collections — all applied atomically.


Create a commit with one or more operations.

Auth: Required, repo:write scope.

ParameterTypeDescription
orgNamestringOrganization name
repoNamestringRepository name
FieldTypeRequiredDescription
authorstringYesAuthor name for the commit
messagestringNoCommit message
operationsarrayYesArray of operation objects (see below)

Each operation in the operations array has a different shape depending on its operation and kind. See Commit Operations for detailed semantics.

{
"operation": "add",
"kind": "thing",
"name": "temp-1",
"data": { "location": "Building A", "type": "temperature" }
}
{
"operation": "add",
"kind": "assertion",
"name": "temp-1-reading-v1",
"about": "Sensor/temp-1",
"data": { "value": 72.5, "unit": "fahrenheit" }
}
{
"operation": "add",
"kind": "shape",
"name": "Sensor",
"data": { "fields": { "location": "string", "type": "string" } }
}

Shape data supports a top-level description, typed field objects with per-field descriptions, and field constraints (string enum/length, number range, typed wref shape, array bounds):

{
"operation": "add",
"kind": "shape",
"name": "Sensor",
"data": {
"description": "A physical sensor device",
"fields": {
"location": { "type": "string", "description": "Installation site" },
"reading": { "type": "number", "minimum": 0 },
"owner": { "type": "wref", "shape": "Device" },
"type": "string"
}
}
}
{
"operation": "add",
"kind": "collection",
"type": "set",
"members": ["Sensor/temp-1", "Sensor/temp-2"]
}
{
"operation": "revise",
"kind": "thing",
"name": "temp-1",
"data": { "location": "Building B", "type": "temperature" }
}
{
"operation": "revise",
"kind": "thing",
"name": "temp-1",
"data": {},
"active": false
}
FieldTypeRequiredDescription
operationstringYes"add" or "revise"
kindstringYes"shape", "thing", "assertion", or "collection"
namestringYesEntity name (optional for add collection)
dataobjectVariesData payload. Required for shapes, things, and assertions. Not accepted for collections.
aboutstringNoTarget wref such as Sensor/temp-1 (required for assertions)
activebooleanNoSet to false to deactivate (revise only)
typestringVariesCollection type: "pair", "triple", "set", "list". Required for add collection.
membersstring[]VariesMember wrefs. Required for add collection.
{
"number": 43,
"author": "sensor-agent",
"message": "Update sensor location",
"operationCount": 1,
"operations": [
{
"name": "temp-1",
"operation": "revise",
"version": 4,
"dataHash": "a1b2c3d4"
}
]
}
FieldTypeDescription
numbernumberCommit sequence number
authorstringCommit author
messagestringCommit message
operationCountnumberNumber of operations in the commit
operationsarrayResult of each operation with name, operation type, version, and data hash
CodeStatusDescription
VALIDATION_ERROR400Invalid operation schema, missing required fields, or malformed data
SHAPE_MISMATCH400Operation kind doesn’t match the target shape, or a typed wref field references a thing belonging to the wrong shape
CROSS_REPO_MUTATION400Operation references an entity in a different repository
RESERVED_NAME400The name is reserved by the system
ILLEGAL_OP_SEQUENCE400Invalid operation sequence (e.g., revising a thing that doesn’t exist)
WREF_UNRESOLVABLE404A wref in the operation data could not be resolved — the referenced thing does not exist or the reference format is invalid
NOT_FOUND404Repository not found
FORBIDDEN403Insufficient permissions
RATE_LIMITED429Too many write requests. Honor Retry-After before retrying.
Terminal window
curl -X POST https://api.warmhub.ai/api/repos/myorg/myrepo/commit \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"author": "sensor-agent",
"message": "Add temperature sensor and initial reading",
"operations": [
{
"operation": "add",
"kind": "thing",
"name": "temp-1",
"data": { "location": "Building A", "type": "temperature" }
},
{
"operation": "add",
"kind": "assertion",
"name": "temp-1-reading-v1",
"about": "Sensor/temp-1",
"data": { "value": 72.5, "unit": "fahrenheit" }
}
]
}'