Update the force branch protection inheritance setting of an organization
const url = 'https://gitea.example.com/api/v1/orgs/example/branch_protection_inheritance';const options = { method: 'PUT', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"force_inheritance":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://gitea.example.com/api/v1/orgs/example/branch_protection_inheritance \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "force_inheritance": true }'Gitea Enterprise only. This endpoint is not part of the community edition.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Name of the organization
Request Body
Section titled “Request Body”OrgBranchProtectionInheritance represents the organization-level setting that forces all repositories of the organization to inherit its branch protection rules.
object
Whether all repositories of the organization are forced to inherit the organization’s branch protection rules. When enabled, a repository can not opt out of inheritance.
Examplegenerated
{ "force_inheritance": true}Responses
Section titled “Responses”OrgBranchProtectionInheritance
OrgBranchProtectionInheritance represents the organization-level setting that forces all repositories of the organization to inherit its branch protection rules.
object
Whether all repositories of the organization are forced to inherit the organization’s branch protection rules. When enabled, a repository can not opt out of inheritance.
Examplegenerated
{ "force_inheritance": true}APINotFound is a not found empty response