ContractIQ REST API documentation.
http://localhost:8002/api/v1
Production: https://api.contractiq.com/api/v1
All endpoints (except /auth/register and /auth/login) require authentication.
Include token in Authorization header:
Authorization: Bearer <token>
- Access Token: 7 days
- Refresh: Use
/auth/refreshendpoint
{
"id": "uuid",
"name": "string",
"created_at": "2024-01-01T00:00:00Z",
...
}{
"error": true,
"error_code": "NOT_FOUND",
"message": "Resource not found",
"details": {},
"timestamp": "2024-01-01T00:00:00Z"
}| Code | Meaning | Usage |
|---|---|---|
200 |
OK | Successful GET, PUT, PATCH |
201 |
Created | Successful POST |
204 |
No Content | Successful DELETE |
400 |
Bad Request | Invalid request data |
401 |
Unauthorized | Missing/invalid token |
403 |
Forbidden | Insufficient permissions |
404 |
Not Found | Resource doesn't exist |
422 |
Unprocessable Entity | Validation error |
500 |
Internal Server Error | Server error |
| Code | Description |
|---|---|
VALIDATION_ERROR |
Request validation failed |
NOT_FOUND |
Resource not found |
UNAUTHORIZED |
Authentication required |
FORBIDDEN |
Insufficient permissions |
PROCESSING_ERROR |
Document processing failed |
EXTERNAL_SERVICE_ERROR |
External API error |
RATE_LIMIT_ERROR |
Rate limit exceeded |
INTERNAL_ERROR |
Internal server error |
Currently no rate limits. Future: 100 requests/minute per user.
List endpoints support pagination:
GET /documents/?page=1&page_size=20
Response:
{
"total": 100,
"page": 1,
"page_size": 20,
"items": [...]
}Many list endpoints support filtering:
GET /documents/{id}/clauses?clause_type=Termination&min_risk_score=50
| Category | Endpoints |
|---|---|
| Authentication | Register, login, refresh, current user |
| Workspaces | Create, list, get, delete workspaces |
| Documents | Upload, list, get, delete documents |
| Clauses | Extract, list, get, delete clauses |
| Conversations | Create, list, ask questions, delete |
| Exports | Evidence packs, clause exports |
Swagger UI available at:
- Development: http://localhost:8002/docs
- ReDoc: http://localhost:8002/redoc
- Authentication - Auth endpoints
- Workspaces - Workspace management
- Documents - Document operations
- Clauses - Clause extraction
- Conversations - Q&A endpoints
- Exports - Export services