Skip to content

Change a workspace's default_workflow_permissions, max_workflow_permissions and can_approve_pull_request_reviews; fields left out stay as they are.

PUT/workspaces/{workspace}/actions/permissions/workflow

A maximum of read makes the default read too. Owners only.

A maximum of read holds every repository’s default to read-only, and makes the workspace’s default read too.

  • Authentication: Required. Send an access token as Authorization: Bearer.
  • MCP tool: workflow with action set_workspace_permissions, and the same inputs
  • Scope: An access token needs workspace:admin.
Name Type Required Description
workspace string Yes The workspace’s name, e.g. “acme”.

Send a JSON object. Names are snake_case, as in responses; the camelCase spelling is accepted too.

Name Type Required Description
default_workflow_permissions string No What new repositories get. One of read, write.
max_workflow_permissions string No The most any repository’s default may be. One of read, write.
can_approve_pull_request_reviews boolean No Let repositories allow jobs to open and approve pull requests.
curl -X PUT https://api.g1t.sh/workspaces/flagon-io/actions/permissions/workflow \
-H "Authorization: Bearer $G1T_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"max_workflow_permissions": "read"
}'

A successful request answers 200 with:

{
"default_workflow_permissions": "read",
"max_workflow_permissions": "read",
"can_approve_pull_request_reviews": false
}

A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See errors.

Status Code When
401 unauthenticated A token is required, or the one sent is not valid.
403 forbidden The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository.
404 not_found It does not exist, or you cannot see it.
409 conflict The request conflicts with the current state.
422 invalid The input is not valid. message says which field and why.