API Overview
Base URLs, authentication, and common patterns for all APIs
Base URLs
| Service | URL |
|---|---|
| FHIR API | https://rkyywwxpkzzkvopnobvt.supabase.co/functions/v1/fhir-api |
| SMART Auth | https://rkyywwxpkzzkvopnobvt.supabase.co/functions/v1/smart-auth |
| HR API | https://rkyywwxpkzzkvopnobvt.supabase.co/functions/v1/hr-api |
| Inventory API | https://rkyywwxpkzzkvopnobvt.supabase.co/functions/v1/inventory-api |
Authentication
All API requests (except smart-auth and public endpoints) require a SMART on FHIR JWT:
Obtain a token via the Staff Login or Patient Login endpoints.
Common Request Patterns
Search (GET)
All FHIR resource searches support these common parameters:
| Parameter | Type | Description |
|---|---|---|
_count | number | Page size (default: 20) |
_offset | number | Pagination offset (default: 0) |
_sort | string | Sort field (prefix - for descending) |
_summary | string | count returns only total count |
Example:
Search Response (FHIR Bundle)
Create (POST)
Read (GET)
Update (PUT)
Delete (DELETE)
Error Responses
| HTTP Status | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad request / validation error |
| 401 | Unauthorized (missing/invalid token) |
| 403 | Forbidden (insufficient permissions) |
| 404 | Resource not found |
| 500 | Internal server error |
CORS
All Edge Functions return appropriate CORS headers. Preflight OPTIONS requests are handled automatically.
Public Endpoints
These endpoints do NOT require authentication:
| Endpoint | Description |
|---|---|
GET /metadata | FHIR CapabilityStatement |
GET /Organization/search-public | Search public organizations |
GET /Organization/{id}/public-profile | Public org profile |
GET /specializations | List practice specialties |
GET /.well-known/smart-configuration | SMART metadata |