Skip to content
GitmoapAPIBeta
Agentsai-org
PUT/groups/{group_id}/ai-org/revisions/draft

Write the organization's one draft revision, replacing it whole.

put_ai_org_revision_draft
  • ai_org:manage
    A token needs the ai_org:manage scope: Configure and operate an AI organization: drafts, pausing, suspending, sessionsGranted by write_api.Every operation this scope unlocks
  • Audited · mutation

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

  • Quota · ai revision drafts per org per day

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

The draft is the organization's whole configuration — structure, squads, agents, autonomy, budgets, models and triggers — and is checked on every write: an unsound one is refused with every problem listed. A revision is at most 256 KiB, and the number of drafts written per day is capped. Maintainers and above of the top-level group may write it; nothing changes for the agents until it is published.

Parameters

Path
  • group_idGroupId (string · uuid)The organization's top-level group

Request body

application/json
  • bodyOrgConfig
    • The OrgConfig schema
    • autonomyAutonomyConfig
      • The AutonomyConfig schema
      • levelAutonomyLevelsupervisedgatedautonomousHow much an organization may do without asking: a named preset for every gate, each of which can still be set on its own.
      • gatesarray of GateOverrideoptional
    • budgetsBudgets
      • The Budgets schema
      • org_monthly_cap_microsinteger · int640–∞All model usage and fees of the organization per calendar month in UTC. Required.
      • agent_daily_cap_microsinteger · int64 or nulloptional0–∞
      • session_cap_microsinteger · int64 or nulloptional0–∞
    • structureOrgStructure
      • The OrgStructure schema
      • levelStructureLevelL1L2L3The organization's shape: L1 is engineers in one squad, L2 adds squads each led by a product owner, L3 adds a director across the squads.
      • boardarray of UserId (string · uuid)optionalBesides the root group's Owners, who are always on it.
    • agentsarray of AgentConfigoptional
      • The AgentConfig schema
      • display_nameAgentDisplayName (string)
      • handleAgentHandle (string)
      • keyAgentKey (string)
      • positionPositionengineerreviewerproduct_ownerdirectorrelease_managertechnical_writerAn agent's job, which decides what it may do and which model tier it uses by default.
      • squadSquadKey (string)
      • profileAgentProfileoptional
      • specialisationSpecialisationbackendfrontendinfrastructurecli_and_toolingqualityor nulloptionalAn engineer's specialisation, which shapes the work it is given.
      • wip_limitinteger · int32 or nulloptional0–∞
    • modelsarray of PositionRoutingoptionalPinned.
      • The PositionRouting schema
      • positionPositionengineerreviewerproduct_ownerdirectorrelease_managertechnical_writerAn agent's job, which decides what it may do and which model tier it uses by default.
      • tierAiModelTiermost_capablestandardeconomicalA model tier: the most capable, the standard, or the economical model in the organization's region.
      • modelAiModelKey (string) or nulloptionalAn exact model, which stays exact until the provider retires it.
    • pipelinesPipelinePolicyoptionalOrdered.
      • The PipelinePolicy schema
      • agent_codeAgentCodeTrustuntrustedtrustedoptionalWhether a run of code an agent wrote, or a run an agent started, gets the repository's connections, secrets, cloud roles and build cache.
    • squadsarray of SquadConfigoptional
      • The SquadConfig schema
      • keySquadKey (string)
      • leadAgentKey (string)
      • nameSquadName (string)
      • repositoriesarray of RepositoryId (string · uuid)optional
    • trackerTrackerConfigoptional
    • triggersTriggerAllowListoptional
Request body exampleSynthesized example
{
"body": {
"autonomy": {
"level": "supervised"
},
"budgets": {
"org_monthly_cap_micros": 53
},
"structure": {
"level": "L1"
}
}
}

Responses

