Roles
List available roles and their permissions via the API.
Roles API
Read role definitions and their permissions for the current account context. Requires an API token with the roles.view ability.
List Roles
GET /api/v1/roles — Permission: roles.view
Example Request
curl -X GET "https://your-domain.com/api/v1/roles" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"const response = await fetch("https://your-domain.com/api/v1/roles", {
headers: {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
});
const data = await response.json();$ch = curl_init("https://your-domain.com/api/v1/roles");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_TOKEN",
"Accept: application/json",
],
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);import requests
response = requests.get(
"https://your-domain.com/api/v1/roles",
headers={
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
)
data = response.json()Example Response
{
"data": [
{
"id": 1,
"name": "Full Access",
"description": "Complete access to all features",
"is_system": true,
"permissions": [
"contacts.view", "contacts.create", "contacts.edit", "contacts.delete",
"documents.view", "documents.create", "documents.edit", "documents.send",
"forms.view", "forms.create", "forms.edit"
],
"created_at": "2025-01-01T00:00:00.000000Z"
},
{
"id": 2,
"name": "Sales Rep",
"description": "View and create contacts and documents",
"is_system": false,
"permissions": [
"contacts.view", "contacts.create", "contacts.edit",
"documents.view", "documents.create"
],
"created_at": "2025-02-01T10:00:00.000000Z"
}
],
"meta": { "current_page": 1, "last_page": 1, "per_page": 25, "total": 2 },
"links": { "first": "...", "last": "...", "prev": null, "next": null }
}
Was this article helpful?