Skip to main content

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​

ParameterTypeDescription
pageIntegerPage number to retrieve. Default is 1.
limitIntegerNumber of corporates per page. Default is 10.
companyStringFilter by parent company ID.
company:inStringComma-separated list of parent company IDs.
date_created:minStringCorporates created on or after this date (ISO 8601).
date_created:maxStringCorporates 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​

FieldTypeDescription
_idStringUnique identifier of the corporate.
parentCompanyStringID of the parent company.
nameStringName of the corporate. Defaults to the parent company's name.
activeBooleanWhether the corporate is active. Default is true.
subCompaniesArrayIDs of the direct sub-companies. Does not include indirect descendants and does not include access settings.
createdByObjectWho created the corporate (id, name, type).

Find the corporates a company belongs to​

There is no filter for this. Use two calls:

  1. Get Company and read parentIds.
  2. Call GET /corporates?company:in=<parentIds>, with the IDs comma-separated.

Pagination Details​

FieldTypeDescription
pageNumberCurrent page number.
totalNumberTotal number of corporates matching the filters.
countNumberNumber of corporates on this page.