200The draftapplication/json
  • author_kindAiRevisionAuthorpersonagentplatform
  • bodyOrgConfig
    • The OrgConfig schema
    • autonomyAutonomyConfig
      • The AutonomyConfig schema
      • levelAutonomyLevelsupervisedgatedautonomousHow much an organization may do without asking: a named preset for every gate, each of which can still be set on its own.
      • gatesarray of GateOverrideoptional
    • budgetsBudgets
      • The Budgets schema
      • org_monthly_cap_microsinteger · int640–∞All model usage and fees of the organization per calendar month in UTC. Required.
      • agent_daily_cap_microsinteger · int64 or nulloptional0–∞
      • session_cap_microsinteger · int64 or nulloptional0–∞
    • structureOrgStructure
      • The OrgStructure schema
      • levelStructureLevelL1L2L3The organization's shape: L1 is engineers in one squad, L2 adds squads each led by a product owner, L3 adds a director across the squads.
      • boardarray of UserId (string · uuid)optionalBesides the root group's Owners, who are always on it.
    • agentsarray of AgentConfigoptional
      • The AgentConfig schema
      • display_nameAgentDisplayName (string)
      • handleAgentHandle (string)
      • keyAgentKey (string)
      • positionPositionengineerreviewerproduct_ownerdirectorrelease_managertechnical_writerAn agent's job, which decides what it may do and which model tier it uses by default.
      • squadSquadKey (string)
      • profileAgentProfileoptional
      • specialisationSpecialisationbackendfrontendinfrastructurecli_and_toolingqualityor nulloptionalAn engineer's specialisation, which shapes the work it is given.
      • wip_limitinteger · int32 or nulloptional0–∞
    • modelsarray of PositionRoutingoptionalPinned.
      • The PositionRouting schema
      • positionPositionengineerreviewerproduct_ownerdirectorrelease_managertechnical_writerAn agent's job, which decides what it may do and which model tier it uses by default.
      • tierAiModelTiermost_capablestandardeconomicalA model tier: the most capable, the standard, or the economical model in the organization's region.
      • modelAiModelKey (string) or nulloptionalAn exact model, which stays exact until the provider retires it.
    • pipelinesPipelinePolicyoptionalOrdered.
      • The PipelinePolicy schema
      • agent_codeAgentCodeTrustuntrustedtrustedoptionalWhether a run of code an agent wrote, or a run an agent started, gets the repository's connections, secrets, cloud roles and build cache.
    • squadsarray of SquadConfigoptional
      • The SquadConfig schema
      • keySquadKey (string)
      • leadAgentKey (string)
      • nameSquadName (string)
      • repositoriesarray of RepositoryId (string · uuid)optional
    • trackerTrackerConfigoptional
    • triggersTriggerAllowListoptional
  • body_digeststringHex SHA-256 of the canonical body; two revisions with one digest are one configuration.
  • created_atstring · date-time
  • created_byActorSummary
  • numberinteger · int64
  • org_idAiOrgId (string · uuid)
  • revision_idAiOrgRevisionId (string · uuid)
  • stateAiRevisionStatedraftproposedpublishedsupersededdeclined
  • updated_atstring · date-time
  • parent_numberinteger · int64 or nulloptionalThe revision this one was edited from.
  • published_atstring · date-time or nulloptional
  • published_byActorSummary or nulloptional
200 exampleSynthesized example
{
"author_kind": "person",
"body": {
"autonomy": {
"level": "supervised",
"gates": [
{
"gate": "merge_protected",
"setting": "ask"
}
]
},
"budgets": {
"org_monthly_cap_micros": 72,
"agent_daily_cap_micros": 78,
"session_cap_micros": 35
},
"structure": {
"level": "L1",
"board": [
"c9d8e7f6-a5b4-4c3d-9e2f-1a0b9c8d7e6f",
"b7e2d1c0-9f8e-4d7c-a6b5-c4d3e2f1a0b9"
]
},
"agents": [
{
"display_name": "Lin Park",
"handle": "handle-f06c",
"key": "key-fbce",
"position": "engineer",
"squad": "squad-6cc7"
},
{
"display_name": "Mara Okafor",
"handle": "handle-e55c",
"key": "key-fbf0",
"position": "engineer",
"squad": "squad-d3aa"
}
],
"models": [
{
"position": "engineer",
"tier": "most_capable"
}
],
"pipelines": {
"agent_code": "untrusted"
},
"squads": [
{
"key": "key-f4f9",
"lead": "lead-4ac3",
"name": "payments-api"
}
],
"tracker": {
"kind": "gitmoap"
},
"triggers": {
"principals": [
"b3e89226-c962-431e-8acd-eb8d186a3857",
"eb6e0996-0046-4edf-a341-b646accfa071"
]
}
},
"body_digest": "body-digest-fd5b",
"created_at": "2026-10-12T09:35:31Z",
"created_by": {
"email": "lin@acme.example",
"id": "id-7bc3",
"username": "lin",
"avatar_url": "https://gitmoap.example/acme/2f67f162"
},
"number": 17,
"org_id": "67d88c53-bd31-4148-9753-bf49e33f9d6e",
"revision_id": "44ac3618-63a9-49d8-9061-15fad2509426",
"state": "draft",
"updated_at": "2026-10-15T06:24:13Z",
"parent_number": 55,
"published_at": "2026-10-16T02:09:46Z",
"published_by": {
"email": "tomas@acme.example",
"id": "id-4000",
"username": "tomas",
"avatar_url": "https://gitmoap.example/acme/befc40c1"
}
}
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-7b36",
"message": "Inline scalar newtypes but keep their brand"
}
}
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-a670",
"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-ca7b",
"message": "Label every synthesized example"
}
}
404Not found — or found and private, which is masked as absentapplication/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-1198",
"message": "Inline scalar newtypes but keep their brand"
}
}
409The request conflicts with the resource's current state; `reason` says howapplication/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-97fd",
"message": "Stream pipeline status into the run header"
}
}
413The body is larger than a revision may beapplication/json
Error codes
  • 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.
413 exampleSynthesized example
{
"error": {
"code": "code-9310",
"message": "Stream pipeline status into the run header"
}
}
422The body is not a sound configurationapplication/json
Error codes
  • UNPROCESSABLE_ENTITYThe request is well-formed but asks for something the resource's rules do not allow; reason says which
  • 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.
422 exampleSynthesized example
{
"error": {
"code": "code-1004",
"message": "Pin a page's payload to the build that rendered it"
}
}
429Revision draft limit reached for todayapplication/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-ea1a",
"message": "Draw the region map from operation density"
}
}

CLI

gitmoap ai-org put-ai-org-revision-draft

  • --group-ididThe organization's top-level group (id or group path)
  • --bodyjson