Update a role
patch
https://api.flactrum.com/v1/roles/{role}
System roles cannot be edited — one brand changing them would change them for everyone. Create your own role instead.
| Required scope | roles.write |
| Success status | 200 |
| Returns | One Role object |
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| role * | path | string | ULID of the record. |
Request body
| Field | Type | Description |
|---|---|---|
| name * | string | — |
| scope * | string | — |
| permissions | array | Permission slugs. Sending this replaces the whole set. Per-page slugs (page.products.create) and legacy coarse slugs (menu.manage) are both accepted; legacy slugs are converted to the page permissions they used to open. Get valid slugs from /permissions. |
Response fields
| Field | Type | Description |
|---|---|---|
| id | string | — |
| name | string | — |
| slug | string | — |
| scope | string | — |
| is_system | boolean | System roles are shared by every brand and cannot be edited. |
| permissions | array | Effective permissions: per-page slugs (page.{page}.{view|create|update|delete}), special permissions such as cash.close, and the legacy coarse slugs (menu.view…) derived from the page permissions. |
| user_count | integer | — |
Examples
Recorded from the test suite — these are real requests and their real responses.
curl -X PATCH 'https://api.flactrum.com/v1/roles/01m43mzqy0ntafnza900bb9ra8' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"permissions": [
"stock.view"
]
}'
HTTP 200 · application/json
{
"data": {
"id": "01m43mzqy0ntafnza900bb9ra8",
"name": "Depo sorumlusu",
"slug": "depo_sorumlusu",
"scope": "branch",
"is_system": false,
"permissions": [
"page.stock.view",
"page.stock-expiry.view",
"page.stock-items.view",
"page.stock-item-categories.view",
"page.stock-item-units.view",
"page.custom-units.view",
"page.stock-counts.view",
"page.stock-waste.view",
"page.stock-movements.view",
"page.warehouse-stock.view",
"page.transfers.view",
"page.goods-receipts.view",
"stock.view"
],
"user_count": 0,
"created_at": "2026-10-04T14:27:17+00:00",
"updated_at": "2026-10-04T14:27:17+00:00"
}
}
curl -X PATCH 'https://api.flactrum.com/v1/roles/01m43mx07jr79y23r0zk7havbz' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"name": "Yeni ad"
}'
HTTP 409 · application/json
{
"error": {
"code": "conflict",
"message": "System roles are shared by every brand and cannot be changed. Create your own role instead.",
"details": {
"role": "sube_muduru"
}
}
}