# Updates permissions for a role.

POST https://api.awork.com/api/v1/roles/{roleId}/permissions

Updates permissions for a role. The submitted permission is added, changed, or removed for the role.

<Check title="Required Permissions" icon="key">The user must be an admin or have `project-manage-config:write` permissions.</Check>

## Request example

```sh
curl -X POST --globoff 'https://api.awork.com/api/v1/roles/{roleId}/permissions' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  --data '{
  "feature": "pmd",
  "accessLevels": [
    "read"
  ]
}'
```

- path parameter `roleId`: string (required). The id of the role.

## Request body (application/json)

- `feature`: string or null

- `accessLevels`: array of string or null

## Response 200

OK

application/json

```json
{
  "feature": "pmd",
  "accessLevels": [
    "read"
  ],
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdOn": "2026-01-15T09:30:00Z",
  "updatedOn": "2026-01-15T09:30:00Z"
}
```

## Response 204

No Content

## Response 400

Bad Request

application/json

```json
{
  "code": "not-found",
  "description": "There is no matching path for this URL.",
  "link": "https://developers.awork.com",
  "details": [
    "No project with the id '123' exists."
  ],
  "validationErrors": [
    {
      "property": "FirstName",
      "message": "FirstName is required."
    }
  ],
  "traceId": "a65ce5745df02af216715ff06661fb3a"
}
```

## Response 500

Internal Server Error

application/json

```json
{
  "code": "not-found",
  "description": "There is no matching path for this URL.",
  "link": "https://developers.awork.com",
  "details": [
    "No project with the id '123' exists."
  ],
  "validationErrors": [
    {
      "property": "FirstName",
      "message": "FirstName is required."
    }
  ],
  "traceId": "a65ce5745df02af216715ff06661fb3a"
}
```
