Base URL, versioning, authentication, pagination, rate limits, and error format for the 9thSense API
API Reference
The 9thSense API is a REST API. All requests and responses use JSON unless otherwise noted (file upload endpoints use multipart/form-data; export endpoints return text/csv; report and file endpoints return their native content type).
Base URL
https://api.9thsense.ai
All endpoints are versioned under /v1/.
Versioning
The current API version is v1. All stable endpoints are prefixed /v1/. Breaking changes will be introduced under a new version prefix.
Authentication
Every request (except /healthz, /docs, /openapi.json, /redoc, /metrics) must include a valid API key in the X-Api-Key header:
X-Api-Key: zk_<prefix>_<secret>
See Authentication for full details on key format, scopes, and key management.
Content Types
| Scenario | Request content-type | Response content-type |
|---|---|---|
| Standard JSON | application/json | application/json |
| File upload (add document to case) | multipart/form-data | application/json |
| CSV export | — | text/csv |
| Report (PDF) | — | application/pdf |
| Document / execution file download | — | native MIME type |
Pagination
List endpoints accept limit and offset query parameters where applicable.
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
limit | 50 | 1 | 200 | Number of records to return |
offset | 0 | 0 | — | Number of records to skip |
Endpoints that do not support offset accept only limit.
Rate Limits
Requests are rate-limited at 200 requests per minute per tenant. When the limit is exceeded the gateway returns:
HTTP 429 Too Many Requests
The limit resets on a rolling 60-second window.
Idempotency
Write endpoints (POST, PATCH) support idempotent retries via the Idempotency-Key header. Supply any unique string (UUID recommended). If the same key is replayed within 24 hours the original response is returned without re-executing the operation.
Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000
Error Format
All errors follow a consistent JSON envelope:
{
"detail": "Human-readable description of the error"
}
| HTTP Status | Meaning |
|---|---|
400 | Bad request — invalid parameters or business rule violation |
401 | Missing or invalid X-Api-Key header |
403 | Insufficient scope for the requested operation |
404 | Resource not found |
409 | Conflict — duplicate resource or wrong state for the operation |
413 | Payload too large — file uploads are capped at 20 MB |
415 | Unsupported media type — accepted types are image/jpeg, image/png, image/webp, image/tiff, image/bmp, image/gif, application/pdf |
422 | Unprocessable entity — validation failed |
429 | Rate limit exceeded |
500 | Internal server error |
503 | Service unavailable — async execution backend not connected |
Open Paths (No Auth Required)
The following paths bypass authentication entirely:
GET /healthzGET /docsGET /openapi.jsonGET /redocGET /metrics