GETapi.synup.com/api/v4/roles
List User Roles
This API retrieves a list of all available user roles in the system.
It includes:
- Role names (e.g., Admin, Manager, Viewer)
- Permissions associated with each role
- Role IDs for assignment and management
Requires an API key. Send it as
Authorization: API <your-key> — see Getting started.Request
Request
curl -X GET 'https://api.synup.com/api/v4/roles' \
-H 'Authorization: API YOUR_API_KEY' \
-H 'Content-Type: application/json'const res = await fetch('https://api.synup.com/api/v4/roles', {
method: 'GET',
headers: {
Authorization: 'API YOUR_API_KEY',
'Content-Type': 'application/json',
},
});
const data = await res.json();import requests
res = requests.get(
"https://api.synup.com/api/v4/roles",
headers={
"Authorization": "API YOUR_API_KEY",
"Content-Type": "application/json",
},
)
data = res.json()req, _ := http.NewRequest("GET", "https://api.synup.com/api/v4/roles", nil)
req.Header.Set("Authorization", "API YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Responses
| Status | Description |
|---|---|
200 | Successfully retrieved user roles |
401 | Unauthorized - Authentication required |
403 | Forbidden - Insufficient permissions |
Example response
{
"data": {
"fetchAccountRoles": [
{
"id": "Q3VzdG9tUm9sZToxODE3NzY=",
"name": "Approval",
"createdAt": "2025-01-21 19:05:43 UTC",
"updatedAt": "2025-01-21 19:07:13 UTC"
},
{
"id": "Q3VzdG9tUm9sZTo0NDUyMg==",
"name": "Admin",
"createdAt": "2020-02-12 07:27:46 UTC",
"updatedAt": "2025-01-22 15:24:13 UTC"
},
{
"id": "Q3VzdG9tUm9sZTo0NTI5MQ==",
"name": "Corporate Role",
"createdAt": "2020-02-12 07:28:05 UTC",
"updatedAt": "2025-01-15 06:16:29 UTC"
}
],
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
}Response body
| Name | Type | Required | Description |
|---|---|---|---|
data | object | optional | |
data.fetchAccountRoles | array of object | optional | |
data.fetchAccountRoles[].id | string | required | Base64 encoded unique identifier for the role |
data.fetchAccountRoles[].name | string | required | Name of the role |
data.fetchAccountRoles[].createdAt | string | required | Role creation timestamp |
data.fetchAccountRoles[].updatedAt | string | required | Role last update timestamp |