Skip to content
GitmoapAPIBeta
Agentsai-org
POST/ai-gates/{gate_id}/decision

Approve or deny the exact action a gate waits on, with a note for the agent.

decide_ai_gate
  • 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"}

An approval lets the agent take that action once — the same merge request at the same head, the same message, word for word — and nothing else; the agent's session resumes and takes it. A denial is final for the session, which reads the note and goes on without it. Deciding needs ai_org.approve on the organization's top-level group, and a person named as the gate's approver or on the board. Deciding again the same way changes nothing; a different decision on a decided gate is refused.

Parameters

Path
  • gate_idAiGateId (string · uuid)The gate

Request body

application/json
  • decisionAiGateDecisionapprovedenyApprove or deny the exact action the gate names.
  • noteGateNote (string) or nulloptionalWhat the agent should know about the decision, at most 2,000 characters.
Request body exampleSynthesized example
{
"decision": "approve"
}

Responses

200The decided gateapplication/json
  • approversarray of ActorSummaryThe people named to decide it; empty means the organization's board.
    • 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.
  • decide_bystring · date-timeWhen it expires if nobody decides it.
  • gate_idAiGateId (string · uuid)The gate.
  • kindAiGateKindmerge_protectedmerge_unprotectedlarge_changeadd_dependencycreate_work_itemclose_work_itemreleasedeploy_non_productiondeploy_productionexternal_messagesession_spendprivileged_pathritual_outcomeWhich gate of the catalogue it is.
  • org_idAiOrgId (string · uuid)The organization it belongs to.
  • requested_atstring · date-timeWhen it was raised.
  • stateAiGateStatependingapproveddeniedexpiredwithdrawnconsumednotifiedWhere it stands.
  • subjectobjectThe exact action waiting — what a decision applies to and nothing else.
  • agentActorSummary or nulloptionalThe agent whose action it is.
    • 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.
  • bodystring or nulloptionalThe exact text an outgoing write would publish, for an external_message gate.
  • consumed_atstring · date-time or nulloptionalWhen the approved action was taken.
  • decided_atstring · date-time or nulloptionalWhen it was decided.
  • decided_byActorSummary or nulloptionalWho decided it.
    • 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.
  • decision_notestring or nulloptionalWhat the person who decided it wrote for the agent.
  • ritual_run_idAiRitualRunId (string · uuid) or nulloptionalThe ritual run whose outcome waits on it.
  • session_idAiSessionId (string · uuid) or nulloptionalThe session waiting on it; absent for a ritual's outcome.
200 exampleSynthesized example
{
"approvers": [
{
"email": "tomas@acme.example",
"id": "id-693a",
"username": "lin"
}
],
"decide_by": "b7e2d1c0-9f8e-4d7c-a6b5-c4d3e2f1a0b9",
"gate_id": "5959aae6-05f5-4c08-b746-9dfc93933713",
"kind": "merge_protected",
"org_id": "de8464bc-8a0d-415b-a2a1-c6d8f7c94bbe",
"requested_at": "2026-10-11T21:23:01Z",
"state": "pending",
"subject": {},
"agent": {
"email": "tomas@acme.example",
"id": "id-0e0a",
"username": "tomas",
"avatar_url": "https://gitmoap.example/acme/ec91328f",
"kind": "user"
},
"body": "Renders each region as density contours of its operations.",
"consumed_at": "2026-10-08T13:35:03Z",
"decided_at": "2026-10-13T21:15:45Z",
"decided_by": {
"email": "lin@acme.example",
"id": "id-c8e3",
"username": "tomas",
"avatar_url": "https://gitmoap.example/acme/c19df9fd",
"kind": "user"
},
"decision_note": "decision-note-5473",
"ritual_run_id": "d64a72c8-08fd-4d54-b53f-6101cbe3c11d",
"session_id": "93ddad32-f081-4523-8faa-fad80061a902"
}
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-df46",
"message": "Stream pipeline status into the run header"
}
}
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-8ef6",
"message": "Inline scalar newtypes but keep their brand"
}
}
403You may not decide this gateapplication/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
  • NOT_AN_APPROVERYou may not approve this step
  • 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-0912",
"message": "Stream pipeline status into the run header"
}
}
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-ea32",
"message": "Pin a page's payload to the build that rendered it"
}
}
409The gate was already decided otherwise, has expired, was withdrawn or was spentapplication/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-efbd",
"message": "Inline scalar newtypes but keep their brand"
}
}

CLI

gitmoap ai-org decide-ai-gate

  • --gate-ididThe gate
  • --decisionapprove | denyApprove or deny the exact action the gate names.
  • --notestringoptional