API Reference
Overview
The Conduct backend exposes a REST API with 35 endpoints for managing specs, runs, checks, features, and authentication.
Base URL
http://localhost:3000/conduct/v1
Production:
https://api.example.com/conduct/v1
Authentication
All requests require an API key in the Authorization header:
Authorization: Bearer sk_admin_xxxxxxxxxxxxx
Example:
curl -H "Authorization: Bearer sk_admin_xxx" \
http://localhost:3000/conduct/v1/specs
API Endpoints
Specs
POST /specs- Create specGET /specs- List specsGET /specs/:id- Get specPATCH /specs/:id- Update specDELETE /specs/:id- Delete specGET /specs/:id/runs- Get spec runs
Runs
POST /runs- Create runGET /runs- List runsGET /runs/:id- Get runPATCH /runs/:id- Update runDELETE /runs/:id- Delete runPOST /runs/:id/features- Link features
Checks
POST /checks- Create checkGET /checks- List checksGET /checks/:id- Get checkPATCH /checks/:id- Update checkDELETE /checks/:id- Delete check
Features
GET /features- List featuresGET /features/:id- Get featureGET /features/:id/runs- Get feature runs
Auth
POST /auth/keys- Create API keyGET /auth/keys- List API keysDELETE /auth/keys/:id- Revoke API key
Request Format
All requests use JSON:
Content-Type: application/json
Response Format
All responses return JSON:
{
"data": {},
"meta": {}
}
Errors:
{
"error": "Error message",
"code": "ERROR_CODE"
}
Pagination
List endpoints support cursor-based pagination:
GET /specs?limit=20&cursor=abc123
Response includes pagination info:
{
"data": [...],
"meta": {
"hasMore": true,
"nextCursor": "xyz789"
}
}
Filtering
Filter by status, dates, etc:
GET /specs?status=draft
GET /runs?specId=SPEC-001
GET /checks?result=pass
Rate Limiting
Default limits:
- 100 requests per minute
- 429 status code when exceeded
Headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1638360000
Error Codes
400- Bad Request401- Unauthorized403- Forbidden404- Not Found409- Conflict422- Validation Error429- Rate Limit Exceeded500- Internal Server Error