Roles
Base URL https://api.leadx.in/api/key/protected. Every request needs an apikey header — see Authentication.
5 endpoints.
GET /role
Get roles.
Auth apikey
:::note Used by the web app
pages/AddRole.jsx, pages/InviteMember.jsx, pages/MemberManagement.jsx and 2 more
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of Role objects, alongside the pagination fields described in Response format. updatedBy, createdBy are populated, so they arrive as nested objects rather than ids.
POST /role
Create role.
Auth apikey · Success 200
:::note Used by the web app
pages/AddRole.jsx, pages/InviteMember.jsx, pages/MemberManagement.jsx and 2 more
:::
Request body
| Field | Default |
|---|---|
name | — |
permission | — |
description | — |
Required: name.
Response — data is one Role object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
Errors RoleNameAlreadyExists_400
DELETE /role
Delete roles.
Auth apikey · Success 200
:::note Used by the web app
pages/AddRole.jsx, pages/InviteMember.jsx, pages/MemberManagement.jsx and 2 more
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is one Role object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
Errors DefaultRoleNotFound_404
GET /role/:id
Get role.
Auth apikey
:::note Used by the web app
pages/AddRole.jsx, pages/RoleManagement.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one Role object. createdBy updatedBy is populated, so it arrives as nested objects rather than ids.
Errors RoleNotFound_404
PUT /role/:id
Update role.
Auth apikey · Success 200
:::note Used by the web app
pages/AddRole.jsx, pages/RoleManagement.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Request body
| Field | Default |
|---|---|
name | — |
description | — |
permission | — |
isDefault | — |
Required: name.
Response — data is one Role object.
Errors RoleNameAlreadyExists_400 · RoleNotFound_404