API Reference
Complete reference for the CTWiseAPI endpoints.
Base URL​
https://api.ctwise.ai/v1
Authentication​
All requests require an API key in the x-api-key header:
x-api-key: YOUR_API_KEY
See Authentication for details.
Content Type​
All requests and responses use JSON:
Content-Type: application/json
Endpoints​
Search​
| Method | Endpoint | Description |
|---|---|---|
POST | /semantic-search | AI-powered semantic search across regulatory rules |
Rules​
| Method | Endpoint | Description |
|---|---|---|
GET | /rules | List regulatory rules with filtering |
POST | /rules | Search rules with advanced query options |
Catalog​
| Method | Endpoint | Description |
|---|---|---|
GET | /catalog/sources | List available data sources with summary stats |
Health​
| Method | Endpoint | Description |
|---|---|---|
GET | /health | API health check (no auth required) |
Request Format​
Query Parameters​
GET /rules?source=FDA&limit=10&offset=0
Request Body (POST)​
{
"query": "informed consent",
"sources": ["FDA", "ICH"],
"limit": 10,
"filters": {
"documentType": "Guidance"
}
}
Response Format​
Success Response​
{
"data": {
// Response data
},
"meta": {
"requestId": "req_abc123",
"processingTimeMs": 245
}
}
Error Response​
{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
},
"meta": {
"requestId": "req_abc123"
}
}
Pagination​
List endpoints support pagination:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 20 | Results per page (max 100) |
offset | integer | 0 | Results to skip |
GET /rules?limit=20&offset=40
Response includes pagination info:
{
"data": [...],
"pagination": {
"limit": 20,
"offset": 40,
"total": 247,
"hasMore": true
}
}
HTTP Status Codes​
| Status | Description |
|---|---|
200 | Success |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Insufficient tier access |
404 | Not Found - Resource doesn't exist |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |
503 | Service Unavailable |
Rate Limiting​
Rate limits are enforced per API key:
| Tier | Limit |
|---|---|
| Free | 2 requests/second |
| Starter | 10 requests/second |
Rate limit headers:
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 8
X-RateLimit-Reset: 1704067200
Versioning​
The API is versioned via URL path:
https://api.ctwise.ai/v1/search
Current version: v1
We maintain backward compatibility within major versions. Breaking changes require a new major version.
SDKs​
Official client libraries:
- Python SDK
- JavaScript/TypeScript SDK
- Java SDK (Coming Soon)
- C# SDK (Coming Soon)