> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Devin CLI Team Permission Rules

> Replace your team's account-wide Devin CLI permission rules (allow, ask, and deny) with ETag concurrency control via the API.

## Overview

Replaces your team's account-wide Devin CLI permission rules — the same **Terminal Permissions** configured in [team settings](https://docs.devin.ai/cli/enterprise/team-settings.md#terminal-permissions).

To prevent overwriting concurrent changes, pass the `ETag` from [Get CLI Permissions](https://docs.devin.ai/desktop/accounts/api-reference/get-cli-permissions.md) in the `If-Match` header. If the rules changed in the meantime, the request fails with `412`.

> [!NOTE]
>
> This endpoint is in alpha (`v2alpha`). The request and response shape may change.

## Authentication

Pass a Devin [service user API key](https://docs.devin.ai/api-reference/authentication.md) (`cog_...`) in the `Authorization` header:

```
Authorization: Bearer <api-key>
```

Requires the same permissions and plan as [Get CLI Permissions](https://docs.devin.ai/desktop/accounts/api-reference/get-cli-permissions.md). Personal tokens are rejected with `403`.

## Request

**If-Match** `string` *required*

The `ETag` returned by `GET /api/v2alpha/cli-permissions`.

**allow** `string[]` *required*

Actions Devin CLI approves automatically without prompting. Pass `[]` for an empty list.

**ask** `string[]` *required*

Actions that always prompt the user for approval. Pass `[]` for an empty list.

**deny** `string[]` *required*

Actions that are blocked. Pass `[]` for an empty list.

All three fields are required, and unknown fields are rejected. Each rule must follow [Devin CLI permission syntax](https://docs.devin.ai/cli/reference/permissions.md#permission-syntax); unparseable rules return `400`. `Fetch(...)` URL patterns are not validated by this endpoint — Devin CLI ignores patterns it cannot compile.

### Example Request

```bash theme={null}
ETAG=$(curl -s -D - -o /dev/null https://server.codeium.com/api/v2alpha/cli-permissions \
  -H "Authorization: Bearer $DEVIN_API_KEY" | awk 'tolower($1)=="etag:" {print $2}' | tr -d '\r')

curl -X PUT https://server.codeium.com/api/v2alpha/cli-permissions \
  -H "Authorization: Bearer $DEVIN_API_KEY" \
  -H "If-Match: $ETAG" \
  -H "Content-Type: application/json" \
  -d '{"allow": ["Exec(git)", "Read(**)"], "ask": ["Fetch(domain:*)"], "deny": ["ExecExact(rm -rf /)"]}'
```

## Response

Returns the updated `allow`, `ask`, and `deny` lists with a new `ETag` header, matching [Get CLI Permissions](https://docs.devin.ai/desktop/accounts/api-reference/get-cli-permissions.md). Successful updates are recorded in the team audit log.

## Error Responses

Errors are returned as `{"error": "<message>"}`.

| Status | Cause |
| - | - |
| `400` | Invalid JSON, unknown fields, missing `allow`, `ask`, or `deny`, or an unparseable permission rule |
| `401` | Missing or invalid API key, or a legacy Windsurf API key (only Devin `cog_...` service user keys are accepted) |
| `403` | Personal token used instead of a service user key, missing Devin Desktop access or `account.windsurf.admin` permission, or account is not on a Teams or Enterprise plan |
| `412` | `If-Match` does not match the current `ETag`; fetch the rules again and retry |
| `428` | Missing `If-Match` header |
| `429` | Rate limit exceeded; retry after the `Retry-After` header |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.