Skip to Content
Admin APIClinicAppointments

Admin Clinic Appointments API

Administrative endpoints for managing appointments within the clinic system.

Filter Appointments

Filter and search appointments with advanced criteria.

Endpoint: POST /v1/admin/clinic/appointments/filter_appointments
Authentication: Required (Admin role)

Request Body Parameters

ParameterTypeRequiredDescription
searchstringNoSearch term
sort_bystringNoField to sort by
sort_dirstringNoSort direction
filtersobjectNoFilter criteria with available parameters: date (object with start_date/end_date), status (string), appointment_type (string), patient_name (string), provider_name (string)
page_sizeintegerNoNumber of items per page

Example Request

POST /v1/admin/clinic/appointments/filter_appointments HTTP/1.1 Content-Type: application/json X-User-Token: your_admin_token_here { "search": "therapy session", "filters": { "date": { "start_date": "2023-10-01", "end_date": "2023-10-31" }, "status": "completed", "appointment_type": "individual_therapy", "patient_name": "John Doe", "provider_name": "Dr. Smith" }, "sort_by": "scheduled_at", "sort_dir": "DESC", "page_size": 50 }

Response Format

{ "appointments": [ { "id": 789, "patient_id": 1049, "provider_id": 456, "scheduled_at": "2023-10-15T14:30:00.000Z", "status": "completed", "appointment_type": "individual_therapy", "created_at": "2023-10-01T10:00:00.000Z", "updated_at": "2023-10-15T15:45:00.000Z", "patient": { "id": 1049, "user": { "first_name": "John", "last_name": "Doe" } }, "provider": { "id": 456, "first_name": "Dr. Jane", "last_name": "Smith" } } ], "pagination": { "current_page": 1, "total_pages": 4, "total_count": 200, "per_page": 50 } }

Error Responses

422 Unprocessable Entity

{ "errors": "No appointments were found." }

Notes

  • All admin clinic endpoints require administrative privileges
  • Appointments are filtered based on clinic-wide access permissions
  • The status filter accepts appointment status values like “scheduled”, “completed”, “cancelled”
  • The appointment_type filter accepts values like “individual_therapy”, “group_therapy”, “assessment”
  • Date filters use ISO 8601 format (YYYY-MM-DD)