gitpublish module route (requires gitpublish:push:write)
const url = 'https://example.com/v1/m/gitpublish/targets/example/pushes';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"acknowledge_intent":"example","commit":"example","expected_old":"example","operation_id":"example","ref":"example","session_run":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","tree":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/m/gitpublish/targets/example/pushes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "acknowledge_intent": "example", "commit": "example", "expected_old": "example", "operation_id": "example", "ref": "example", "session_run": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "tree": "example" }'Pushes one exact commit to a branch under the target’s push prefix, leased on the branch’s expected current value, and returns the publication intent with its receipt.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Path parameter id.
Header Parameters
Section titled “ Header Parameters ”Target tenant id; required when the principal can act in more than one tenant.
Request Body required
Section titled “ Request Body required ”The handler decodes one strict JSON document, bounded at 1 MiB; an unknown field is field_not_accepted.
object
Names an abandoned intent of the same scope this request knowingly proceeds past; requires target admin at AAL3.
The exact commit.
The lease: the ref’s expected current value; empty requires the ref to be absent.
Client idempotency key.
A branch under push_prefix. A merge base, the host’s default branch and any branch the host reports as protected are refused; tags are refused.
A session run in the target’s workspace whose folder holds the commit; the engine fetches the commit from it into the server repository first. Never a path.
The commit’s tree, checked in the server repository.
Example generated
{ "acknowledge_intent": "example", "commit": "example", "expected_old": "example", "operation_id": "example", "ref": "example", "session_run": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "tree": "example"}Responses
Section titled “ Responses ”OK
object
Example generated
{}Bad request
object
Example generated
{}Unauthenticated
object
Example generated
{}Forbidden
object
Example generated
{}Not found
object
Example generated
{}Conflict / setup required
object
Example generated
{}Rate limited
object
Example generated
{}