API Integration
API Integration
Section titled “API Integration”NEURO provides a comprehensive REST API for building custom integrations, automating workflows, and connecting with third-party tools.
Overview
Section titled “Overview”The API enables:
- Programmatic data access
- Automated finding creation
- Custom tool integration
- CI/CD pipeline integration
- Reporting automation
API Access
Section titled “API Access”Base URL
Section titled “Base URL”https://{tenant}.nforged.com/api/v1Or for your tenant:
https://{tenant}.nforged.com/apiAuthentication
Section titled “Authentication”All API requests require authentication via Bearer token:
curl -X GET "https://{tenant}.nforged.com/api/v1/projects" \ -H "Authorization: Bearer YOUR_API_TOKEN"Getting an API Token
Section titled “Getting an API Token”- Log into NEURO
- Go to Settings → API Access
- Click Generate API Token
- Copy and securely store the token
Quick Start
Section titled “Quick Start”List Projects
Section titled “List Projects”curl -X GET "https://{tenant}.nforged.com/api/v1/projects" \ -H "Authorization: Bearer YOUR_TOKEN"Response:
{ "success": true, "data": [ { "id": "proj_123", "name": "Q1 Pentest", "client_id": "client_456", "status": "in_progress" } ]}Create a Finding
Section titled “Create a Finding”curl -X POST "https://{tenant}.nforged.com/api/v1/findings" \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "project_id": "proj_123", "title": "SQL Injection in Login", "severity": "High", "description": "SQL injection vulnerability found...", "remediation": "Use parameterized queries..." }'Core Endpoints
Section titled “Core Endpoints”Projects
Section titled “Projects”| Method | Endpoint | Description |
|---|---|---|
| GET | /projects | List all projects |
| GET | /projects/{id} | Get project details |
| POST | /projects | Create project |
| PUT | /projects/{id} | Update project |
| DELETE | /projects/{id} | Delete project |
Findings
Section titled “Findings”| Method | Endpoint | Description |
|---|---|---|
| GET | /findings | List all findings |
| GET | /projects/{id}/findings | List project findings |
| GET | /findings/{id} | Get finding details |
| POST | /findings | Create finding |
| PUT | /findings/{id} | Update finding |
| DELETE | /findings/{id} | Delete finding |
Assets
Section titled “Assets”| Method | Endpoint | Description |
|---|---|---|
| GET | /projects/{id}/assets | List project assets |
| GET | /assets/{id} | Get asset details |
| POST | /assets | Create asset |
| PUT | /assets/{id} | Update asset |
| DELETE | /assets/{id} | Delete asset |
Clients
Section titled “Clients”| Method | Endpoint | Description |
|---|---|---|
| GET | /clients | List all clients |
| GET | /clients/{id} | Get client details |
| POST | /clients | Create client |
| PUT | /clients/{id} | Update client |
Request Format
Section titled “Request Format”Headers
Section titled “Headers”Required headers:
Authorization: Bearer YOUR_TOKENContent-Type: application/jsonRequest Body
Section titled “Request Body”JSON format for POST/PUT:
{ "field_name": "value", "nested": { "field": "value" }}Response Format
Section titled “Response Format”Success Response
Section titled “Success Response”{ "success": true, "data": { ... }, "meta": { "page": 1, "total": 100 }}Error Response
Section titled “Error Response”{ "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Invalid field value", "details": [...] }}Pagination
Section titled “Pagination”List endpoints support pagination:
GET /findings?page=1&limit=50Parameters:
page: Page number (default: 1)limit: Items per page (default: 50, max: 100)
Response includes:
{ "meta": { "page": 1, "limit": 50, "total": 234, "pages": 5 }}Filtering
Section titled “Filtering”Query Parameters
Section titled “Query Parameters”Filter results using query params:
GET /findings?severity=High&status=OpenCommon filters:
severity: Critical, High, Medium, Low, Infostatus: Open, Confirmed, Remediated, etc.project_id: Filter by projectcreated_after: Date filtersearch: Text search
Rate Limiting
Section titled “Rate Limiting”API rate limits:
- 1,000 requests per minute
- 10,000 requests per hour
Rate limit headers:
X-RateLimit-Limit: 1000X-RateLimit-Remaining: 999X-RateLimit-Reset: 1640000000When exceeded:
{ "success": false, "error": { "code": "RATE_LIMIT_EXCEEDED", "message": "Too many requests" }}Integration Examples
Section titled “Integration Examples”Python Example
Section titled “Python Example”import requests
API_URL = "https://{tenant}.nforged.com/api/v1"TOKEN = "your_api_token"
headers = { "Authorization": f"Bearer {TOKEN}", "Content-Type": "application/json"}
# List projectsresponse = requests.get(f"{API_URL}/projects", headers=headers)projects = response.json()["data"]
# Create findingfinding = { "project_id": "proj_123", "title": "XSS in Search", "severity": "Medium", "description": "Reflected XSS found in search parameter"}response = requests.post(f"{API_URL}/findings", json=finding, headers=headers)JavaScript Example
Section titled “JavaScript Example”const API_URL = 'https://{tenant}.nforged.com/api/v1';const TOKEN = 'your_api_token';
const headers = { 'Authorization': `Bearer ${TOKEN}`, 'Content-Type': 'application/json'};
// List projectsconst response = await fetch(`${API_URL}/projects`, { headers });const { data: projects } = await response.json();
// Create findingconst finding = { project_id: 'proj_123', title: 'IDOR Vulnerability', severity: 'High'};await fetch(`${API_URL}/findings`, { method: 'POST', headers, body: JSON.stringify(finding)});CI/CD Integration
Section titled “CI/CD Integration”# GitHub Actions example- name: Create Finding in NEURO run: | curl -X POST "${{ secrets.NFORGED_API }}/findings" \ -H "Authorization: Bearer ${{ secrets.NFORGED_TOKEN }}" \ -H "Content-Type: application/json" \ -d '{"project_id": "proj_123", "title": "${{ env.FINDING_TITLE }}"}'Webhooks
Section titled “Webhooks”Configuring Webhooks
Section titled “Configuring Webhooks”- Go to Settings → Webhooks
- Click Add Webhook
- Enter endpoint URL
- Select events to receive
- Save webhook
Webhook Events
Section titled “Webhook Events”| Event | Triggered When |
|---|---|
finding.created | New finding added |
finding.updated | Finding modified |
finding.deleted | Finding removed |
project.created | New project |
report.generated | Report created |
Webhook Payload
Section titled “Webhook Payload”{ "event": "finding.created", "timestamp": "2024-01-15T10:30:00Z", "data": { "id": "find_789", "title": "SQL Injection", "project_id": "proj_123" }}Error Handling
Section titled “Error Handling”HTTP Status Codes
Section titled “HTTP Status Codes”| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 429 | Rate Limited |
| 500 | Server Error |
Error Codes
Section titled “Error Codes”| Code | Description |
|---|---|
INVALID_TOKEN | Authentication failed |
VALIDATION_ERROR | Invalid input |
NOT_FOUND | Resource doesn’t exist |
PERMISSION_DENIED | Access not allowed |
Next: Explore Collaboration Features