Introduction to the MedCompliance API for developers.
Build powerful integrations with the MedCompliance REST API.
MedCompliance API allows developers to:
API Version: v1
Base URL: https://api.medcompliance.com/v1
Format: JSON
Authentication: API Key (Bearer token)
Requirements:
Generate API Key:
1. Log in as Admin
2. Navigate to Settings → API
3. Click "Generate New API Key"
4. Copy key immediately (shown once)
5. Store securely
API Key Format:
`
med_live_1234567890abcdefghijklmnop
`
Security:
Include API key in header:
`
bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.medcompliance.com/v1/inspections
`
GET /inspections
`
bash
curl -X GET \
-H "Authorization: Bearer med_live_..." \
-H "Content-Type: application/json" \
https://api.medcompliance.com/v1/inspections
`
Response:
`
json
{
"data": [
{
"id": 123,
"facility": "Memorial Hospital",
"type": "annual",
"status": "completed",
"date": "2025-01-15",
"technician": "John Doe"
}
],
"meta": {
"total": 150,
"page": 1,
"per_page": 20
}
}
`
GET /inspections - List all inspections
GET /inspections/{id} - Get inspection details
POST /inspections - Create inspection
PATCH /inspections/{id} - Update inspection
DELETE /inspections/{id} - Delete inspection
GET /reports - List reports
GET /reports/{id} - Download report
POST /reports - Generate custom report
GET /users - List users
GET /users/{id} - Get user details
POST /users - Create user
PATCH /users/{id} - Update user
GET /organizations - List organizations
GET /organizations/{id} - Get organization details
Query Parameters:
page
: Page number (default: 1)per_page
: Items per page (default: 20, max: 100)Example:
`
bash
GET /inspections?page=2&per_page=50
`
Response includes:
`
json
{
"meta": {
"total": 500,
"page": 2,
"per_page": 50,
"total_pages": 10
}
}
`
Filter by field:
`
bash
GET /inspections?status=completed&type=annual
`
Date range:
`
bash
GET /inspections?start_date=2025-01-01&end_date=2025-12-31
`
HTTP Status Codes:
200
OK - Success201
Created - Resource created400
Bad Request - Invalid parameters401
Unauthorized - Invalid API key403
Forbidden - Insufficient permissions404
Not Found - Resource doesn't exist429
Too Many Requests - Rate limit exceeded500
Internal Server Error - Server errorError Response:
`
json
{
"error": {
"code": "invalid_request",
"message": "Missing required field: facility_id",
"details": {
"field": "facility_id",
"required": true
}
}
}
`
Limits:
Rate Limit Headers:
`
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1640995200
`
Exceeding Limits:
1. Use Webhooks - Don't poll, use webhooks for real-time updates
2. Cache Responses - Reduce API calls with caching
3. Batch Requests - Combine multiple operations
4. Handle Errors Gracefully - Retry with backoff
5. Version Your Integrations - Specify API version in requests
Official SDKs:
npm install @medcompliance/api
pip install medcompliance
composer require medcompliance/api
gem install medcompliance
Community Libraries:
Sandbox Environment:
https://sandbox-api.medcompliance.com/v1
med_test_
Postman Collection:
1. Read [API Authentication](/knowledge-base/api-authentication) guide
2. Explore [API Endpoints Reference](/knowledge-base/api-endpoints)
3. Set up [Webhooks](/knowledge-base/webhook-integration)
4. Join developer community forum
Need help? Email api-support@medcompliance.com or visit docs.medcompliance.com
Let us know if you have any questions or feedback!