Skip to main content

User roles

info

All APIs endpoints

[GET]/users/roles

[GET]/users/roles:id

[POST]/users/roles

[PUT]/users/roles:id

[DEL]/users/roles

Create new role

Parameter

  • name: require

    • description: role's name
  • description: option

  • permission: require have properties

    application:

    • agents: {all: boolean, view: boolean}
    • customer: {all: boolean, view: boolean}
    • labels: {all: boolean, view: boolean}
    • live_map: {all: boolean, view: boolean}
    • settings: {all: boolean, view: boolean}
    • labels: {all: boolean, view: boolean}

    platform:

    • application: {all: boolean, view: boolean}
    • admins: {all: boolean, view: boolean}
    • roles: {all: boolean, view: boolean}
    • billing: {all: boolean, view: boolean}
    • administrators: {all: boolean, view: boolean}

Request

curl --location --request POST 'https://api-v1-stg.lumyri.com//users/roles' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "co-founder",
"description": "",
"permission": {
"platform": {
"applications": {
"all": true,
"view": true
},
"admins": {
"all": false,
"view": false
},
"roles": {
"all": true,
"view": true
},
"billing": {
"all": true,
"view": true
},
"administrators": {
"all": true,
"view": true
}
},
"application": {
"applications": [],
"tickets": {
"all": true,
"view": true
},
"agents": {
"all": true,
"view": true
},
"customers": {
"all": true,
"view": true
},
"live_map": {
"all": true,
"view": true
},
"labels": {
"all": true,
"view": true
},
"settings": {
"all": true,
"view": true
}
}
}
}'

Response

{
"error": null,
"data": {
"id": "78370cd6-a3ec-47a3-a307-e8c3be231caf",
"name": "founder",
"description": "this this the most important member",
"category": "CUSTOM ROLE",
"company_id": "805afbb9-c721-4d1b-845b-aed6ec5a0cb2",
"permission": {
"platform": {
"applications": {
"all": true,
"view": true
},
"admins": {
"all": false,
"view": false
},
"roles": {
"all": true,
"view": true
},
"billing": {
"all": true,
"view": true
}
},
"application": {
"applications": [],
"tickets": {
"all": true,
"view": true
},
"agents": {
"all": true,
"view": true
},
"customers": {
"all": true,
"view": true
},
"live_map": {
"all": true,
"view": true
},
"labels": {
"all": true,
"view": true
},
"settings": {
"all": true,
"view": true
}
}
},
"created_at": "2023-02-21T06:57:33.237516109Z",
"updated_at": "2023-02-21T06:57:33.237516109Z",
"deleted_at": null
}
}

Get list of roles

Parameters

  • limit: optional
    • description: limit number of customer per page for pagination
    • default: 10
  • page: optional
    • description:current page for pagination
    • default: 1
  • order_by: optional
    • description: sort by name or description by ASC/DECS
    • default: asc

Request

curl --location --request GET 'https://api-v1-stg.lumyri.com/users/roles?page=1&limit=5' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \

Response

{
"error": null,
"data": {
"total": 1,
"per_page": 5,
"current_page": 1,
"last_page": 1,
"data": [
{
"id": "78370cd6-a3ec-47a3-a307-e8c3be231caf",
"name": "founder",
"description": "this this the most important member",
"category": "CUSTOM ROLE",
"company_id": "805afbb9-c721-4d1b-845b-aed6ec5a0cb2",
"permission": {
"platform": {
"applications": {
"all": true,
"view": true
},
"admins": {
"all": false,
"view": false
},
"roles": {
"all": true,
"view": true
},
"billing": {
"all": true,
"view": true
}
},
"application": {
"applications": [],
"tickets": {
"all": true,
"view": true
},
"agents": {
"all": true,
"view": true
},
"customers": {
"all": true,
"view": true
},
"live_map": {
"all": true,
"view": true
},
"labels": {
"all": true,
"view": true
},
"settings": {
"all": true,
"view": true
}
}
},
"created_at": "2023-02-21T06:57:33.237516109Z",
"updated_at": "2023-02-21T06:57:33.237516109Z",
"deleted_at": null
}
]
}
}

Get role detail

Request

curl --location --request GET 'https://api-v1-stg.lumyri.com/users/roles/$ROLE_ID' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \

Response

{
"error": null,
"data": {
"id": "78370cd6-a3ec-47a3-a307-e8c3be231caf",
"name": "founder",
"description": "this this the most important member",
"category": "CUSTOM ROLE",
"company_id": "805afbb9-c721-4d1b-845b-aed6ec5a0cb2",
"permission": {
"platform": {
"applications": {
"all": true,
"view": true
},
"admins": {
"all": false,
"view": false
},
"roles": {
"all": true,
"view": true
},
"billing": {
"all": true,
"view": true
}
},
"application": {
"applications": [],
"tickets": {
"all": true,
"view": true
},
"agents": {
"all": true,
"view": true
},
"customers": {
"all": true,
"view": true
},
"live_map": {
"all": true,
"view": true
},
"labels": {
"all": true,
"view": true
},
"settings": {
"all": true,
"view": true
}
}
},
"created_at": "2023-02-21T06:57:33.237516109Z",
"updated_at": "2023-02-21T06:57:33.237516109Z",
"deleted_at": null
}
}

Update role

curl --location -g --request PUT 'https://api-v1-stg.lumyri.com//users/roles/$ROLE_ID' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--data-raw '{
"name": "CEO",
"description": "",
"category": "CUSTOM ROLE",
"company_id": "7016b075-c743-489f-ac7a-e2290c765c64",
"permission": {
"platform": {
"applications": {
"all": true,
"view": true
},
"admins": {
"all": true,
"view": true
},
"roles": {
"all": true,
"view": true
},
"billing": {
"all": true,
"view": true
}
},
"application": {
"applications": [],
"tickets": {
"all": true,
"view": true
},
"agents": {
"all": true,
"view": true
},
"customers": {
"all": true,
"view": true
},
"live_map": {
"all": true,
"view": true
},
"labels": {
"all": true,
"view": true
},
"settings": {
"all": true,
"view": true
}
}
},
"created_at": "2023-02-21T06:46:02.916417Z",
"updated_at": "2023-02-21T06:46:02.916417Z",
"deleted_at": null
}'

Response

{
"error": null,
"data": {
"id": "78370cd6-a3ec-47a3-a307-e8c3be231caf",
"name": "CEO",
"description": "",
"category": "CUSTOM ROLE",
"company_id": "805afbb9-c721-4d1b-845b-aed6ec5a0cb2",
"permission": {
"platform": {
"applications": {
"all": true,
"view": true
},
"admins": {
"all": true,
"view": true
},
"roles": {
"all": true,
"view": true
},
"billing": {
"all": true,
"view": true
}
},
"application": {
"applications": [],
"tickets": {
"all": true,
"view": true
},
"agents": {
"all": true,
"view": true
},
"customers": {
"all": true,
"view": true
},
"live_map": {
"all": true,
"view": true
},
"labels": {
"all": true,
"view": true
},
"settings": {
"all": true,
"view": true
}
}
},
"created_at": "2023-02-21T06:57:33.237516Z",
"updated_at": "2023-02-21T07:17:30.188295323Z",
"deleted_at": null
}
}

Delete role

Request

curl --location --request DELETE 'localhost:9090/users/roles/$ROLE_ID' \
--header 'Authorization: Bearer $ACCESS_TOKEN'

Response

{
"error": null,
"data": {
"message": "OK"
}
}