Skip to content

Create role

Request

This endpoint is used to create user roles.

Security
Bearer
Bodyapplication/jsonrequired
namestringrequired

Name of the role.

Example:"User Admin"
descriptionstringrequired

A short description of the role mentioning what can it do.

Example:"Manage users for the company."
isPlatformRolebooleanrequired

Whether role is platform provided.

Default:false
Example:false
companyIdstring, (uuid)

Company ID which owns the role.

Example:"1aeef911-44cf-49bb-83c7-e06b0d4e7ac2"
permissionsArray of objects(PermissionWithActions)required

Permissions granted to the role.

curl -i -X POST \
  https://api-ext-sboxmeta.partners.spotnana.com/v3/roles \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "User Admin",
    "description": "Manage users for the company.",
    "isPlatformRole": false,
    "companyId": "1aeef911-44cf-49bb-83c7-e06b0d4e7ac2",
    "permissions": [
      {
        "permission": "USER_MANAGEMENT",
        "actions": [
          "READ",
          "WRITE"
        ]
      }
    ]
  }'

Responses

OK

Bodyapplication/json
idstring, (uuid)required
Example:"b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3"
Response
{ "id": "b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3" }