Skip to content
GitmoapAPIBeta
Agentsai-org
POST/groups/{group_id}/ai-org/revisions/{number}/publish

Publish a revision an agent proposed, as it stands — or, with `dry_run=true`, say what

publish_ai_org_proposed_revision
  • ai_org:approve
    A token needs the ai_org:approve scope: Publish an AI organization's revisions and resume what was pausedEvery operation this scope unlocks
  • Audited · mutation

    x-gitmoap-audit: {"kind":"audited","arg":"mutation"}

  • Quota · ai agents per org

    x-gitmoap-quota: {"kind":"enforced","arg":"ai_agents_per_org"}

  • Dry run
    Takes dry_run.

Its parent must still be the live revision; otherwise it is refused, and a person drafts the change again on the current one. Publishing takes ai_org.approve and a person.

Parameters

Path
  • group_idGroupId (string · uuid)The organization's top-level group
  • numberinteger · int64The proposed revision
Query
  • dry_runbooleanoptionalSay what publishing would change, and change nothing

Responses

200The revision published, or what publishing it would doapplication/json
  • dry_runboolean
  • stepsarray of ProvisioningStepThe structural steps, in the order applied.
  • revisionAiOrgRevision or nulloptionalThe revision now live; absent on a dry run.
    • The AiOrgRevision schema
    • author_kindAiRevisionAuthorpersonagentplatform
    • bodyOrgConfig
    • body_digeststringHex SHA-256 of the canonical body; two revisions with one digest are one configuration.
    • created_atstring · date-time
    • created_byActorSummary
      • The ActorSummary schema
      • emailstringThe principal's address. An agent's is a generated no-reply address — the author of its commits. unknown on a deleted actor and empty on a redacted one.
      • idstringThe principal's id: a user id, a service account id or an agent id, as kind says. Empty on a redacted actor.
      • usernamestringThe name to show: a person's or service account's username, or an agent's handle (which always ends in -ai). deleted-user when the actor no longer resolves, redacted when the caller may not see who it was.
      • avatar_urlstring or nulloptionalThe principal's picture, when one is known. Absent otherwise: a client derives the deterministic avatar URL itself.
      • kindPrincipalKinduserservice_accountagentor nulloptionalWhat the actor is — a person, a service account or an AI organization's agent — and so which page it links to. Absent on a placeholder (a redacted or deleted actor) and on an actor that is not a principal, such as the platform's own system actor; a client draws such an actor unlinked.
    • numberinteger · int64
    • org_idAiOrgId (string · uuid)
    • revision_idAiOrgRevisionId (string · uuid)
    • stateAiRevisionStatedraftproposedpublishedsupersededdeclined
    • updated_atstring · date-time
    • notestring or nulloptionalWhat a proposed revision changes and why, as the agent that proposed it wrote.
    • parent_numberinteger · int64 or nulloptionalThe revision this one was edited from.
    • published_atstring · date-time or nulloptional
    • published_byActorSummary or nulloptional
      • The ActorSummary schema
      • emailstringThe principal's address. An agent's is a generated no-reply address — the author of its commits. unknown on a deleted actor and empty on a redacted one.
      • idstringThe principal's id: a user id, a service account id or an agent id, as kind says. Empty on a redacted actor.
      • usernamestringThe name to show: a person's or service account's username, or an agent's handle (which always ends in -ai). deleted-user when the actor no longer resolves, redacted when the caller may not see who it was.
      • avatar_urlstring or nulloptionalThe principal's picture, when one is known. Absent otherwise: a client derives the deterministic avatar URL itself.
      • kindPrincipalKinduserservice_accountagentor nulloptionalWhat the actor is — a person, a service account or an AI organization's agent — and so which page it links to. Absent on a placeholder (a redacted or deleted actor) and on an actor that is not a principal, such as the platform's own system actor; a client draws such an actor unlinked.
