Skip to content

API Overview

Complete index of all API endpoints across the system, organized by feature.

Base URL

Production:  https://api.restartix.com
Development: http://localhost:9000

All endpoints require authentication unless marked as [Public].


Core Features

Authentication & Users

MethodEndpointDescription
GET/v1/meGet current user profile
PUT/v1/me/switch-organizationSwitch active organization
POST/webhooks/clerkClerk webhook handler (sync users) [Public]

Organizations

MethodEndpointDescription
GET/v1/public/organizations/resolveResolve org by slug or custom domain [Public]
GET/v1/organizationsList organizations
POST/v1/organizationsCreate organization (superadmin)
GET/v1/organizations/{id}Get organization details
PATCH/v1/organizations/{id}Update organization (admin)
DELETE/v1/organizations/{id}Delete organization (superadmin)
GET/v1/organizations/{id}/domainsList custom domains
POST/v1/organizations/{id}/domainsAdd custom domain (admin)
DELETE/v1/organizations/{id}/domains/{domainId}Remove custom domain (admin)
POST/v1/organizations/{id}/domains/{domainId}/verifyVerify domain DNS (admin)
GET/v1/organizations/{id}/api-keysList API keys (admin)
POST/v1/organizations/{id}/api-keysCreate API key (admin)
DELETE/v1/organizations/{id}/api-keys/{service}Delete API key (admin)
POST/v1/organizations/{id}/connect-userAdd user to org (admin)

Appointment & Scheduling

Appointments

MethodEndpointDescription
GET/v1/appointmentsList appointments (filtered by user role)
POST/v1/appointmentsCreate appointment
POST/v1/appointments/from-templateCreate from template
GET/v1/appointments/{id}Get appointment details
PUT/v1/appointments/{id}Update appointment
DELETE/v1/appointments/{id}Delete appointment
PUT/v1/appointments/{id}/statusTransition status
PUT/v1/appointments/{id}/rescheduleReschedule appointment
PUT/v1/appointments/{id}/cancelCancel appointment
POST/v1/appointments/{id}/onboardComplete patient onboarding
POST/v1/appointments/{id}/attach-formsAttach form templates

Calendar Views

MethodEndpointDescription
GET/v1/calendarMonth view (default: current month)
GET/v1/calendar?view=weekWeek view (detailed appointments)

Appointment Templates

MethodEndpointDescription
GET/v1/appointment-templatesList templates
POST/v1/appointment-templatesCreate template (admin)
GET/v1/appointment-templates/{id}Get template details
PUT/v1/appointment-templates/{id}Update template (admin)
DELETE/v1/appointment-templates/{id}Delete template (admin)
POST/v1/appointment-templates/{id}/attach-formsAttach form templates
DELETE/v1/appointment-templates/{id}/forms/{formTemplateId}Detach form
POST/v1/appointment-templates/{id}/attach-specialistsSet specialist priorities
DELETE/v1/appointment-templates/{id}/specialists/{specialistId}Remove specialist

Scheduling

MethodEndpointDescription
GET/v1/scheduling/timeslotsGet available timeslots [Public]
POST/v1/scheduling/holdsCreate hold [Public]
DELETE/v1/scheduling/holds/{holdId}Release hold [Public]
POST/v1/scheduling/bookConfirm booking [Public]
GET/v1/scheduling/holds/{holdId}/streamSSE stream (hold updates) [Public]

Profile Management

Patients

MethodEndpointDescription
GET/v1/patientsList patients (admin/specialist)
POST/v1/patientsCreate patient (admin)
GET/v1/patients/{id}Get patient details
PUT/v1/patients/{id}Update patient
DELETE/v1/patients/{id}Delete patient (admin)
GET/v1/patients/{id}/profileGet custom field values
PUT/v1/patients/{id}/profileUpdate custom field values
POST/v1/patients/{id}/impersonateImpersonate patient (admin)

Specialists

MethodEndpointDescription
GET/v1/specialistsList specialists
POST/v1/specialistsCreate specialist (admin)
GET/v1/specialists/{id}Get specialist details
PUT/v1/specialists/{id}Update specialist
DELETE/v1/specialists/{id}Delete specialist (admin)
GET/v1/specialists/{id}/profileGet custom field values
PUT/v1/specialists/{id}/profileUpdate custom field values
GET/v1/specialists/{id}/availabilityGet weekly hours + overrides
PUT/v1/specialists/{id}/availabilityUpdate availability config

Specialties

MethodEndpointDescription
GET/v1/specialtiesList specialties
POST/v1/specialtiesCreate specialty (admin)
GET/v1/specialties/{id}Get specialty details
PUT/v1/specialties/{id}Update specialty (admin)
DELETE/v1/specialties/{id}Delete specialty (admin)

