curl -X GET "https://api.companyflow.com/companies/{company_id}/roles?page=1&page_size=20&search=Developer" \
-H "Authorization: Bearer YOUR_TOKEN"
const params = new URLSearchParams({
page: '1',
page_size: '20',
search: 'Developer'
});
const response = await fetch(
`https://api.companyflow.com/companies/{company_id}/roles?${params}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
}
);
const data = await response.json();
import requests
url = "https://api.companyflow.com/companies/{company_id}/roles"
headers = {
"Authorization": "Bearer YOUR_TOKEN"
}
params = {
"page": 1,
"page_size": 20,
"search": "Developer"
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
{
"success": true,
"data": {
"roles": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"company_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Senior Developer",
"description": "Senior-level software development position",
"is_system_role": false,
"permissions_cache": ["employees:read", "employees:write"],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"company_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Junior Developer",
"description": "Entry-level software development position",
"is_system_role": false,
"permissions_cache": ["employees:read"],
"created_at": "2024-01-16T14:20:00Z",
"updated_at": "2024-01-16T14:20:00Z"
}
],
"total": 2,
"page": 1,
"page_size": 20
}
}
{
"success": false,
"message": "unauthorized"
}
Roles & Permissions
List Roles
Retrieve a paginated list of roles for a company
GET
/
companies
/
{company_id}
/
roles
curl -X GET "https://api.companyflow.com/companies/{company_id}/roles?page=1&page_size=20&search=Developer" \
-H "Authorization: Bearer YOUR_TOKEN"
const params = new URLSearchParams({
page: '1',
page_size: '20',
search: 'Developer'
});
const response = await fetch(
`https://api.companyflow.com/companies/{company_id}/roles?${params}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
}
);
const data = await response.json();
import requests
url = "https://api.companyflow.com/companies/{company_id}/roles"
headers = {
"Authorization": "Bearer YOUR_TOKEN"
}
params = {
"page": 1,
"page_size": 20,
"search": "Developer"
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
{
"success": true,
"data": {
"roles": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"company_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Senior Developer",
"description": "Senior-level software development position",
"is_system_role": false,
"permissions_cache": ["employees:read", "employees:write"],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"company_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Junior Developer",
"description": "Entry-level software development position",
"is_system_role": false,
"permissions_cache": ["employees:read"],
"created_at": "2024-01-16T14:20:00Z",
"updated_at": "2024-01-16T14:20:00Z"
}
],
"total": 2,
"page": 1,
"page_size": 20
}
}
{
"success": false,
"message": "unauthorized"
}
Get a paginated list of all roles within a company. Supports search and pagination. Requires Super Admin or HR Manager permissions.
Path Parameters
string
required
The unique identifier of the company
Query Parameters
integer
default:"1"
Page number for paginationExample:
1integer
default:"10"
Number of items per pageExample:
20string
Search roles by nameExample:
"Developer"Response
boolean
Indicates if the request was successful
object
Paginated list of roles
Show Pagination Object
Show Pagination Object
array
Array of role objects
Show Role Object
Show Role Object
string
Unique identifier for the role
string
The company this role belongs to
string
Name of the role
string
Description of the role
boolean
Whether this is a system-defined role
string[]
Array of cached permission strings
string
ISO 8601 timestamp of when the role was created
string
ISO 8601 timestamp of when the role was last updated
integer
Total number of roles matching the query
integer
Current page number
integer
Number of items per page
curl -X GET "https://api.companyflow.com/companies/{company_id}/roles?page=1&page_size=20&search=Developer" \
-H "Authorization: Bearer YOUR_TOKEN"
const params = new URLSearchParams({
page: '1',
page_size: '20',
search: 'Developer'
});
const response = await fetch(
`https://api.companyflow.com/companies/{company_id}/roles?${params}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
}
);
const data = await response.json();
import requests
url = "https://api.companyflow.com/companies/{company_id}/roles"
headers = {
"Authorization": "Bearer YOUR_TOKEN"
}
params = {
"page": 1,
"page_size": 20,
"search": "Developer"
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
{
"success": true,
"data": {
"roles": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"company_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Senior Developer",
"description": "Senior-level software development position",
"is_system_role": false,
"permissions_cache": ["employees:read", "employees:write"],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"company_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Junior Developer",
"description": "Entry-level software development position",
"is_system_role": false,
"permissions_cache": ["employees:read"],
"created_at": "2024-01-16T14:20:00Z",
"updated_at": "2024-01-16T14:20:00Z"
}
],
"total": 2,
"page": 1,
"page_size": 20
}
}
{
"success": false,
"message": "unauthorized"
}