API Documentation
Build powerful insurance management integrations with our RESTful API
Version 1.0
REST
JSON
Quick Start
Base URL:
https://api.midastech.in/v1
Authentication
All API requests require authentication using Bearer tokens. Include your API key in the Authorization header:
curl -X GET "https://api.midastech.in/v1/customers" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Keep your API keys secure and never share them publicly. You can generate API keys from your account settings.
Response Format
All responses are returned in JSON format:
{
"success": true,
"data": {
// Response data
},
"message": "Success message",
"meta": {
"current_page": 1,
"per_page": 15,
"total": 100
}
}
Error Handling
Error responses include an error code and message:
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid.",
"errors": {
"email": ["The email field is required."]
}
}
}
Rate Limiting
API requests are limited to:
- Basic Plan: 1,000 requests per hour
- Professional Plan: 5,000 requests per hour
- Enterprise Plan: 20,000 requests per hour
Rate limit headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640000000
API Endpoints
Customers API
GET /customers
Retrieve a list of all customers
GET /v1/customers?page=1&per_page=15&search=john
GET /customers/{id}
Retrieve a specific customer
GET /v1/customers/123
POST /customers
Create a new customer
POST /v1/customers
{
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"phone": "+919876543210",
"date_of_birth": "1990-01-15"
}
PUT /customers/{id}
Update an existing customer
DELETE /customers/{id}
Delete a customer
Policies API
GET /policies
Retrieve a list of all policies
GET /v1/policies?customer_id=123&status=active
GET /policies/{id}
Retrieve a specific policy
POST /policies
Create a new policy
POST /v1/policies
{
"customer_id": 123,
"product_id": 45,
"policy_number": "POL-2024-001",
"start_date": "2024-01-01",
"end_date": "2025-01-01",
"premium_amount": 15000,
"sum_assured": 500000
}
PUT /policies/{id}
Update an existing policy
DELETE /policies/{id}
Cancel a policy
Claims API
GET /claims
Retrieve a list of all claims
GET /v1/claims?policy_id=123&status=pending
GET /claims/{id}
Retrieve a specific claim
POST /claims
File a new claim
POST /v1/claims
{
"policy_id": 123,
"claim_type": "hospitalization",
"claim_amount": 75000,
"incident_date": "2024-12-01",
"description": "Medical treatment for surgery"
}
PUT /claims/{id}
Update claim status
Webhooks
Configure webhooks to receive real-time notifications about events in your account.
Available Events
customer.created |
New customer added |
customer.updated |
Customer information changed |
policy.created |
New policy created |
policy.expiring |
Policy expiring in 30 days |
claim.filed |
New claim filed |
claim.updated |
Claim status changed |
Webhook Payload Example
{
"event": "policy.expiring",
"data": {
"id": 123,
"policy_number": "POL-2024-001",
"customer": {
"id": 456,
"name": "John Doe"
},
"expiry_date": "2025-01-01",
"days_until_expiry": 30
},
"timestamp": "2024-12-01T10:30:00Z"
}