Skip to main content
PATCH
/
api
/
v1
/
ops
/
roles
/
{roleId}
Update Role
curl --request PATCH \
  --url https://api.example.com/api/v1/ops/roles/{roleId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "description": "Acesso total à organização",
  "name": "Administrador",
  "permissions": [
    "read:trip",
    "create:trip"
  ]
}
'
{
  "roleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "description": "<string>",
  "createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "updatedAt": "2023-11-07T05:31:56Z",
  "deletedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "deletedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

roleId
string<uuid>
required

Role identifier

Example:

"0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3a"

Query Parameters

fields
string

Comma-separated list of fields to include in the response. Supports dot notation for nested projection (e.g. id,name,user.email,trips.route.id). Unknown fields are silently dropped.

Body

application/json

Update role payload

description
string | null

Role description

Example:

"Acesso total à organização"

name
string

Role name

Example:

"Administrador"

permissions
enum<string>[]

Granted permissions

Permission identifier

Available options:
access:ops,
access:bko,
access:driver,
read:organization,
update:organization,
read:role,
create:role,
update:role,
delete:role,
read:member,
create:member,
update:member,
delete:member,
read:invite,
create:invite,
delete:invite,
read:vehicle,
create:vehicle,
update:vehicle,
delete:vehicle,
read:seat-type,
read:driver,
create:driver,
update:driver,
delete:driver,
read:point,
create:point,
update:point,
delete:point,
read:route,
create:route,
update:route,
delete:route,
read:bank_account,
update:bank_account,
read:payment,
read:trip,
create:trip,
update:trip,
delete:trip,
read:trip_schedule,
create:trip_schedule,
update:trip_schedule,
delete:trip_schedule,
create:trip_event,
read:order,
create:order,
update:order,
read:ticket,
create:ticket,
update:ticket,
delete:ticket,
read:balance,
read:receivable,
read:transfer,
create:transfer,
read:audit,
read:user,
update:user,
read:benefit_category,
create:benefit_category,
update:benefit_category,
delete:benefit_category,
read:benefit_program,
create:benefit_program,
update:benefit_program,
delete:benefit_program
Example:
["read:trip", "create:trip"]

Response

OK

Papéis de acesso internos, de ambiente ou customizados por organização

roleId
string<uuid>
required

Identificador único

organizationId
string<uuid> | null
required

Referência à organização; preenchido apenas para ORGANIZATION

type
enum<string>
required

Tipo da role (INTERNAL, ENVIRONMENT ou ORGANIZATION)

Available options:
INTERNAL,
ENVIRONMENT,
ORGANIZATION
name
string
required

Nome do papel (ex.: "Admin", "Agente")

description
string | null
required

Descrição do papel

createdBy
string<uuid> | null
required

Usuário que criou o registro, quando aplicável

createdAt
string<date-time>
required

Data de criação

updatedBy
string<uuid> | null
required

Usuário que fez a última atualização, quando aplicável

updatedAt
string<date-time>
required

Data da última atualização

deletedBy
string<uuid> | null
required

Usuário que removeu o registro, quando aplicável

deletedAt
string<date-time> | null
required

Data de remoção