Skip to content
GitmoapAPIBeta
Organizeaccess
POST/repositories/{repo_id}/access/limits

Cap someone on a repository, whatever they are granted.

create_repo_access_limit
  • access:administer
    A token needs the access:administer scope: Limit access, and stop a group or repository inheriting itEvery operation this scope unlocks
  • Audited · mutation

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

  • Quota · limits per scope

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

  • Dry run
    Takes dry_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 repository, and the answer warns when that is the case. Only the repository's owners may call it. The answer says who the limit narrows; with dry_run=true nothing changes.

Parameters

Path
  • repo_idRepositoryId (string · uuid)Repository ID
Query
  • dry_runbooleanoptionalSay who would be narrowed, and change nothing

Request body

application/json
  • ceilingCeilingRef
  • reasonGrantReason (string) or nulloptionalWhy the limit exists — shown beside it, and in access reviews.
Request body exampleSynthesized example
{
"ceiling": {
"builtin": "guest"
},
"subject": {
"principal": "76e246a3-8e3f-418c-9981-84707ab9e7da"
}
}

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.
    • created_atstring · date-time
    • limit_idLimitId (string · uuid)
    • 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
    • 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.
      • 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 changes stops 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-3641",
"type": "group"
},
"created_at": "2026-10-14T21:09:27Z",
"limit_id": "3254ba61-ca24-4d3f-a3ca-0dd73cd94300",
"subject": {
"principal": {
"id": "fc88be15-aeab-4069-9949-1cef4197b4d3",
"kind": "user",
"username": "mara",
"avatar_url": "https://gitmoap.example/acme/d3f711c3"
}
},
"ceiling": {
"name": "payments-api",
"rank": "guest",
"builtin": "guest",
"custom": "6fff2e6f-f720-4617-acc4-4440a21f2619"
},
"created_by": {
"email": "tomas@acme.example",
"id": "id-7b83",
"username": "mara",
"avatar_url": "https://gitmoap.example/acme/9d08caac"
},
"reason": "reason-1075"
},
"preview": {
"changes": [
{
"gains": [],
"losses": [],
"principal": {
"id": "6cc3d07a-7130-4748-a8e7-1647429c4a38",
"kind": "user",
"username": "mara"
},
"scope": {
"full_path": "acme/payments-api",
"id": "id-7bbf",
"type": "group"
}
},
{
"gains": [],
"losses": [],
"principal": {
"id": "91d0aa41-9c89-416a-b7a6-40d51e515928",
"kind": "user",
"username": "mara"
},
"scope": {
"full_path": "acme/payments-api",
"id": "id-852f",
"type": "group"
}
}
],
"summary": {
"people_gaining": 12,
"people_losing": 15,
"scopes_affected": 85
},
"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.
    • created_atstring · date-time
    • limit_idLimitId (string · uuid)
    • 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
    • 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.
      • 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 changes stops 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-d494",
"type": "group"
},
"created_at": "2026-10-16T23:47:15Z",
"limit_id": "f1a6e436-d6be-4fb1-b7e2-4a47a79c1315",
"subject": {
"principal": {
"id": "0cc2ea8f-343c-4339-8af1-77e75a74c84d",
"kind": "user",
"username": "tomas",
"avatar_url": "https://gitmoap.example/acme/7cdfde9a"
}
},
"ceiling": {
"name": "payments-api",
"rank": "guest",
"builtin": "guest",
"custom": "ae45d4cf-570d-4807-a96c-9d28accc7f9e"
},
"created_by": {
"email": "tomas@acme.example",
"id": "id-1867",
"username": "mara",
"avatar_url": "https://gitmoap.example/acme/fa169276"
},
"reason": "reason-a175"
},
"preview": {
"changes": [
{
"gains": [],
"losses": [],
"principal": {
"id": "6cef3d55-3bfe-4ca4-b163-2fd1a9159533",
"kind": "user",
"username": "mara"
},
"scope": {
"full_path": "acme/payments-api",
"id": "id-f5cf",
"type": "group"
}
},
{
"gains": [],
"losses": [],
"principal": {
"id": "8c120708-7981-4a6b-afb2-8838c4d2480e",
"kind": "user",
"username": "lin"
},
"scope": {
"full_path": "acme/payments-api",
"id": "id-220b",
"type": "group"
}
}
],
"summary": {
"people_gaining": 16,
"people_losing": 53,
"scopes_affected": 80
},
"truncated": false
},
"warnings": [
"limit_cannot_hide_public",
"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 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-f4d0",
"message": "Stream pipeline status into the run header"
}
}
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 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-0dc1",
"message": "Inline scalar newtypes but keep their brand"
}
}
403Only the owners of the repository can limit access hereapplication/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-bd34",
"message": "Draw the region map from operation density"
}
}
404Repository, 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 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-8e04",
"message": "Inline scalar newtypes but keep their brand"
}
}
409The subject is already limited hereapplication/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-8e34",
"message": "Pin a page's payload to the build that rendered it"
}
}
429Limit cap reached for this repositoryapplication/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-aafd",
"message": "Stream pipeline status into the run header"
}
}

CLI

gitmoap access create-repo-access-limit

  • --repo-ididRepository ID (id or owner/repo path)
  • --dry-runflagoptionalSay who would be narrowed, and change nothing
  • --ceilingjson
  • --reasonstringoptional
  • --subjectjson

Used in these guides