User roles

Resource is available only in Enterprise interface.

Available methods

All available methods for resource user-roles.

HTTP method Endpoint Description
[badge-blue GET ] /user-roles Get a list of all user roles
[badge-blue GET ] /user-roles/{user_role_id} Get information about a specific user role


Get all user roles

[badge-blue GET] /user-roles
Get a list of all user roles in CareCloud

Query string

Parameter name Type Description Mandatory (Yes/No)
count integer The number of records to return.
Default value is 100.
No
offset integer The number of records from a collection to skip.
Default value is 0.
No
sort_field string One of the query string parameters for sorting.
Response is sorted by the specified field.
No
sort_direction string Direction of sorting the response list.
Possible values are: ASC / DESC
No

Response

Status code: 200 OK
Output structure : object

Parameter name Type Description
users UserRole[ ] Array of user roles
total_items integer Count of all found user roles

Example Request

GET https://<projectURL>/rest-api/enterprise-interface/v1.0/user-roles
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZV9pbnRlcmZhYNDU3NDJhMDAxNmEyZjc1NDI3YWUwMTM0NmMyOWQxNmE4NzI1MWZlzZmMzcwNmI2MDJmDfN2Q2Mw==

Example response

HTTP/1.1 200 OK
Date: Wed, 09 Dec 2020 15:32:47 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "user_roles": [
      {
        "user_role_id": "8bd48117006496e0b1788109b8",
        "name": "Cashdesk"
      },
      {
        "user_role_id": "82de12eb8b138791e678fd11c3",
        "name": "Supervisor"
      },
      {
        "user_role_id": "84db37f94368932a56c439b5d6",
        "name": "Tasks"
      },
      {
        "user_role_id": "88dab5c7c687034ba59f886f4a",
        "name": "Web users"
      },
      {
        "user_role_id": "80d4567123a5f60e1c10fbeb3c",
        "name": "Testers"
      },
      {
        "user_role_id": "89d1a6111b3fb67e746865d948",
        "name": "Managers"
      },
      {
        "user_role_id": "8ad8b2b701199684f1222961d6",
        "name": "System users"
      },
      {
        "user_role_id": "86e05affc7a7abefcd513ab400",
        "name": "Administrator"
      }
    ],
    "total_items": 8
  }
}


Get information about an user role

Get information about a specific user role
[badge-blue GET] /user-roles/{user_role_id}

Path parameters

Parameter name Type Description Mandatory (Yes/No)
user_role_id string The unique id of the user role Yes

Response

Status code: 200 OK
Output structure : UserRole

Example Request

GET https://<projectURL>/rest-api/enterprise-interface/v1.0/user-roles/8bd4811006496e0b1788109b8
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmmZhY2U6NDU3NDJhMDAxNmEyZjc1NDI3YWUwMTM0NmMyOWQxNmE4NzI1MWZlzZmMzcwNmI2MDJmDfN2Q2Mw==

Example response

HTTP/1.1 200 OK
Date: Wed, 09 Dec 2020 15:33:34 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "user_role_id": "8bd48117006496e0b1788109b8",
    "name": "Cashdesk"
  }
}