Overview
The Faction API uses API key authentication to secure all endpoints. Every API request must include a valid API key in the request header.Authentication Method
API keys are passed via theFACTION-API-KEY HTTP header:
Authentication Flow
- Client sends request with
FACTION-API-KEYheader - Server validates the API key against the database
- Server retrieves the associated user account
- Server checks user permissions for the requested operation
- Request is processed or denied based on permissions
Getting an API Key
There are two ways to obtain an API key:1. User Profile (Self-Service)
2. Admin Creation
Administrators can create API keys for other users:API Key Properties
Each API key in the system has the following properties:| Property | Type | Description |
|---|---|---|
key | String | The actual API key value (UUID format) |
user | User | Associated user account |
created | Date | When the key was created |
lastUsed | Date | Last successful authentication timestamp |
API keys automatically track usage. The
lastUsed field is updated on each successful authentication.Permissions and Scopes
API keys inherit the permissions of their associated user account. Faction uses role-based access control:User Roles
Assessor
Assessor
Permissions:
- View assigned assessments
- Create and modify vulnerabilities
- Access vulnerability templates
- Update assessment notes and findings
GET /api/assessments/queue- View assigned assessmentsPOST /api/assessments/addVuln/{aid}- Add vulnerabilitiesGET /api/assessments/vuln/{vid}- View vulnerability detailsGET /api/vulnerabilities/default- Access vulnerability templates
Manager
Manager
Permissions:
- All Assessor permissions
- View all assessments (not just assigned)
- Manage users and API keys
- Create and modify vulnerability templates
- Access administrative functions
- All assessment endpoints (unrestricted)
POST /api/vulnerabilities/default- Create vulnerability templatesPOST /api/vulnerabilities/category- Manage categories- User management endpoints
Engagement
Engagement
Permissions:
- Create new assessments
- View engagement contact assessments
- Update assessment metadata
- Access assessment reports
POST /api/assessments/create- Create assessmentsGET /api/assessments/{aid}- View accessible assessmentsPOST /api/assessments/{aid}- Update assessment fields
Remediation
Remediation
Permissions:
- View assigned vulnerabilities
- Update vulnerability status
- Set tracking IDs
- Mark vulnerabilities as fixed
GET /api/vulnerabilities/getvuln/{id}- View vulnerability detailsPOST /api/vulnerabilities/settracking- Assign tracking numbersPOST /api/vulnerabilities/setstatus- Update remediation statusGET /api/vulnerabilities/gettracking/{track}- Search by tracking ID
Making Authenticated Requests
cURL Example
Python Example
JavaScript Example
PowerShell Example
Authentication Errors
If authentication fails, you’ll receive a401 Unauthorized response:
Common Causes
Missing API Key Header
Missing API Key Header
Problem: The
FACTION-API-KEY header is not included in the request.Solution: Ensure every request includes the header:Invalid API Key
Invalid API Key
Problem: The API key does not exist in the database or has been deleted.Solution:
- Verify the API key is correct (check for typos)
- Generate a new API key if the old one was deleted
- Contact your administrator if you don’t have access
Insufficient Permissions
Insufficient Permissions
Problem: The user account lacks the required role for the operation.Solution:
- Check the endpoint documentation for required permissions
- Contact your administrator to request elevated permissions
- Use an API key from an account with appropriate access
Security Best Practices
Use Environment Variables
Rotate Keys Regularly
Periodically generate new API keys and revoke old ones, especially after team member departures.
Use HTTPS Only
Always use HTTPS to prevent API keys from being intercepted in transit.
Limit Key Scope
Create separate API keys for different integrations with minimum required permissions.
Monitor Usage
Track API key usage through the
lastUsed field to detect unauthorized access.Secure Storage
Store API keys in secrets management systems (AWS Secrets Manager, HashiCorp Vault, etc.).
API Key Lifecycle
Testing Authentication
Test your API key with a simple status check:Next Steps
Assessments API
Learn how to manage assessments programmatically
Vulnerabilities API
Create and track security findings
API Introduction
Return to API overview and best practices
User Management
Manage users and permissions
