Set main branch protection
<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>
Turns protection of the app's main branch on or off.
While main is protected, calls that change main directly are refused with a 409, and the builder's AI can't edit main either. Make changes on a branch and merge it back instead. Setting the value the app already has changes nothing. Read the current value from main_branch_protected in Get app.
Only the app owner or an admin of the app's workspace can change it. Editors can't, even though they can edit the app. This endpoint is limited to 10 requests per minute.
<Note>This endpoint accepts a personal API key belonging to the app owner or a workspace admin. A read-only key is refused, and workspace API keys are not accepted.</Note>
Path parameters
ID of the app whose main branch to protect or unprotect.
ID of the app whose main branch to protect or unprotect.
Request body
Example request
{
"protected": true
}Response
The main branch's protection after the change.
Example response
{
"protected": true
}Changes
Changed in 1 of the 14 revisions of this API.1
- ○
endpoint added
endpoint-added
- ○