Skip to main content
POST
/
api
/
v1
/
bko
/
roles
Create Role
curl --request POST \
  --url https://api.example.com/api/v1/bko/roles \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "permissions": [],
  "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "description": "<string>"
}
'
{
  "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.

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

Create role payload

type
enum<string>
required

Role type

Available options:
INTERNAL,
ENVIRONMENT,
ORGANIZATION
name
string
required

Role name

permissions
enum<string>[]
required

Granted permissions

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
organizationId
string<uuid> | null

Organization identifier. Required only for ORGANIZATION roles.

description
string | null

Role description

Response

Created

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