List Cost Codes
GET
/projects/{id}/cost-codesAgency-scoped keys
This endpoint is not available for agency-scoped API keys.
Summary
Lists the cost codes for one project accessible to the company-scoped API key. Active and inactive cost codes are included by default.
URL Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Project id or nanoid |
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 in code or description |
| status | enum(active, inactive) | No | Filter by status |
| sortBy | enum(code, description, createdAt, updatedAt) | No | Sort field (default description) |
| sortOrder | enum(asc, desc) | No | Sort direction (default asc) |
| fields | string | No | Comma-separated list of response fields or dot-path nested fields to return |
Request Example
- cURL
- JavaScript
curl -X GET 'https://api.requidex.com/api/open/v1/projects/{id}/cost-codes?status=active&page=1' \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Accept: application/json'
const response = await fetch("https://api.requidex.com/api/open/v1/projects/{id}/cost-codes?status=active&page=1", {
headers: { Authorization: "Bearer <API_KEY>", Accept: "application/json" },
});
const json = await response.json();
Response Example
{
"success": true,
"data": [
{
"id": "67bc36db80a1616ec3f47010",
"nanoid": "abc123def4",
"code": "419498",
"description": "Training Centre",
"active": true,
"createdAt": "2026-09-01T10:00:00.000Z",
"updatedAt": "2026-09-01T10:00:00.000Z"
}
],
"meta": { "page": 1, "limit": 50, "total": 1 }
}
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | BAD_REQUEST | Invalid status or pagination parameters |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 403 | FORBIDDEN | Missing read:projects scope or agency-scoped key |
| 404 | NOT_FOUND | Project is not accessible to the key |