Forms (Templates + Instances)

See Forms Feature Documentation for complete details.

Form Templates (Design)

MethodEndpointDescription
GET/v1/form-templatesList templates
POST/v1/form-templatesCreate template (admin)
GET/v1/form-templates/{id}Get template details
PUT/v1/form-templates/{id}Update template draft (admin)
DELETE/v1/form-templates/{id}Delete template (admin, drafts only)
POST/v1/form-templates/{id}/publishPublish version (admin)
POST/v1/form-templates/{id}/duplicateDuplicate template (admin)
GET/v1/form-templates/{id}/versionsList version history
POST/v1/form-templates/{id}/rollback/{version}Rollback to version (admin)

Form Instances (Runtime)

MethodEndpointDescription
GET/v1/formsList forms
POST/v1/formsCreate form instance
GET/v1/forms/{id}Get form details
PUT/v1/forms/{id}Save form values
DELETE/v1/forms/{id}Delete form (admin, unsigned only)
POST/v1/forms/{id}/signSign form (immutable)
POST/v1/forms/{id}/filesUpload file to field
GET/v1/forms/{id}/files/{fieldKey}Get signed URL for file
DELETE/v1/forms/{id}/files/{fieldKey}Delete file (unsigned only)

Custom Fields

MethodEndpointDescription
GET/v1/custom-fieldsList custom field definitions
POST/v1/custom-fieldsCreate custom field (admin)
GET/v1/custom-fields/{id}Get custom field definition
PUT/v1/custom-fields/{id}Update custom field (admin)
DELETE/v1/custom-fields/{id}Delete custom field (admin)

Segments

MethodEndpointDescription
GET/v1/segmentsList segments
POST/v1/segmentsCreate segment (admin)
GET/v1/segments/{id}Get segment details
PUT/v1/segments/{id}Update segment rules (admin)
DELETE/v1/segments/{id}Delete segment (admin)
GET/v1/segments/{id}/membersList segment members
POST/v1/segments/{id}/evaluateRe-evaluate membership (admin)

Telerehabilitation

Exercise Library

MethodEndpointDescription
GET/v1/exercisesList/search exercises (global + org, taxonomy filters)
POST/v1/exercisesCreate exercise (admin: org, superadmin: global)
GET/v1/exercises/{id}Get exercise with instructions, tags, contraindications
PUT/v1/exercises/{id}Update exercise
DELETE/v1/exercises/{id}Soft delete exercise
PUT/v1/exercises/{id}/statusTransition status (draft/published/archived)
POST/v1/exercises/{id}/cloneClone exercise (global→org or org→org)
POST/v1/exercises/{id}/videoUpload video
DELETE/v1/exercises/{id}/videoRemove video
GET/v1/exercises/{id}/instructionsList instruction steps
POST/v1/exercises/{id}/instructionsAdd instruction step
PUT/v1/exercises/{id}/instructions/{instructionId}Update instruction
DELETE/v1/exercises/{id}/instructions/{instructionId}Remove instruction
POST/v1/exercises/{id}/instructions/{instructionId}/imageUpload instruction image
PUT/v1/exercises/{id}/instructions/reorderReorder instructions
GET/v1/exercise-categoriesList categories (global + org)
POST/v1/exercise-categoriesCreate category
PUT/v1/exercise-categories/{id}Update category
DELETE/v1/exercise-categories/{id}Delete category
GET/v1/exercise-body-regionsList body regions
POST/v1/exercise-body-regionsCreate body region
PUT/v1/exercise-body-regions/{id}Update body region
DELETE/v1/exercise-body-regions/{id}Delete body region
GET/v1/exercise-equipmentList equipment
POST/v1/exercise-equipmentCreate equipment
PUT/v1/exercise-equipment/{id}Update equipment
DELETE/v1/exercise-equipment/{id}Delete equipment

Treatment Plans

