API Overview & Authentication
Available APIs
Treatlly provides two API sets:
- Public API (
/api/v1/) — For third-party integrations and custom frontends - Mobile API (
/mobile/v1/) — Optimized for mobile app development
Authentication
All API requests require authentication:
- API Keys — Generated from your admin dashboard for server-to-server calls
- OTP Authentication — For patient-facing mobile apps
Key Endpoints
| Endpoint | Description |
|---|---|
GET /api/v1/doctors | List doctors |
GET /api/v1/slots | Available slots for a doctor (supports consultation_mode filter) |
POST /api/v1/appointments | Create an appointment |
GET /mobile/v1/profile | Patient profile |
GET /mobile/v1/appointments | Patient appointments (includes teleconsultation info) |
GET /mobile/v1/slots | Available slots for mobile booking |
Rate Limiting
- 100 requests per minute per API key
- Rate limit headers included in responses
- 429 status returned when exceeded
API Key Management
- Go to Settings → API Access
- Click Generate New Key
- Enter a description and copy the key (shown once)
- Store securely — you can revoke keys if compromised
Best Practices
- Always use HTTPS
- Handle rate limits gracefully with exponential backoff
- Cache responses where appropriate
- Use idempotency keys for payment-related endpoints