---
title: "Update a custom role"
url: https://docs.corefinity.com/api/reference/organisation/update-custom-role
type: endpoint
last_updated: 2026-11-13
feature: team
related:
  - https://docs.corefinity.com/guides/organisation/people/users-and-invitations.md
  - https://docs.corefinity.com/mcp/tools/corestack_team_role_update.md
---
# Update a custom role

Renames a custom role of your company and replaces its permissions with the list you send. Everybody who holds
the role gets the new set. Standard roles cannot be changed.

```http
POST /api/roles/{id}/update
```

- Scope: `write`
- Rate limit: 60 a minute
- Try it in the console: off. It has not been cleared for the console. Copy the request and run it yourself when you are sure.

## Path parameters

- `id` (integer, required): The id of a custom role of your company, as `GET /team/roles` lists it. Digits only; anything else answers `404`.

## Body

- `name` (string, required)
- `permissions` (array of strings, required): The slugs of the permissions the role gives, each one you hold yourself. The whole set, not a change to it.

## Request

### curl

```bash
curl -X POST https://manage.corefinity.com/api/roles/3107/update \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Release leads",
    "permissions": [
      "viewUsers",
      "viewWebsites"
    ]
  }'
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->post('https://manage.corefinity.com/api/roles/3107/update', [
        'name' => 'Release leads',
        'permissions' => [
            'viewUsers',
            'viewWebsites',
        ],
    ]);

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/roles/3107/update', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Release leads',
    permissions: [
      'viewUsers',
      'viewWebsites',
    ],
  }),
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.post(
    "https://manage.corefinity.com/api/roles/3107/update",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "name": "Release leads",
        "permissions": [
            "viewUsers",
            "viewWebsites",
        ],
    },
)

data = res.json() if res.content else None
```

## Responses

### 200 The role as saved.

```json
{
  "data": {
    "id": 3107,
    "name": "Release leads",
    "permissions": [
      "viewUsers",
      "viewWebsites"
    ],
    "slug": "release-managers-0b9c7a52-3f7e-4c1d-9a55-2f6f1f0e8d11"
  },
  "message": "Role updated.",
  "status": "success"
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the `write` scope (`scope_required`), or you may not update roles (`forbidden`).

```json
{
  "code": "forbidden",
  "message": "You are not allowed to update roles.",
  "reason": "forbidden",
  "status": "error"
}
```

### 404 No custom role of your company has this id. A standard role and another company's role answer the same.

```json
{
  "message": "Not found."
}
```

### 422 A field is missing or wrong (`invalid`). On `permissions`: a name that is not a permission, a permission you do not hold yourself, or one that only Corefinity's own roles may hold.

```json
{
  "code": "invalid",
  "errors": {
    "permissions": [
      "The permissions field is required."
    ]
  },
  "field": "permissions",
  "message": "The permissions field is required.",
  "reason": "invalid"
}
```

### 429 Too many requests (`rate_limited`). Wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | Send a valid token as `Authorization: Bearer <token>`. |
| 403 | `forbidden` | The person is not allowed to do this. |
| 403 | `scope_required` | Use a token with the scope named in `scope`. |
| 404 |  | Check the id. You see only what your account can reach. |
| 422 | `invalid` | Fix the field named in `field`; `errors` says why. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Users and invitations](https://docs.corefinity.com/guides/organisation/people/users-and-invitations.md)
- MCP tool: [`corestack_team_role_update`](https://docs.corefinity.com/mcp/tools/corestack_team_role_update.md)