MethodEndpointDescription
GET/v1/treatment-plansList treatment plans
POST/v1/treatment-plansCreate treatment plan (draft)
GET/v1/treatment-plans/{id}Get plan with sessions and exercises
PUT/v1/treatment-plans/{id}Update plan (draft only)
DELETE/v1/treatment-plans/{id}Soft delete plan
POST/v1/treatment-plans/{id}/publishPublish version (creates snapshot)
PUT/v1/treatment-plans/{id}/statusTransition plan status
GET/v1/treatment-plans/{id}/versionsList version history
GET/v1/treatment-plans/{id}/versions/{version}Get specific version snapshot
POST/v1/treatment-plans/{id}/rollback/{version}Rollback to version
POST/v1/treatment-plans/{id}/duplicateDuplicate plan
POST/v1/treatment-plans/{id}/cloneClone plan (custom copy)
POST/v1/treatment-plans/{id}/promotePromote custom to org plan
GET/v1/treatment-plans/libraryBrowse premade plans (patient)
POST/v1/treatment-plans/{id}/self-assignPatient self-assigns from library
GET/v1/treatment-plans/{id}/sessionsList sessions in plan
POST/v1/treatment-plans/{id}/sessionsAdd session to plan
PUT/v1/treatment-plans/{planId}/sessions/{sessionId}Update session
DELETE/v1/treatment-plans/{planId}/sessions/{sessionId}Remove session
PUT/v1/treatment-plans/{planId}/sessions/reorderReorder sessions
GET/v1/treatment-plan-sessions/{sessionId}/exercisesList exercises in session
POST/v1/treatment-plan-sessions/{sessionId}/exercisesAdd exercise to session
PUT/v1/treatment-plan-sessions/{sessionId}/exercises/{exerciseId}Update exercise config
DELETE/v1/treatment-plan-sessions/{sessionId}/exercises/{exerciseId}Remove exercise
PUT/v1/treatment-plan-sessions/{sessionId}/exercises/reorderReorder exercises
GET/v1/patient-treatment-plansList patient enrollments
POST/v1/patient-treatment-plansAssign plan to patient
GET/v1/patient-treatment-plans/{id}Get enrollment details
PUT/v1/patient-treatment-plans/{id}/statusChange status (pause/resume/cancel)
POST/v1/patient-treatment-plans/{id}/approveApprove plan (approval workflow)
GET/v1/patients/{patientId}/treatment-plansList all plans for patient
GET/v1/patients/{patientId}/treatment-plans/todayGet today's session
POST/v1/patient-treatment-plans/{id}/sessions/{num}/startStart session
PUT/v1/patient-exercise-logs/{id}Update exercise log (during session)
POST/v1/patient-session-completions/{id}/completeComplete session
POST/v1/patient-session-completions/{id}/skipSkip session
GET/v1/patient-session-completions/{id}Get session completion details
GET/v1/patient-session-completions/{id}/exercise-logsGet exercise logs
GET/v1/patient-treatment-plans/{id}/progressGet plan progress
GET/v1/patient-treatment-plans/{id}/analyticsGet detailed analytics

Services

Service Plan Bundled Products

MethodEndpointDescription
GET/v1/service-plans/{id}/productsList bundled products
POST/v1/service-plans/{id}/productsAdd product to bundle
PUT/v1/service-plans/{id}/products/{pid}Update bundled quantity
DELETE/v1/service-plans/{id}/products/{pid}Remove from bundle

Patient Product Orders

MethodEndpointDescription
GET/v1/patient-product-ordersList product orders
POST/v1/patient-product-ordersCreate standalone order
PUT/v1/patient-product-orders/{id}/statusUpdate order status
POST/v1/patient-product-orders/{id}/cancelCancel order

Supporting Features

PDF Templates

MethodEndpointDescription
GET/v1/pdf-templatesList PDF templates
POST/v1/pdf-templatesCreate template (admin)
GET/v1/pdf-templates/{id}Get template details
PUT/v1/pdf-templates/{id}Update template draft (admin)
POST/v1/pdf-templates/{id}/publishPublish new version (admin)
POST/v1/pdf-templates/{id}/rollback/{version}Rollback to version (admin)
DELETE/v1/pdf-templates/{id}Delete template (admin)
GET/v1/pdf-templates/{id}/previewPreview with sample data
POST/v1/pdf-templates/{id}/renderRender PDF with form data
POST/v1/pdf-templates/batch-renderBatch render PDFs (async)
GET/v1/pdf-template-componentsList reusable components
POST/v1/pdf-template-componentsCreate component (admin)
PUT/v1/pdf-template-components/{id}Update component (admin)
DELETE/v1/pdf-template-components/{id}Delete component (admin)

Documents

MethodEndpointDescription
POST/v1/reportsGenerate report PDF
GET/v1/reports/{id}Get report details
GET/v1/reports/{id}/downloadDownload signed PDF URL
POST/v1/reports/{id}/signDigitally sign report
POST/v1/prescriptionsGenerate prescription PDF
GET/v1/prescriptions/{id}Get prescription details
GET/v1/prescriptions/{id}/downloadDownload signed PDF URL
POST/v1/prescriptions/{id}/signDigitally sign prescription

Webhooks