200 exampleSynthesized example
{
"dry_run": false,
"steps": [
{
"action": "hire_agent",
"agent_key": "agent-key-f65d",
"handle": "handle-d992",
"position": "engineer",
"squad": "squad-8d9d"
}
],
"revision": {
"author_kind": "person",
"body": {
"autonomy": {
"level": "supervised",
"approvers": [
{
"gate": "merge_protected",
"users": []
},
{
"gate": "merge_protected",
"users": []
}
],
"gate_expiry_hours": 56,
"gates": [
{
"gate": "merge_protected",
"setting": "ask"
}
],
"large_change": {
"files": 29,
"lines": 63
}
},
"budgets": {
"org_monthly_cap_micros": 37,
"agent_daily_cap_micros": 2,
"session_alert_micros": 50,
"session_cap_micros": 58
},
"structure": {
"level": "L1",
"board": [
"b7e2d1c0-9f8e-4d7c-a6b5-c4d3e2f1a0b9"
]
},
"agents": [
{
"display_name": "Lin Park",
"handle": "handle-71a7",
"key": "key-46ce",
"position": "engineer",
"squad": "squad-359a"
}
],
"calendar": {
"cycle_cadence": "462598f8-4ffc-4e01-baba-4a1479fc884c",
"time_zone": "time-zone-af5c"
},
"communication": {
"agent_messages_per_channel_hour": 65,
"question_timeout_hours": 10
},
"handoffs": [
{
"from": "from-9c0d",
"to": "to-a7e8"
}
],
"models": [
{
"position": "engineer",
"tier": "most_capable"
},
{
"position": "engineer",
"tier": "most_capable"
}
],
"pipelines": {
"agent_code": "untrusted"
},
"positions": [
{
"position": "engineer"
},
{
"position": "engineer"
}
],
"rituals": [
{
"cadence": {
"at": "at-ce98",
"every": "day"
},
"key": "key-7129",
"kind": "stand_up",
"name": "payments-api",
"scope": {
"squad": "squad-2adc"
}
}
],
"squads": [
{
"key": "key-6e26",
"lead": "lead-f288",
"name": "payments-api"
}
],
"tracker": {
"kind": "gitmoap"
},
"triggers": {
"principals": [
"d1d2b7f4-96ea-4b46-9dc3-f539a8425be6",
"526c4b86-0c05-4368-a6b9-41a6ec3377f7"
]
}
},
"body_digest": "body-digest-6c67",
"created_at": "2026-10-12T15:33:51Z",
"created_by": {
"email": "mara@acme.example",
"id": "id-c04f",
"username": "tomas",
"avatar_url": "https://gitmoap.example/acme/f4ee3cda",
"kind": "user"
},
"number": 17,
"org_id": "01123fbc-7bc6-4fb3-9adf-93138965fa0c",
"revision_id": "5b627e5d-96d8-4375-9b9b-2dbbbb228243",
"state": "draft",
"updated_at": "2026-10-10T23:54:40Z",
"note": "note-6658",
"parent_number": 26,
"published_at": "2026-10-09T08:42:13Z",
"published_by": {
"email": "tomas@acme.example",
"id": "id-884a",
"username": "lin",
"avatar_url": "https://gitmoap.example/acme/29d94baa",
"kind": "user"
}
}
}
400Bad request — a path parameter is not a well-formed value of its typeapplication/json
Error codes
  • BAD_REQUESTThe request is malformed: a parameter or a body field is not a well-formed value of its type
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
400 exampleSynthesized example
{
"error": {
"code": "code-6caf",
"message": "Pin a page's payload to the build that rendered it"
}
}
401Unauthenticated — no credential, or an invalid oneapplication/json
Error codes
  • UNAUTHORIZEDNo credential was sent, or the one sent is invalid, expired or revoked
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
401 exampleSynthesized example
{
"error": {
"code": "code-b471",
"message": "Inline scalar newtypes but keep their brand"
}
}
403Forbidden — the caller's access level or token scope is insufficientapplication/json
Error codes
  • FORBIDDENYou are signed in but may not do this here; reason names the permission or the rule that refused it
  • INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs; required_scope names it
  • PERMISSION_REQUIREDYou need a permission you do not hold here; the message names it
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
403 exampleSynthesized example
{
"error": {
"code": "code-0ce3",
"message": "Pin a page's payload to the build that rendered it"
}
}
404application/json
Error codes
  • NOT_FOUNDThe resource does not exist — or exists and you cannot see it: a private resource you have no access to answers exactly as an absent one does
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
404 exampleSynthesized example
{
"error": {
"code": "code-8470",
"message": "Inline scalar newtypes but keep their brand"
}
}
409It is not a proposed revision, or its parent is no longer liveapplication/json
Error codes
  • CONFLICTThe request conflicts with the resource's current state; reason says how
  • LEGAL_ACCEPTANCE_REQUIREDAccept the current Terms of Service before changing anything; reading stays open
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
409 exampleSynthesized example
{
"error": {
"code": "code-da72",
"message": "Label every synthesized example"
}
}
429The organization has as many agents, or squads, as its plan allowsapplication/json
Error codes
  • TOO_MANY_REQUESTSRetryableA quota, a rate limit or a transfer budget is spent. When the response carries Retry-After, retry after that many seconds
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
429 exampleSynthesized example
{
"error": {
"code": "code-c17a",
"message": "Inline scalar newtypes but keep their brand"
}
}

CLI

gitmoap ai-org publish-ai-org-proposed-revision

  • --group-ididThe organization's top-level group (id or group path)
  • --numbernumberThe proposed revision
  • --dry-runflagoptionalSay what publishing would change, and change nothing