Skip to content
GitmoapAPIBeta
Schema

ApprovalPolicyView

The approval policy and rules in force at a group or repository.

Shape

  • effectiveApprovalSwitchesThe switches that apply here: the nearest policy, tightened by every enforced one above it.
    • The ApprovalSwitches schema
    • author_can_approvebooleanWhether a merge request's author may approve it.
    • committers_can_approvebooleanWhether someone who authored or committed a commit in it may approve it.
    • last_pusher_can_approvebooleanWhether whoever pushed its current head may approve it.
    • reset_on_pushbooleanWhether an approval stops counting when new commits are pushed.
  • rulesarray of ApprovalRuleThe rules that apply to merge requests here: every enforced rule above, as strengthened beneath, then the nearest group's or repository's own rules.
    • The ApprovalRule schema
    • accept_fromAcceptFrompeople_signed_inpeoplepeople_and_service_accountspeople_and_agentsWhich kinds of approval count toward a rule.
    • approversarray of ApproverRef
    • created_atstring · date-time
    • defined_atAccessScopeThe group or repository that defines it.
    • enforcementRuleEnforcementdefaultenforcedWhether the scopes beneath may replace a rule, or only strengthen it.
    • namestring
    • requiredinteger · int320–∞Distinct approvals that must count, 1–10.
    • rule_idApprovalRuleId (string · uuid)
    • updated_atstring · date-time
    • applies_to_branchesBranchPattern (string) or nulloptionalThe branches whose merge requests this rule applies to; absent means every branch.
    • strengthensApprovalRuleId (string · uuid) or nulloptionalThe enforced rule above this one that it strengthens, in whose place it applies here and beneath.
  • rules_herearray of ApprovalRuleThe rules this group or repository defines itself.
    • The ApprovalRule schema
    • accept_fromAcceptFrompeople_signed_inpeoplepeople_and_service_accountspeople_and_agentsWhich kinds of approval count toward a rule.
    • approversarray of ApproverRef
    • created_atstring · date-time
    • defined_atAccessScopeThe group or repository that defines it.
    • enforcementRuleEnforcementdefaultenforcedWhether the scopes beneath may replace a rule, or only strengthen it.
    • namestring
    • requiredinteger · int320–∞Distinct approvals that must count, 1–10.
    • rule_idApprovalRuleId (string · uuid)
    • updated_atstring · date-time
    • applies_to_branchesBranchPattern (string) or nulloptionalThe branches whose merge requests this rule applies to; absent means every branch.
    • strengthensApprovalRuleId (string · uuid) or nulloptionalThe enforced rule above this one that it strengthens, in whose place it applies here and beneath.
  • policyApprovalPolicy or nulloptionalThis group's or repository's own policy, when it sets one.
    • The ApprovalPolicy schema
    • author_can_approvebooleanWhether a merge request's author may approve it.
    • committers_can_approvebooleanWhether someone who authored or committed a commit in it may approve it.
    • defined_atAccessScope
    • enforcementRuleEnforcementdefaultenforcedWhether the scopes beneath may replace a rule, or only strengthen it.
    • last_pusher_can_approvebooleanWhether whoever pushed its current head may approve it.
    • reset_on_pushbooleanWhether an approval stops counting when new commits are pushed.
    • updated_atstring · date-time

Example

Synthesized example
{
"effective": {
"author_can_approve": false,
"committers_can_approve": false,
"last_pusher_can_approve": false,
"reset_on_push": false
},
"rules": [
{
"accept_from": "people_signed_in",
"approvers": [],
"created_at": "2026-10-13T11:32:04Z",
"defined_at": {
"full_path": "acme/payments-api",
"id": "id-0d7e",
"type": "group"
},
"enforcement": "default",
"name": "payments-api",
"required": 45,
"rule_id": "a299bdd6-5731-432d-8897-b8562e5b6de9",
"updated_at": "2026-10-17T03:36:53Z"
}
],
"rules_here": [
{
"accept_from": "people_signed_in",
"approvers": [],
"created_at": "2026-10-10T01:52:50Z",
"defined_at": {
"full_path": "acme/payments-api",
"id": "id-4cca",
"type": "group"
},
"enforcement": "default",
"name": "payments-api",
"required": 31,
"rule_id": "82a2a529-2eed-4c61-a4c8-1cc556bf818d",
"updated_at": "2026-10-10T15:38:57Z"
}
],
"policy": {
"author_can_approve": false,
"committers_can_approve": false,
"defined_at": {
"full_path": "acme/payments-api",
"id": "id-05bf",
"type": "group"
},
"enforcement": "default",
"last_pusher_can_approve": false,
"reset_on_push": false,
"updated_at": "2026-10-15T10:59:14Z"
}
}

Graph

Used inside

No schema contains this one.

Used by