# Set a workspace's default workflow permissions

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

<div class="g1t-endpoint"><span class="g1t-method" data-method="put">PUT</span><code>/workspaces/{workspace}/actions/permissions/workflow</code></div>

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](/reference/api/#authentication) as `Authorization: Bearer`.
- **MCP tool:** [`workflow`](/reference/mcp/#workflow) with `action` `set_workspace_permissions`, and the same inputs
- **Scope:** An access token needs [`workspace:admin`](/guides/authentication/#scopes).

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace` | string | Yes | The workspace's name, e.g. "acme". |

## Body parameters

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. |

## Example request

```sh
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"
  }'
```

## Example response

A successful request answers `200` with:

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

## Errors

A failed request answers with one of these statuses and a body like `{"error": {"code": "not_found", "message": "Repository not found."}}`. See [errors](/reference/api/#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. |
