API Overview
The CallCov API is organized around REST principles. It uses predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes and authentication.
Base URLβ
https://api.callcov.com/api/v1
Authenticationβ
The CallCov API uses API keys or JWT tokens to authenticate requests. Include your key in the Authorization header:
Authorization: Bearer sk_live_abc123...
Learn more in the Authentication Guide.
Request Formatβ
All POST, PUT, and PATCH requests must include a Content-Type header:
Content-Type: application/json
For file uploads, use:
Content-Type: multipart/form-data
Response Formatβ
All responses are returned in JSON format with a consistent structure:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"object": "analysis",
"created": 1642248000,
...
}
HTTP Status Codesβ
CallCov uses conventional HTTP response codes:
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Invalid or missing authentication |
| 403 | Forbidden | Insufficient permissions |
| 404 | Not Found | Resource doesn't exist |
| 422 | Unprocessable Entity | Validation error |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error (contact support) |
Error Handlingβ
Errors include detailed information:
{
"detail": [
{
"type": "missing",
"loc": ["body", "audio_url"],
"msg": "Field required",
"input": {}
}
]
}
Learn more in the Error Handling Guide.
Versioningβ
The API version is included in the URL path:
/api/v1/analysis/
We'll maintain backward compatibility within major versions. Breaking changes will result in a new version (e.g., /api/v2/).
Rate Limitingβ
Rate limits protect our infrastructure and ensure fair usage:
- Default: 100 requests per minute
- Analysis submissions: 20 per minute
Rate limit headers are included in all responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1642248060
Paginationβ
List endpoints support pagination:
GET /api/v1/analysis/?skip=0&limit=20
Parameters:
skip: Number of records to skip (default: 0)limit: Maximum number of records to return (default: 20, max: 100)
Response:
{
"items": [...],
"total": 150,
"skip": 0,
"limit": 20
}
Timestampsβ
All timestamps are Unix timestamps (seconds since epoch):
{
"created": 1642248000 // January 15, 2022 10:00:00 UTC
}
Convert in your language of choice:
# Python
from datetime import datetime
dt = datetime.fromtimestamp(1642248000)
// JavaScript
const date = new Date(1642248000 * 1000);
Idempotencyβ
To safely retry requests without performing the same operation twice, include an Idempotency-Key header:
Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000
Idempotency keys are valid for 24 hours.
Metadataβ
Many resources accept custom metadata:
{
"audio_url": "https://example.com/call.wav",
"metadata": {
"campaign_id": "summer_2024",
"department": "sales"
}
}
Metadata is returned unchanged and can be used for your own tracking purposes.
Webhooksβ
For long-running operations like analysis, use webhooks instead of polling:
{
"audio_url": "https://example.com/call.wav",
"webhook_url": "https://your-app.com/webhooks/analysis"
}
Learn more in the Webhooks Guide.
Test Mode vs Live Modeβ
Use test mode to experiment without affecting production data:
- Test API Keys:
sk_test_... - Live API Keys:
sk_live_...
Test mode uses the same base URL but doesn't process real charges or send actual notifications.
API Endpointsβ
Authenticationβ
POST /auth/register- Create accountPOST /auth/login- Get access tokenPOST /auth/refresh- Refresh access tokenPOST /auth/verify-email- Verify email addressPOST /auth/password-reset- Request password resetPOST /auth/password-reset/confirm- Confirm password reset
User Managementβ
GET /users/me- Get current userPUT /users/me- Update current userDELETE /users/me- Delete account
API Keysβ
POST /api-keys/- Create API keyGET /api-keys/- List API keysDELETE /api-keys/{id}- Revoke API key
Analysis (Core)β
POST /analysis/- Submit analysisGET /analysis/{id}- Retrieve analysisGET /analysis/- List analysesPOST /analysis/{id}/webhook- Register webhook
Billingβ
GET /billing/subscription- Get subscriptionPOST /billing/subscription- Create subscriptionPOST /billing/subscription/update- Update planPOST /billing/subscription/cancel- Cancel subscriptionGET /billing/usage- Get usage summaryGET /billing/history- Get usage historyGET /billing/customer-portal- Stripe customer portal
SDKsβ
Official SDKs are coming soon for:
- Python
- Node.js
- Ruby
- PHP
Until then, the API works great with standard HTTP libraries like requests (Python) or axios (Node.js).
Supportβ
- Documentation: https://docs.callcov.com
- Email: support@callcov.com
- Status: status.callcov.com