Change files
Applies put, delete and move operations as ONE history entry. Each operation may carry the expected_hash you read; a file changed since is a 409 with the current revision and nothing is written. Prefer the content endpoints for texts, entries and business details: they validate against the site's content model and cannot break its layout.
POST/v1/sites/{site_id}/commits
Requires sites:write. Costs no credits. Changes the draft only. Visitors see nothing until you publish.
Use this to change code: a layout, a component, the content model. For texts, entries and business details, use the content endpoints: they validate against the content model and cannot break the layout.
Avoid overwriting someone else
Put the hash you read in expected_hash on every operation. If one of those files changed since, the whole change is refused with 409 conflict and nothing is written. The error’s details hold the current revision:
{
"error": {
"code": "conflict",
"details": {
"reason": "revision_conflict",
"current_revision": "9f2c...",
"paths": [
{ "path": "src/pages/index.astro", "expected": "a1b2...", "found": "c3d4..." }
]
}
},
"request_id": "req_01K9X7"
}Read the files in paths again (each lists the hash you expected and the hash found), apply your change on top and retry. base_revision says which revision you read: the change still applies when the files it touches did not move.
Keep the site static Astro: no server adapter, no server-side rendering.
Authorizations
Authorizationbearerin headerrequiredPath parameters
site_idstringrequiredThe site's id, or its slug (the address before .atelier201.page).
Body
application/jsonrequiredsummarystringrequiredlength: 1–500 charsWhat the change does, in a sentence: it is the history entry people read.
base_revisionstringlength: 40–40 charsThe revision you read. The change still applies if the files it touches did not change since; otherwise 409 with the current revision.
operationsobject | object | object[]requireditems: 1–500 itemsResponse
Change files (one commit)
dataobjectrequiredrequest_idstringrequiredPossible codes: invalid_request, unknown_field, invalid_parameter, invalid_cursor
errorobjectrequiredrequest_idstringrequiredPossible codes: authentication_required, invalid_api_key, api_key_expired, api_key_revoked
errorobjectrequiredrequest_idstringrequiredPossible codes: insufficient_credits
errorobjectrequiredrequest_idstringrequiredPossible codes: insufficient_scope, feature_not_available, admin_required
errorobjectrequiredrequest_idstringrequiredPossible codes: resource_not_found
errorobjectrequiredrequest_idstringrequiredPossible codes: conflict, result_not_ready, idempotency_key_reused
errorobjectrequiredrequest_idstringrequiredPossible codes: result_expired
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large_for_plan
errorobjectrequiredrequest_idstringrequiredPossible codes: rate_limited
errorobjectrequiredrequest_idstringrequiredPossible codes: internal_error
errorobjectrequiredrequest_idstringrequiredPossible codes: service_unavailable
errorobjectrequiredrequest_idstringrequired