Get All Corporates
Retrieves a paginated list of corporates. A corporate links a parent company to its sub-companies. Each parent company has at most one corporate. subCompanies holds direct sub-companies only, and a company can appear in several corporates.
See Corporate Hierarchy and Access for how the hierarchy works.
HTTP Request
- URL:
/corporates - Method:
GET - Headers:
accessToken: Required. Your API access token.
- Required scope:
READ_WRITE_COMPANY
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | Integer | Page number to retrieve. Default is 1. |
limit | Integer | Number of corporates per page. Default is 10. |
company | String | Filter by parent company ID. |
company:in | String | Comma-separated list of parent company IDs. |
date_created:min | String | Corporates created on or after this date (ISO 8601). |
date_created:max | String | Corporates created on or before this date (ISO 8601). Send date_created:min and date_created:max one at a time: when both are sent, only date_created:max is applied. |
cURL Example
curl --location '<BASE_URL>/corporates?company=67bd7732e2c361f0b15a1c18' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The corporates were returned successfully.
- 400 Bad Request: The access token is missing or invalid, or a filter value is not valid.
Sample JSON Response
{
"success": true,
"data": [
{
"_id": "67bd786f177125410d15d694",
"parentCompany": "67bd7732e2c361f0b15a1c18",
"name": "Keystone Holdings",
"active": true,
"subCompanies": [
"64f72a721e63ec3bf06acd65",
"64ae9fbb401a953a2b8988a1"
],
"createdBy": {
"id": "64f0a70c6212cdcbe89a2402",
"name": "ERP integration",
"type": "api"
}
}
],
"pagination": {
"page": 1,
"total": 1,
"count": 1
}
}
Response Details
Corporate Data
| Field | Type | Description |
|---|---|---|
_id | String | Unique identifier of the corporate. |
parentCompany | String | ID of the parent company. |
name | String | Name of the corporate. Defaults to the parent company's name. |
active | Boolean | Whether the corporate is active. Default is true. |
subCompanies | Array | IDs of the direct sub-companies. Does not include indirect descendants and does not include access settings. |
createdBy | Object | Who created the corporate (id, name, type). |
Find the corporates a company belongs to
There is no filter for this. Use two calls:
- Get Company and read
parentIds. - Call
GET /corporates?company:in=<parentIds>, with the IDs comma-separated.
Pagination Details
| Field | Type | Description |
|---|---|---|
page | Number | Current page number. |
total | Number | Total number of corporates matching the filters. |
count | Number | Number of corporates on this page. |