Skip to main content
GET
/
api
/
adm
/
companies
Get Companies
curl --request GET \
  --url https://localhost:44371/api/adm/companies \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "code": 200,
  "errorMessage": null,
  "entries": []
}

Description

Queries all companies in the system with optional filtering by name, status, or other criteria. Results are paginated and can be sorted. This endpoint is commonly used for admin dashboards, company selection dropdowns, and reporting interfaces.

Input

  • Query Parameters: model (CompanyQueryRequest) — Filtering options including:
    • name (string, optional) — Filter by company name (case-insensitive partial match).
    • isActive (bool, optional) — Filter by active status.
    • limit (int, optional) — Maximum number of records to return (default: 20).
    • offset (int, optional) — Number of records to skip for pagination.

Output

Returns a CompanyQueryResponse containing matching companies or an empty list if none found.

Example Request

GET /api/admin/companies?name=Acme&isActive=true&limit=20
Authorization: Bearer {token}

Example Response

{
  "success": true,
  "code": 200,
  "errorMessage": null,
  "entries": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name": "Acme Corporation",
      "contactEmail": "[email protected]",
      "isActive": true,
      "createdDate": "2025-01-15T10:30:00Z"
    }
  ]
}

Errors

  • 400 Bad Request — Invalid query parameters or filter values.
  • 401 Unauthorized — Missing or invalid authentication token.

Notes

  • Results are paginated; use limit and offset parameters for large datasets.
  • Company name search is case-insensitive and supports partial matching.
  • Empty results (no matching companies) return success with an empty entries array.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Query Parameters

Id
string<guid> | null

Optional identifier to filter results by a specific entity.

Example:

"3fa85f64-5717-4562-b3fc-2c963f66afa6"

Response

Always returned. Check the success property in the response body to determine if the operation succeeded.

Standard response structure containing operation status and error information. Standard query response containing a collection of matching entities. Represents the response payload returned when querying for companies. Wraps paginated company results for the administrative list endpoints.

success
boolean

True if the operation completed successfully; false if an error occurred.

Example:

true

code
enum<string>

Result code indicating the outcome of the operation.

Available options:
Unknown,
Success,
BadRequest,
Unauthorized,
NotFound,
Error
Example:

200

errorMessage
string | null

Human-readable error message when an error occurs.

Example:

null

entries
object[] | null

Collection of entities matching the query criteria.

Example:
[]