Tutorial: Get Contracts
This tutorial guides you through how to retrieve a paginated list of contracts using the public API endpoint.
Admin only — this endpoint requires an admin-level API token.
Endpoint
GET /api/v1/contracts
Authorization
This endpoint requires authentication and an admin-level token.
Authorization: Bearer <your_token_here>
Accept: application/json
Query Parameters
| Parameter |
Type |
Default |
Description |
status |
string |
— |
Filter by contract status (e.g. ongoing, ended) |
search |
string |
— |
Search by consultant name, client or vendor company |
per_page |
integer |
10 |
Number of results per page |
page |
integer |
1 |
Page number |
Example cURL
curl -X GET "https://api.sbox2.peoplecloudpro.com/api/v1/contracts" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json"
Response Structure
{
"total": 35,
"per_page": 10,
"current_page": 1,
"last_page": 4,
"from": 1,
"to": 10,
"contracts": [
{
"id": 42,
"the_contract_id": "2025-001",
"status": "active",
"contract_start": "2025-01-01 00:00:00",
"contract_end": "2025-12-31 00:00:00",
"client_company_name": "Acme Corp",
"vendor_company_name": "TechVendor Oy",
"consult_name": "John Doe",
"consult_title": "Senior Developer",
"created_at": "2025-01-01T10:00:00.000000Z",
"updated_at": "2025-03-15T08:30:00.000000Z"
}
]
}
Response Fields
| Field |
Description |
total |
Total number of matching contracts |
per_page |
Results per page |
current_page |
Current page number |
last_page |
Total number of pages |
from |
Index of first result on this page |
to |
Index of last result on this page |
Contract Object
| Field |
Description |
id |
Numeric database ID |
the_contract_id |
Public-facing contract identifier |
status |
Current status (active, terminated, etc.) |
contract_start |
Contract start date |
contract_end |
Contract end date |
client_company_name |
Name of the client company |
vendor_company_name |
Name of the vendor company |
consult_name |
Name of the assigned consultant |
consult_title |
Title of the assigned consultant |
created_at |
Record creation timestamp |
updated_at |
Last updated timestamp |
Error Responses
| Status |
Meaning |
Description |
| 200 |
OK |
Contract successfully retrieved |
| 401 |
Unauthorized |
Missing or invalid Bearer token |
| 403 |
Forbidden |
Token does not have admin privileges |
| 404 |
Not Found |
No contract found with the provided ID |