Skip to main content

Get All Corporates

This GET endpoint retrieves a list of corporates with pagination support. You can specify the page number and the number of items per page using query parameters.

Endpoint

  • URL: /corporates?page={page}&limit={limit}
  • Method: GET

Query Parameters

ParameterTypeDescription
pageintThe page number to retrieve. Default is 1.
limitintThe number of items per page. Default and max is 10.
companystringFilter corporates by parent company ID.
company:instringFilter corporates by a list of parent company IDs (comma-separated).
date_created:minstringFilter corporates created on or after this date (format: YYYY-MM-DD).
date_created:maxstringFilter corporates created on or before this date (format: YYYY-MM-DD).

Authentication

  • Header: accessToken
  • Type: Bearer Token
  • Value: <ACCESS-TOKEN>

Request Headers

HeaderTypeDescription
accessTokenstringAccess token for authentication. (required)

Request Body

No request body is needed for this GET operation.

Response

  • Status Code: 200 OK

Sample Response Body

A successful response will return a list of corporates with pagination details:

{
"success": true,
"data": [
{
"parentCompany": "67bd7732e2c361f0b15a1c18",
"name": "Test Company - 1",
"active": true,
"subCompanies": [
"64f72a721e63ec3bf06acd65",
"64ae9fbb401a953a2b8988a1"
],
"createdBy": {
"id": "64f0a70c6212cdcbe89a2402",
"name": "first key",
"type": "api"
},
"id": "67bd786f177125410d15d694"
}
],
"pagination": {
"page": 1,
"total": 1,
"count": 1
}
}

Success Response

FieldTypeDescription
successbooleanIndicates if the request was successful.
dataarrayList of corporate objects.
paginationobjectPagination details for the response data.

corporate Object (data[])

FieldTypeDescription
namestringName of the corporate.
parentCompanystringID of the parent company for which the sub-companies are assigned.
subCompaniesArrayID of the child companies that are assigned to the parent company
activebooleanCurrent status of the corporate (e.g., "active / inactive").
createdByobjectInformation about who created the corporate entry.
idstringUnique identifier for the corporate.

Pagination Object (pagination)

FieldTypeDescription
pageintCurrent page number of the response data.
totalintTotal number of available pages.
countintTotal number of records returned.

Error Responses

Status CodeDescription
401 UnauthorizedThe access token is invalid or missing.
403 ForbiddenYou do not have permission to access this resource.
500 Internal Server ErrorAn error occurred on the server.

Notes

  • Make sure the accessToken is valid and that the token has permission to access corporate data.
  • Adjust the page and limit query parameters to control pagination according to your needs.
  • Only accessible to authorized users with sufficient access rights.