Organizeaccess
POST/groups/{group_id}/access/limits
Cap someone on a group and everything beneath it, whatever they are granted.
create_group_access_limit
access:administer
A token needs theaccess:administerscope: Limit access, and stop a group or repository inheriting itEvery operation this scope unlocksAudited · mutation
x-gitmoap-audit: {"kind":"audited","arg":"mutation"}
Quota · limits per scope
x-gitmoap-quota: {"kind":"enforced","arg":"limits_per_scope"}
Dry run
Takesdry_run.
The subject is a person, a team, or a whole class (everyone, service accounts, agents); the
ceiling is a built-in role, a custom role, or no access at all. A no-access limit cannot hide a
public or internal group, and the answer warns when that is the case. Only the group's owners
may call it. The answer says who the limit narrows; with dry_run=true nothing changes.
Parameters
Path
- group_idGroupId (string · uuid)Group ID
Query
- dry_runbooleanoptionalSay who would be narrowed, and change nothing
Request body
application/json- ceilingCeilingRef
- subjectLimitSubjectRef
- reasonGrantReason (string) or nulloptionalWhy the limit exists — shown beside it, and in access reviews.
Request body exampleSynthesized example
{
"ceiling": {
"builtin": "guest"
},
"subject": {
"principal": "8964ff63-c5d2-4936-a995-606f8e3b0d57"
}
}
Responses
200A preview: who the limit would narrow. Nothing was changedapplication/json
limitAccessLimit
- The AccessLimit schema
atAccessScopeWhere the limit is set. It caps its subject there and everywhere beneath, including beneath a group or repository that does not inherit access.
- The AccessScope schema
- full_pathstring
- idstring
- typeScopeTypegrouprepository
- created_atstring · date-time
- limit_idLimitId (string · uuid)
- subjectLimitSubjectEntry
ceilingRoleView or nulloptionalThe most the subject may hold. Absent when the limit allows nothing at all.
- The RoleView schema
- namestringThe role's display name: a built-in name such as
Developer, or the custom role's name. - rankAccessLevelguestreporterdevelopermaintainerownerThe built-in rank the role counts as wherever a rank is compared, such as a protected branch's minimum.
- builtinAccessLevelguestreporterdevelopermaintainerowneror nulloptionalSet when the role is built in.
- customRoleId (string · uuid) or nulloptionalSet when the role is one the organization defined.
created_byActorSummary or nulloptional
- The ActorSummary schema
- emailstring
- idstring
- usernamestring
- avatar_urlstring or nulloptional
- reasonstring or nulloptional
previewAccessPreview or nulloptional
- The AccessPreview schema
changesarray of AccessDeltaEach person whose access would change at the group or repository the change is made on.
- The AccessDelta schema
- gainsarray of stringPermissions they would hold that they do not hold now, by key.
- lossesarray of stringPermissions they hold now that they would no longer hold, by key.
- principalPrincipalSummary
- scopeAccessScope
- rank_afterAccessLevelguestreporterdevelopermaintainerowneror nulloptional
- rank_beforeAccessLevelguestreporterdevelopermaintainerowneror nulloptional
summaryAccessPreviewSummary
- The AccessPreviewSummary schema
- people_gaininginteger · int320–∞
- people_losinginteger · int320–∞
- scopes_affectedinteger · int64The group or repository the change is made on, plus every one beneath it that inherits access and so changes with it.
- truncatedbooleanWhether
changesstops short of everyone affected. The summary still counts them all.
- warningsarray of LimitWarning: one of limit_cannot_hide_publicoptional
200 exampleSynthesized example
{
"limit": {
"at": {
"full_path": "acme/payments-api",
"id": "id-41cf",
"type": "group"
},
"created_at": "2026-10-13T14:31:13Z",
"limit_id": "e11a8dbb-42df-49cf-8d15-50f3dade6f93",
"subject": {
"principal": {
"id": "2e75ed1f-bc48-4a8a-8967-f9dc88bf603f",
"kind": "user",
"username": "tomas",
"avatar_url": "https://gitmoap.example/acme/e734409e"
}
},
"ceiling": {
"name": "payments-api",
"rank": "guest",
"builtin": "guest",
"custom": "dce9f907-9ff4-4f3f-a876-7000449bb7b4"
},
"created_by": {
"email": "mara@acme.example",
"id": "id-2bf3",
"username": "tomas",
"avatar_url": "https://gitmoap.example/acme/36c8ffe9"
},
"reason": "reason-d24a"
},
"preview": {
"changes": [
{
"gains": [],
"losses": [],
"principal": {
"id": "9502f2d6-7a50-4eec-a570-bdba3c641aef",
"kind": "user",
"username": "mara"
},
"scope": {
"full_path": "acme/payments-api",
"id": "id-5454",
"type": "group"
}
},
{
"gains": [],
"losses": [],
"principal": {
"id": "b9ce1b7b-8d3e-4009-82ad-6f4348a45ae4",
"kind": "user",
"username": "lin"
},
"scope": {
"full_path": "acme/payments-api",
"id": "id-6443",
"type": "group"
}
}
],
"summary": {
"people_gaining": 86,
"people_losing": 83,
"scopes_affected": 52
},
"truncated": false
},
"warnings": [
"limit_cannot_hide_public"
]
}
201The limit, and who it narrowedapplication/json
limitAccessLimit
- The AccessLimit schema
atAccessScopeWhere the limit is set. It caps its subject there and everywhere beneath, including beneath a group or repository that does not inherit access.
- The AccessScope schema
- full_pathstring
- idstring
- typeScopeTypegrouprepository
- created_atstring · date-time
- limit_idLimitId (string · uuid)
- subjectLimitSubjectEntry
ceilingRoleView or nulloptionalThe most the subject may hold. Absent when the limit allows nothing at all.
- The RoleView schema
- namestringThe role's display name: a built-in name such as
Developer, or the custom role's name. - rankAccessLevelguestreporterdevelopermaintainerownerThe built-in rank the role counts as wherever a rank is compared, such as a protected branch's minimum.
- builtinAccessLevelguestreporterdevelopermaintainerowneror nulloptionalSet when the role is built in.
- customRoleId (string · uuid) or nulloptionalSet when the role is one the organization defined.
created_byActorSummary or nulloptional
- The ActorSummary schema
- emailstring
- idstring
- usernamestring
- avatar_urlstring or nulloptional
- reasonstring or nulloptional
previewAccessPreview or nulloptional
- The AccessPreview schema
changesarray of AccessDeltaEach person whose access would change at the group or repository the change is made on.
- The AccessDelta schema
- gainsarray of stringPermissions they would hold that they do not hold now, by key.
- lossesarray of stringPermissions they hold now that they would no longer hold, by key.
- principalPrincipalSummary
- scopeAccessScope
- rank_afterAccessLevelguestreporterdevelopermaintainerowneror nulloptional
- rank_beforeAccessLevelguestreporterdevelopermaintainerowneror nulloptional
summaryAccessPreviewSummary
- The AccessPreviewSummary schema
- people_gaininginteger · int320–∞
- people_losinginteger · int320–∞
- scopes_affectedinteger · int64The group or repository the change is made on, plus every one beneath it that inherits access and so changes with it.
- truncatedbooleanWhether
changesstops short of everyone affected. The summary still counts them all.
- warningsarray of LimitWarning: one of limit_cannot_hide_publicoptional
201 exampleSynthesized example
{
"limit": {
"at": {
"full_path": "acme/payments-api",
"id": "id-fbf0",
"type": "group"
},
"created_at": "2026-10-11T00:20:10Z",
"limit_id": "eb3ddbd4-5bdd-4d77-b75f-b743e01c56f5",
"subject": {
"principal": {
"id": "563fecb9-69d1-4732-9530-c1fd1af84716",
"kind": "user",
"username": "lin",
"avatar_url": "https://gitmoap.example/acme/0c4c7f2e"
}
},
"ceiling": {
"name": "payments-api",
"rank": "guest",
"builtin": "guest",
"custom": "dfa56162-ed33-4dcb-88b1-39a12be37946"
},
"created_by": {
"email": "mara@acme.example",
"id": "id-730c",
"username": "tomas",
"avatar_url": "https://gitmoap.example/acme/f2bc3722"
},
"reason": "reason-17f6"
},
"preview": {
"changes": [
{
"gains": [],
"losses": [],
"principal": {
"id": "10d43a01-b81e-41e4-9603-1d6415b0e047",
"kind": "user",
"username": "mara"
},
"scope": {
"full_path": "acme/payments-api",
"id": "id-6c7e",
"type": "group"
}
},
{
"gains": [],
"losses": [],
"principal": {
"id": "c85b0e88-c8e6-4084-80c3-ddb2e748d131",
"kind": "user",
"username": "tomas"
},
"scope": {
"full_path": "acme/payments-api",
"id": "id-a4f6",
"type": "group"
}
}
],
"summary": {
"people_gaining": 86,
"people_losing": 21,
"scopes_affected": 89
},
"truncated": false
},
"warnings": [
"limit_cannot_hide_public"
]
}
400Invalid requestapplication/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
reasonorcode. - fieldstring or nulloptionalOn a
400that 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 oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): 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-a9ef",
"message": "Inline scalar newtypes but keep their brand"
}
}
401Authentication requiredapplication/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
reasonorcode. - fieldstring or nulloptionalOn a
400that 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 oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): 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-6331",
"message": "Draw the region map from operation density"
}
}
403Only the owners of the group can limit access hereapplication/json
Error codes
- FORBIDDENYou are signed in but may not do this here;
reasonnames the permission or the rule that refused it - INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs;
required_scopenames 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
reasonorcode. - fieldstring or nulloptionalOn a
400that 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 oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): 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-435e",
"message": "Pin a page's payload to the build that rendered it"
}
}
404Group, role or subject not foundapplication/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
reasonorcode. - fieldstring or nulloptionalOn a
400that 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 oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): 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-982a",
"message": "Draw the region map from operation density"
}
}
409The subject is already limited hereapplication/json
Error codes
- CONFLICTThe request conflicts with the resource's current state;
reasonsays 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
reasonorcode. - fieldstring or nulloptionalOn a
400that 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 oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): 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-02a9",
"message": "Pin a page's payload to the build that rendered it"
}
}
429Limit cap reached for this groupapplication/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
reasonorcode. - fieldstring or nulloptionalOn a
400that 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 oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): 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-362d",
"message": "Pin a page's payload to the build that rendered it"
}
}
CLI
gitmoap access create-group-access-limit
- --group-ididGroup ID (id or group path)
- --dry-runflagoptionalSay who would be narrowed, and change nothing
- --ceilingjson
- --reasonstringoptional
- --subjectjson