Create a role
post
https://api.flactrum.com/v1/roles
| Required scope | roles.write |
| Success status | 201 |
| Returns | One Role object |
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
No recorded example yet.