JavaScript
const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: JSON.stringify({ roleName: 'Manager', roleData: [ [ {path: '/', access: 'Full Access'}, {path: '/my-team', access: 'Team Data'}, {path: '/proof-of-work/screenshot', access: 'Own Data'} ] ] }) }; fetch('https://api.trackpilots.com/v1/access-management', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
200
Example
{ "success": true, "statusCode": 200, "statusMessage": "Page-level access permissions have been successfully assigned to the role.", "error": null, "data": { "roleId": "c44a66ea-d0ba-4423-9f85-25c68f7aa37b", "roleName": "Manager", "roleData": [ { "path": "/", "access": "Full Access" }, { "path": "/my-team", "access": "Team Data" }, { "path": "/proof-of-work/screenshot", "access": "Own Data" } ] } }
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
"Manager"
Route-wise access configuration defining the permission level granted to this role.
Show child attributes
Page-level access permissions have been successfully assigned to the role.
true
"Page-level access permissions have been successfully assigned to the role."
null