Skip to main content
GET
/
clinics
curl -X 'GET' \
  'http://localhost:5001/clinics?page=1&limit=20&isActive=true' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <your_access_token>'
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "legalName": "ABC Medical Center LLC",
      "displayName": "ABC Medical Center",
      "email": "contact@abcmedical.com",
      "tenantId": "tenant-id-123",
      "isActive": true,
      "createdAt": "2024-01-01T00:00:00.000Z",
      "updatedAt": "2024-01-01T00:00:00.000Z",
      "locations": []
    }
  ],
  "pagination": {
    "total": 50,
    "page": 1,
    "limit": 20,
    "totalPages": 3
  },
  "stats": {
    "total": 50,
    "active": 45,
    "inactive": 5
  }
}

Overview

Retrieves a paginated list of all clinics that the authenticated user has access to. Supports filtering by active status and full-text search. Restrictions: Only accessible to clinic administrators with the admin:clinic permission. Results are ordered by creation date (newest first).

Headers

This endpoint uses Machine-to-Machine (M2M) authentication.
Authorization
string
required
Standard Bearer token (e.g., Bearer <your_access_token>). See the M2M Authentication guide for details.
Accept
string
Optional. Accept header to specify response media type (e.g., application/json).

Query Parameters

page
integer
default:"1"
Page number for pagination.
limit
integer
default:"20"
Number of items to return per page.
isActive
boolean
Filter by active status (true for active, false for inactive).
Search term to filter by clinic name or email.
state
string
Filter by location state (e.g., “NY”, “CA”, “TX”).
sort_by
string
default:"name"
Column to sort results by. Accepted values: name, createdAt, updatedAt.
sort_order
string
default:"asc"
Sort direction. Accepted values: asc, desc.

Response Parameters

The response returns a paginated list of clinics along with pagination metadata and status statistics.
data
array
List of clinic objects.
data[].id
string
The unique UUID of the clinic.
The legal registered name of the clinic.
data[].displayName
string
The display name of the clinic.
data[].email
string
Contact email for the clinic.
data[].tenantId
string
The unique identifier of the tenant.
data[].isActive
boolean
Indicates if the clinic is currently active.
data[].createdAt
string
Creation timestamp (ISO 8601).
data[].updatedAt
string
Last updated timestamp (ISO 8601).
data[].locations
array
List of physical locations associated with the clinic.
pagination
object
Pagination metadata.
pagination.total
integer
Total number of clinics matching the criteria.
pagination.page
integer
Current page number.
pagination.limit
integer
Items per page.
pagination.totalPages
integer
Total number of pages available.
stats
object
Aggregate statistics for the result set.
stats.total
integer
Total count of clinics.
stats.active
integer
Count of active clinics.
stats.inactive
integer
Count of inactive clinics.

Status Codes

StatusDescription
200Success. List of clinics retrieved successfully.
401Unauthorized. Invalid or missing authentication token.
403Forbidden. Insufficient permissions. User must have the admin:clinic permission.
curl -X 'GET' \
  'http://localhost:5001/clinics?page=1&limit=20&isActive=true' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <your_access_token>'
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "legalName": "ABC Medical Center LLC",
      "displayName": "ABC Medical Center",
      "email": "contact@abcmedical.com",
      "tenantId": "tenant-id-123",
      "isActive": true,
      "createdAt": "2024-01-01T00:00:00.000Z",
      "updatedAt": "2024-01-01T00:00:00.000Z",
      "locations": []
    }
  ],
  "pagination": {
    "total": 50,
    "page": 1,
    "limit": 20,
    "totalPages": 3
  },
  "stats": {
    "total": 50,
    "active": 45,
    "inactive": 5
  }
}