Search Documentation

Search API endpoints, webhooks, tools, and guides

On this page6 sections
Is this helpful?
Quick Actions
Download OpenAPI.json
POST/api/roles/update-roleRolesPermission: roles.update

Update Role

Updates an existing custom role's name, scope, and permission matrix, then invalidates tenant permission caches.

Authentication: Requires Authorization: Bearer <ACCESS_TOKEN> (Supabase JWT, OAuth2 M2M token, or integration token).

Request

Provide the following fields in the request payload.

Body application/json
IDstringoptional

ID parameter.

idstring (uuid)required

id parameter.

namestringrequired

name parameter.

dataScopeenum('all' | 'own')optionaldefault: all

data Scope parameter.

scopedModulesstringoptionaldefault:

scoped Modules parameter.

permissionsarray<object>required

permissions parameter.

permissions[].moduleenum('dashboard' | 'product' | 'inventory' | 'invoice', ...)required

module parameter.

permissions[].actionenum('view' | 'create' | 'update' | 'delete', ...)required

action parameter.

Responses

Select a status code to inspect schema.

OK — Role updated successfully.application/json
successenum('true')

Success (true).

messagestring

Message.

dataobject | null

Response payload or null.

POST/api/roles/update-role
curl -X POST "https://api.invoger.com/api/roles/update-role" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{ "id": "r2b3c4d5-e6f7-8a9b-0c1d-2e3f4a5b6c7d", "name": "Senior Cashier", "dataScope": "all", "scopedModules": "", "permissions": [ { "module": "invoice", "action": "create" }, { "module": "invoice", "action": "view" } ] }'
Interactive playground

Response

application/json
{
  "success": true,
  "message": "Success",
  "data": {
    "id": "r2b3c4d5-e6f7-8a9b-0c1d-2e3f4a5b6c7d",
    "name": "Senior Cashier"
  }
}