Getting Started with the API
The Affiliate OS API allows you to programmatically access and manage campaigns, commissions, keywords, and analytics data. API access is included with the Agency plan.
Base URL: https://api.affiliates-os.com/v1
Authentication: All API requests require an API key passed in the Authorization header.
API Endpoints
Retrieve all campaigns for your account.
Create a new campaign.
Retrieve a specific campaign by ID.
Update a campaign.
Delete a campaign.
Retrieve all commission records.
Log a new commission.
Retrieve keyword research data.
Retrieve analytics data for campaigns.
Example: Creating a Campaign
Here's how to create a new campaign using the API:
Rate Limiting
API requests are rate limited to 1,000 requests per hour per API key. If you exceed this limit, you'll receive a 429 (Too Many Requests) response.
Error Handling
The API returns standard HTTP status codes. Common error responses include:
- 400 Bad Request: Invalid request parameters
- 401 Unauthorized: Missing or invalid API key
- 403 Forbidden: Insufficient permissions
- 404 Not Found: Resource not found
- 500 Internal Server Error: Server error
Webhooks
Subscribe to webhooks to receive real-time notifications when campaigns are created, updated, or when commissions are logged. Configure webhooks in your account settings.
Available Events:
- campaign.created
- campaign.updated
- campaign.deleted
- commission.logged
- commission.paid
Support & Resources
Need help with the API? Check out our resources: