For Developers

API Documentation

Build custom integrations with Affiliate OS. API access is available on the Agency plan.

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.

Authorization: Bearer YOUR_API_KEY

API Endpoints

GET /campaigns
Retrieve all campaigns for your account.
POST /campaigns
Create a new campaign.
GET /campaigns/{id}
Retrieve a specific campaign by ID.
PUT /campaigns/{id}
Update a campaign.
DELETE /campaigns/{id}
Delete a campaign.
GET /commissions
Retrieve all commission records.
POST /commissions
Log a new commission.
GET /keywords
Retrieve keyword research data.
GET /analytics
Retrieve analytics data for campaigns.

Example: Creating a Campaign

Here's how to create a new campaign using the API:

curl -X POST https://api.affiliates-os.com/v1/campaigns \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "VPN Affiliate Campaign", "niche": "VPN Services", "status": "draft", "target_traffic": 1000, "commission_rate": 0.25 }'

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:

Ready to Build?

API access is available on the Agency plan. Upgrade today to start building custom integrations.

View Pricing Get API Key