Green earth docs
  • Green earth docs
  • Environment
  • Start
  • Api flow FAQ
  • Api endpoints
    • Login
    • Register
    • Automatic gebt distribution
    • Get transaction
    • List transactions
    • Get user
    • Modify user
    • List users
    • Create company (admin)
    • List company
    • Get company
  • Api errors
Powered by GitBook
On this page
  1. Api endpoints

List company

PreviousCreate company (admin)NextGet company

Last updated 1 year ago

Redoc document (api spec)

This API endpoint "GET /api/company/list" allows you to retrieve a list of companies. To access this endpoint, you will need an API key with either "partner" or "admin" level of authorization.

You can pass optional parameters of "company_id" and "company_name" in the query string to retrieve specific company information.

The response of this API endpoint returns a JSON object containing either an error message or the data of the companies requested. The data includes an array of company objects with properties such as "company_constants", "_id", "company_name", "createdAt", "updatedAt". The metadata object within the data object provides information about the page number, total number of items, and page size.

A successful response will have a HTTP status code of 200.

api-docs

List companies

get
Authorizations
Query parameters
company_idstringOptional

The id of the company

company_namestringOptional

The name of the company

Responses
200
Success
application/json
get
GET /api/company/list HTTP/1.1
Host: url to be defined
Authorization: YOUR_API_KEY
Accept: */*
200

Success

{
  "error": {
    "code": "040",
    "message": "Wrong email or password"
  },
  "data": {
    "companies": [
      {
        "company_constants": {
          "geis": 1
        },
        "_id": "text",
        "company_name": "text",
        "createdAt": "2025-05-20T05:38:52.512Z",
        "updatedAt": "2025-05-20T05:38:52.512Z"
      }
    ],
    "metadata": {
      "page": 1,
      "total_items": 1,
      "page_size": 20
    }
  }
}