Get Company Custom Roles
GET
/companies/{id}/custom-rolesAgency-scoped keys
This endpoint is not available for agency-scoped API keys.
Summary
Returns a paginated list of custom roles for a company within the API key scope. Requires read:companies.
Each custom role has a base role of projectRequestor, projectApprover, or projectFinance. Use the returned id as companyRoleId when creating a user. Use the portal to change an existing user's custom role assignment.
URL Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Company ObjectId or reference |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | integer | No | Page number (default 1) |
| limit | integer | No | Records per page (default 50, max 200) |
| query | string | No | Case-insensitive search against custom role name |
| sortBy | enum(createdAt, updatedAt, name) | No | Sort field (default name) |
| sortOrder | enum(asc, desc) | No | Sort direction (default asc) |
| fields | string | No | Comma-separated list of response fields to return |
Request Example
- cURL
- JavaScript
- Python
- Go
curl -X GET 'https://api.requidex.com/api/open/v1/companies/{id}/custom-roles' \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Accept: application/json'
const response = await fetch(
"https://api.requidex.com/api/open/v1/companies/{id}/custom-roles",
{
method: "GET",
headers: {
Authorization: "Bearer <API_KEY>",
Accept: "application/json",
},
},
);
const json = await response.json();
import requests
response = requests.request(
'GET',
'https://api.requidex.com/api/open/v1/companies/{id}/custom-roles',
headers={
'Authorization': 'Bearer <API_KEY>',
'Accept': 'application/json',
},
timeout=30,
)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.requidex.com/api/open/v1/companies/{id}/custom-roles", nil)
req.Header.Set("Authorization", "Bearer <API_KEY>")
req.Header.Set("Accept", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
payload, _ := io.ReadAll(resp.Body)
fmt.Println(string(payload))
}
Response Fields
| Field | Type | Description |
|---|---|---|
| id | string | Custom role ObjectId |
| name | string | Custom role name |
| role | string | Base role: projectRequestor, projectApprover, or projectFinance |
| company | string | Company ObjectId |
| createdAt | string | Creation timestamp |
| updatedAt | string | Last update timestamp |
Response Example (200)
{
"success": true,
"data": [
{
"id": "507f1f77bcf86cd799439019",
"name": "Supervisor",
"company": "507f1f77bcf86cd799439011",
"role": "projectApprover",
"createdAt": "2026-01-10T12:00:00.000Z",
"updatedAt": "2026-02-20T14:03:12.111Z"
}
],
"meta": { "page": 1, "limit": 50, "total": 1 }
}
MCP Tool
The MCP server exposes this operation as open_api_list_company_custom_roles with the inputs id, page, limit, query, sortBy, sortOrder, and fields.
Errors
| HTTP Status | Description |
|---|---|
| 400 | Invalid filters or parameters |
| 401 | Missing, invalid, revoked, or expired API key |
| 403 | Missing scope, IP restriction, or agency-scoped key |
| 404 | Company not found within the key scope |
| 405 | Method not allowed on Open API routes |
| 429 | Rate limit exceeded |
| 500 | Failed to fetch company custom roles |