MethodEndpointDescription
GET/v1/webhook-subscriptionsList webhook subscriptions (admin)
POST/v1/webhook-subscriptionsCreate subscription (admin)
PATCH/v1/webhook-subscriptions/{uid}Update subscription (admin)
DELETE/v1/webhook-subscriptions/{uid}Delete subscription (admin)
GET/v1/webhook-subscriptions/{uid}/eventsList delivery events (admin)
POST/v1/webhook-subscriptions/{uid}/testSend test event (admin)

Telemetry (Telemetry & Compliance)

See Telemetry Feature Documentation for full documentation.

Media Events

MethodEndpointDescription
POST/v1/media/eventsTrack video/exercise media event
GET/v1/media/bandwidth/statsBandwidth statistics by dimension
GET/v1/media/sessions/statsSession statistics and performance

Analytics

MethodEndpointDescription
POST/v1/analytics/trackTrack product analytics event

Pose Tracking

MethodEndpointDescription
POST/v1/pose/framesBatch submit MediaPipe pose data

Audit

MethodEndpointDescription
POST/v1/audit/ingestIngest audit entry (internal)

Error Tracking

MethodEndpointDescription
POST/v1/errors/reportReport frontend error

Admin

MethodEndpointDescription
POST/v1/admin/geo/updateUpdate geolocation database
GET/v1/admin/geo/statusGeo database status
GET/v1/admin/privacy/exclusionsList CCPA exclusions
POST/v1/admin/privacy/exclusions/syncSync MaxMind exclusions
GET/v1/admin/privacy/exclusions/checkCheck IP exclusion status

Dashboard

MethodEndpointDescription
GET/dashboard/Dashboard home
GET/dashboard/auditAudit viewer
GET/dashboard/analyticsAnalytics viewer
GET/dashboard/mediaMedia session viewer
GET/dashboard/securitySecurity events viewer
GET/dashboard/detail/:type/:idDetail view

Global Conventions

Authentication

All endpoints (except [Public]) require:

http
Authorization: Bearer <clerk_session_token>

Public endpoints:

  • /v1/public/organizations/resolve (domain routing)
  • /webhooks/clerk (verified via HMAC signature)
  • /v1/scheduling/* (public booking flow)

Organization Context

The active organization is determined by:

  1. X-Organization-ID header (set by frontend proxy based on domain resolution)
  2. Falls back to user's current_organization_id if header is not present
  3. Superadmins can operate without org context (access all organizations)

Pagination

List endpoints support pagination:

http
GET /v1/patients?page=2&limit=50

Response:

json
{
  "data": [...],
  "pagination": {
    "page": 2,
    "limit": 50,
    "total": 237,
    "total_pages": 5
  }
}

Defaults: page=1, limit=25, max limit=100

Filtering

List endpoints support filtering via query params:

http
GET /v1/appointments?status=upcoming&specialist_id=5
GET /v1/forms?status=pending&type=consent
GET /v1/patients?segment_id=10

See individual feature docs for available filters.

Sorting

List endpoints support sorting:

http
GET /v1/appointments?sort=-started_at    # Descending by started_at
GET /v1/patients?sort=created_at         # Ascending by created_at

Format: sort={field} (ascending) or sort=-{field} (descending)

Error Responses

All errors return consistent format:

json
{
  "error": {
    "code": "validation_failed",
    "message": "Validation error",
    "details": {
      "field": "email",
      "error": "invalid format"
    }
  }
}

Common error codes:

  • 401 - Unauthorized (invalid/missing token)
  • 403 - Forbidden (insufficient permissions)
  • 404 - Not Found
  • 409 - Conflict (e.g., form already signed)
  • 422 - Validation Failed
  • 429 - Rate Limited
  • 500 - Internal Server Error

Rate Limiting

API rate limits:

ScopeLimitWindow
Per user1000 requests1 minute
Per IP (public endpoints)100 requests1 minute
Webhook deliveries50 events5 seconds

Headers:

http
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 987
X-RateLimit-Reset: 60

Idempotency

POST/PUT/DELETE endpoints support idempotency via:

http
Idempotency-Key: <unique-client-generated-key>

Server caches response for 24 hours. Duplicate requests return cached response.


Endpoint Count by Category

CategoryEndpointsFeatures
Core11Auth, Organizations
Appointments & Scheduling28Appointments, Templates, Scheduling
Profiles19Patients, Specialists, Specialties
Forms System28Forms, Templates, Custom Fields, Segments
Telerehabilitation67Exercise Library (27), Treatment Plans (40)
Services8Bundled Products, Product Orders
Supporting15Documents, Webhooks
Telemetry18Media Events, Analytics, Pose Tracking, Audit, Error Tracking, Admin, Dashboard
Total19428