Full API documentation, including detailed request/response schemas, is available on GitHub: ContraForce API Documentation
Why Use the Partner API?
ITSM Integration
Sync incidents with ServiceNow, Jira, Autotask, and more
Custom Dashboards
Build internal reporting within your custom dashboard
SOAR Automation
Trigger workflows in your existing SOAR platform
Common Use Cases
| Use Case | Description |
|---|---|
| Ticket Creation | Automatically create tickets in your PSA when incidents are detected |
| Bi-directional Sync | Keep incident status synchronized between ContraForce and your ITSM |
| Executive Reporting | Pull incident data into custom reports and dashboards |
| Alert Routing | Send incident notifications to custom channels (Slack, Teams, PagerDuty) |
| Data Warehouse | Export incident data to your data lake for long-term analysis |
Getting Started
Prerequisites
Before using the API, you’ll need:1
ContraForce Account
An active ContraForce account with API access enabled
2
API Credentials
Client ID and Client Secret from your ContraForce administrator
3
Workspace Access
Appropriate permissions to the workspaces you want to query
Obtaining API Credentials
1
Contact Your Administrator
Request API credentials from your ContraForce account administrator
2
Receive Credentials
You’ll receive a Client ID and Client Secret
3
Store Securely
Store credentials securely—never commit them to source control
Authentication
The ContraForce API uses OAuth 2.0 client credentials flow for authentication.Getting an Access Token
Response
Using the Token
Include the access token in theAuthorization header for all API requests:
API Endpoints
The Partner API provides access to incidents and their associated data.Base URL
Available Endpoints
| Endpoint | Method | Description |
|---|---|---|
/incidents | GET | List all incidents |
/incidents/{id} | GET | Get incident details |
/incidents/{id}/entities | GET | List entities for an incident |
/incidents/{id}/evidence | GET | List evidence for an incident |
API Components
- Incident Object
- List Incidents
- Get Incident Details
- List Entities
- List Evidence
The core data structure representing a security incident.Key Fields:
Full Schema →
| Field | Type | Description |
|---|---|---|
id | string | Unique incident identifier |
title | string | Incident title/name |
severity | string | High, Medium, Low, Informational |
status | string | New, Active, Closed |
workspaceId | string | Associated workspace |
createdAt | datetime | When incident was created |
updatedAt | datetime | Last modification time |
Example Requests
List High Severity Incidents
Get Incident Details
List Incident Entities
Example Response: List Incidents
Rate Limits
The API implements rate limiting to ensure fair usage and platform stability.| Limit Type | Value |
|---|---|
| Requests per minute | 60 |
| Requests per hour | 1,000 |
| Max results per request | 100 |
Rate Limit Headers
Each response includes rate limit information:Error Handling
The API uses standard HTTP status codes and returns detailed error messages.HTTP Status Codes
| Code | Meaning | Action |
|---|---|---|
200 | Success | Request completed successfully |
400 | Bad Request | Check request parameters |
401 | Unauthorized | Verify credentials/token |
403 | Forbidden | Check workspace permissions |
404 | Not Found | Verify resource ID exists |
429 | Rate Limited | Implement backoff and retry |
500 | Server Error | Retry after delay; contact support if persistent |
Error Response Format
Best Practices
Implement pagination
Implement pagination
Always use pagination for list endpoints. Don’t assume you’ll receive all results in one request. Use
limit and offset parameters to iterate through large result sets.Handle rate limits gracefully
Handle rate limits gracefully
Monitor
X-RateLimit-Remaining headers and implement exponential backoff when approaching limits. Don’t retry immediately on 429 responses.Cache when appropriate
Cache when appropriate
Cache incident details that don’t change frequently. Use
updatedAt timestamps to invalidate cache entries when data changes.Use webhooks for real-time updates
Use webhooks for real-time updates
Instead of polling the API frequently, consider using webhooks (if available) or longer polling intervals with status filters.
Secure your credentials
Secure your credentials
Store API credentials in environment variables or a secrets manager. Never hardcode credentials or commit them to source control.
Log API interactions
Log API interactions
Maintain logs of API requests and responses for debugging. Mask sensitive data like tokens in logs.
SDK & Libraries
While the API can be called directly with HTTP requests, you may find these helpful:| Language | Option |
|---|---|
| Python | Use requests library with OAuth2 session |
| JavaScript | Use axios or fetch with token management |
| PowerShell | Use Invoke-RestMethod cmdlet |
| C# | Use HttpClient with System.Net.Http |
Troubleshooting
Common Issues
| Issue | Possible Cause | Solution |
|---|---|---|
401 Unauthorized | Expired or invalid token | Refresh your access token |
403 Forbidden | Missing workspace access | Verify API credentials have access to the workspace |
Empty results | Filter too restrictive | Broaden filter criteria or check workspace ID |
Timeout errors | Large result set | Use pagination with smaller limit values |
API Documentation
GitHub: ContraForce API
Complete API documentation including schemas, examples, and changelog
Quick Links
- Incident Object Schema
- List Incidents
- Get Incident Details
- List Incident Entities
- List Incident Evidence
Related Guides
ServiceNow Integration
Built-in ServiceNow ticketing integration
Jira Integration
Connect Jira Service Desk
API Enterprise Application
API permissions and authentication setup
Capabilities Matrix
Full integration capabilities
Questions about the Partner API? Contact us at [email protected].