Roles

The Roles API allows administrators and authorized users to create, retrieve, update, and delete roles. Each role consists of a set of permissions that define what actions a user assigned to that role can perform.


GET/v2/roles

Get roles

Obtain the list of all existing roles in your organization.

Loading...

Response

      {
        [
          {
            "id": "xxxxx-1203-4322-a411-b835f29e9f26",
            "name": "customer",
            "description": "Customer of organization",
            "organizationId": "Customer of organization",
            "permissions": [
              "CREATE_AN_ITEM"
            ],
            "createdAt": "2024-02-28T16:11:00.595Z"
          },
          // more roles...
        ]
    }

GET/v2/roles/{id}

Get role by ID

Get a specific role with its ID.

Required Path Parameters

    idstringrequired

Loading...

Response

      {
          {
            "id": "xxxxxxx-1203-4322-a411-b835f29e9f26",
            "name": "customer",
            "description": "Customer of organization",
            "organizationId": "Customer of organization",
            "permissions": [
              "CREATE_AN_ITEM"
            ],
            "createdAt": "2024-02-28T16:11:00.595Z"
          }
    }

POST/v2/roles

Create role with permissions

Create a new role and select which features it will have access to.

Required Body Parameters

    namestringrequired
    descriptionstringrequired
    permissionsarray of stringsrequired

Loading...

Response

      {
          {
            "id": "xxxxxxx-1203-4322-a411-b835f29e9f26",
            "name": "customer",
            "description": "Customer of organization",
            "organizationId": "Customer of organization",
            "permissions": [
              "CREATE_AN_ITEM"
            ],
            "createdAt": "2024-02-28T16:11:00.595Z"
          }
    }

PUT/v2/roles/{id}

Update a role

Change the properties (name, description and permissions) of a specific role.

Required Path Parameters

    idstringrequired

Required Body Parameters

    namestringrequired
    descriptionstringrequired
    permissionsarray of stringsrequired

Loading...

Response

      {
          {
            "id": "xxxxxxx-1203-4322-a411-b835f29e9f26",
            "name": "customer",
            "description": "Customer of organization",
            "organizationId": "Customer of organization",
            "permissions": [
              "CREATE_AN_ITEM",
              "UPDATE_AN_ITEM"
            ],
            "createdAt": "2024-02-28T16:11:00.595Z"
          }
    }

DELETE/v2/roles/{id}

Delete a role

Permanently remove a role from your organization.

Required Path Parameters

    idstringrequired

Loading...

Response

      {
        
      }

Was this page helpful?