Organizeroles
GET/groups/{group_id}/roles
An organization's custom roles.
list_roles
role:read
A token needs therole:readscope: See an organization's custom roles and where they are usedGranted byread_api,write_api.Every operation this scope unlocksSingle-resource
x-gitmoap-isolation: {"kind":"single_or_self_scoped"}
Paginated
Pass thenext_tokena page returns to get the next one.
Only members of the organization can read it.
Parameters
Path
- group_idGroupId (string · uuid)The organization's top-level group
Query
- limitinteger · int64optionalMaximum number of roles, 1-100 (default 50)
- next_tokenstringoptionalPagination token
Responses
200The organization's custom roles, oldest firstapplication/json
rolesarray of CustomRole
- The CustomRole schema
- addedarray of stringPermissions added to the base, by key.
- base_roleAccessLevelguestreporterdevelopermaintainerownerThe built-in role this one starts from, and whose rank it counts as wherever a rank is compared, such as a protected branch's minimum.
- created_atstring · date-time
- descriptionstring
- namestring
- organization_idGroupId (string · uuid)The organization's top-level group.
- permissionsarray of stringEverything the role holds: the base, the additions and what they need, less the removals.
- removedarray of stringPermissions removed from the base, by key.
- role_idRoleId (string · uuid)
- slugEntityName (string)
- updated_atstring · date-time
created_byActorSummary or nulloptional
- The ActorSummary schema
- emailstring
- idstring
- usernamestring
- avatar_urlstring or nulloptional
- next_tokenstring or nulloptional
200 exampleSynthesized example
{
"roles": [
{
"added": [],
"base_role": "guest",
"created_at": "2026-10-12T09:13:19Z",
"description": "Renders each region as density contours of its operations.",
"name": "payments-api",
"organization_id": "4c1d8e2f-6a3b-4f90-b7c5-1e2d3c4b5a69",
"permissions": [],
"removed": [],
"role_id": "037324f9-041c-4bfa-9935-672794590d6d",
"slug": "slug-c9a8",
"updated_at": "2026-10-15T15:24:27Z"
}
],
"next_token": "next-token-726c"
}
400Invalid pagination token, or the group is not an organization's top-level groupapplication/json
Error codes
- BAD_REQUESTThe request is malformed: a parameter or a body field is not a well-formed value of its type
- NOT_AN_ORGANIZATIONOnly an organization — a top-level group — has teams and custom roles, and a name that can be reclaimed or held for 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.
400 exampleSynthesized example
{
"error": {
"code": "code-7a48",
"message": "Label every synthesized example"
}
}
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-83c7",
"message": "Draw the region map from operation density"
}
}
403Only members of the organization see its rolesapplication/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-d983",
"message": "Inline scalar newtypes but keep their brand"
}
}
404Group 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-71b1",
"message": "Inline scalar newtypes but keep their brand"
}
}
CLI
gitmoap roles list-roles
- --group-ididThe organization's top-level group (id or group path)
- --limitnumberoptionalMaximum number of roles, 1-100 (default 50)
- --next-tokenstringoptionalPagination token