API Endpoints
Complete reference for CortexEDR API endpoints, including request/response formats, authentication, and integration examples.
Base URL: https://api.cortex-edr.com/v1All endpoints require authentication
Authentication
Bearer Token Authentication
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYRate Limits
• 100 requests/minute
• 1000 requests/hour
• 10000 requests/day
Content Type
• Request: application/json
• Response: application/json
Core Endpoints
Scans
/scansPOST
/scansCreate new scanRequest Body
{
"repo_url": "https://github.com/user/repo",
"branch": "main",
"config": {
"depth": "standard",
"include_patterns": ["*.js", "*.ts"],
"exclude_patterns": ["node_modules/**"]
}
}GET
/scans/{scan_id}Get scan status and resultsResponse
{
"id": "scan_123",
"status": "completed",
"score": 85,
"issues_count": 23,
"created_at": "2024-01-01T00:00:00Z",
"results": { ... }
}GET
/scansList user scansChat
/chatPOST
/chatSend messageRequest Body
{
"message": "How secure is my authentication?",
"scan_id": "scan_123",
"thread_id": "thread_456"
}GET
/chat/threadsGet chat threadsWebhooks
/webhooksPOST
/webhooksCreate webhookRequest Body
{
"url": "https://your-app.com/webhook",
"events": ["scan.completed", "scan.failed"],
"secret": "your-webhook-secret"
}Error Handling
HTTP Status Codes
200 OKSuccess
201 CreatedResource created
400 Bad RequestInvalid request
401 UnauthorizedInvalid API key
429 Too Many RequestsRate limit exceeded
500 Internal ErrorServer error
Error Response Format
{
"error": {
"code": "INVALID_REQUEST",
"message": "The request body is malformed",
"details": { ... }
}
}SDK Examples
JavaScript/Node.js
const cortex = new CortexEDR({
apiKey: 'your-api-key'
});
// Create a scan
const scan = await cortex.scans.create({
repo_url: 'https://github.com/user/repo'
});
console.log('Scan created:', scan.id);Python
import cortex_edr
client = cortex_edr.Client(api_key='your-api-key')
# Create a scan
scan = client.scans.create(
repo_url='https://github.com/user/repo'
)
print(f"Scan created: {scan.id}")