Skip to main content
POST
Typescript (SDK)

Authorizations

Authorization
string
header
required

API key in the format: Bearer {api_token}

Headers

Idempotency-Key
string

Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.

Maximum string length: 255

Path Parameters

id
string
required

The resource's ID, as returned in its id field

Body

application/json
message
string
required

The commit message, 1 to 5000 characters.

diff
string
required

A unified diff against main, at most 4 MiB.

expected_head_sha
string

The head_sha your diff is based on (from a source read or your last commit). If main is anywhere else the call fails with 409 stale_head and changes nothing. A prefix of 7 or more characters is accepted.

Response

The commit main now points at

object
enum<string>
required
Available options:
site_source_commit
sha
string
required

The commit main now points at.

previous_sha
string
required

The commit main pointed at before.

changed
boolean
required

False when the operations left every file as it was: no commit was made and sha equals previous_sha.