Skip to content
GitmoapAPIBeta
Organizeteams
GET/teams/{team_id}/usage

Where a team is named besides its grants.

get_team_usage
  • team:read
    A token needs the team:read scope: See an organization's teams, who is on them and what they can doGranted by read_api, write_api.Every operation this scope unlocks
  • Filtered across resources

    x-gitmoap-isolation: {"kind":"cross_resource_filtered"}

The approval rules and environments that make its people approvers, the protected-branch rules that let them push or merge, the services it owns, and the CODEOWNERS lines that make them required reviewers — what someone joining the team also signs up for. A place on a group or repository you cannot see is left out and counted in hidden.

Parameters

Path
  • team_idTeamId (string · uuid)Team ID

Responses

200Where the team is namedapplication/json
  • approval_rulesarray of TeamUsageRule
  • branch_rulesarray of TeamUsageBranchRule
    • The TeamUsageBranchRule schema
    • atAccessScopeThe group or repository the rule protects branches of.
    • branch_patternBranchPattern (string)
    • branch_rule_idBranchRuleId (string · uuid)
    • mergebooleanWhether the team may merge into them.
    • pushbooleanWhether the team may push to the branches the rule protects.
  • codeownersarray of TeamUsageCodeownersLineCODEOWNERS lines naming the team, as each repository's default branch had them at its last push or merge.
    • The TeamUsageCodeownersLine schema
    • atAccessScopeThe repository whose file it is.
    • file_pathstringCODEOWNERS or .gitmoap/CODEOWNERS, on the repository's default branch.
    • lineinteger · int320–∞The line, counting from 1.
    • patternstringThe paths the line covers, as written.
  • environmentsarray of TeamUsageEnvironment
    • The TeamUsageEnvironment schema
    • atAccessScopeThe group or repository that owns the environment.
    • environment_idEnvironmentId (string · uuid)
    • slugEnvironmentSlug (string)
    • tierEnvironmentTierdevelopmenttestingstagingproductionWhat kind of environment this is, whatever it is called: development, testing, staging or production. A production environment is protected by default.
  • hiddenbooleanWhether the team is named somewhere you cannot see.
  • servicesarray of TeamUsageService
  • truncatedbooleanWhether a list stops short: each holds at most 100.
200 exampleSynthesized example
{
"approval_rules": [
{
"at": {
"full_path": "acme/payments-api",
"id": "id-dbc7",
"type": "group"
},
"name": "payments-api",
"rule_id": "7c595e1e-02f9-48f8-b9c5-f76d87033bb1"
},
{
"at": {
"full_path": "acme/payments-api",
"id": "id-27fc",
"type": "group"
},
"name": "payments-api",
"rule_id": "91640498-6175-40e9-90cd-9dfe58ffc6bf"
}
],
"branch_rules": [
{
"at": {
"full_path": "acme/payments-api",
"id": "id-bfd5",
"type": "group"
},
"branch_pattern": "branch-pattern-9626",
"branch_rule_id": "8a2d1784-1cd0-42a6-8d38-8160d02efc57",
"merge": false,
"push": false
},
{
"at": {
"full_path": "acme/payments-api",
"id": "id-b24e",
"type": "group"
},
"branch_pattern": "branch-pattern-076b",
"branch_rule_id": "8ed74143-61fe-46f7-a08c-ab04b089a208",
"merge": false,
"push": false
}
],
"codeowners": [
{
"at": {
"full_path": "acme/payments-api",
"id": "id-2c6b",
"type": "group"
},
"file_path": "file-path-d233",
"line": 39,
"pattern": "pattern-194a"
}
],
"environments": [
{
"at": {
"full_path": "acme/payments-api",
"id": "id-cd72",
"type": "group"
},
"environment_id": "ca13d52b-7b8f-4f9b-b5f7-aede114bb714",
"slug": "slug-345a",
"tier": "development"
},
{
"at": {
"full_path": "acme/payments-api",
"id": "id-1ad5",
"type": "group"
},
"environment_id": "34787a4e-f2d4-411c-8bf7-5cd556b33cdb",
"slug": "slug-55c2",
"tier": "development"
}
],
"hidden": false,
"services": [
{
"at": {
"full_path": "acme/payments-api",
"id": "id-d7cc",
"type": "group"
},
"display_name": "Lin Park",
"service_id": "f40cdf5b-943d-42fc-96eb-ce0685f2975c",
"slug": "slug-82bc"
}
],
"truncated": false
}
400Invalid team idapplication/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-3a5d",
"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 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-08f4",
"message": "Stream pipeline status into the run header"
}
}
403The token lacks the scopeapplication/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-0823",
"message": "Stream pipeline status into the run header"
}
}
404Team 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-d410",
"message": "Label every synthesized example"
}
}

CLI

gitmoap teams get-team-usage

  • --team-ididTeam ID

Used in these guides