Skip to main content
Manage affiliates within your campaigns.

Endpoints

MethodEndpointDescription
GET/v1/campaigns/:campaign_id/affiliatesList affiliates
POST/v1/campaigns/:campaign_id/affiliatesInvite an affiliate (returns invite link)
DELETE/v1/campaigns/:campaign_id/affiliates/:affiliate_idRemove an affiliate

List Affiliates

Get all affiliates for a specific campaign.
GET /v1/campaigns/:campaign_id/affiliates

Query Parameters

ParamTypeDefaultDescription
statusstring-Filter: active, pending, rejected
limitnumber50Results per page
offsetnumber0Pagination offset

Response

{
  "affiliates": [
    {
      "id": "aff_user123",
      "email": "john@example.com",
      "name": "John Doe",
      "status": "active",
      "unique_link": "https://c.baclique.com/summer-x7k2",
      "affiliate_code": "summer-x7k2",
      "joined_at": "2024-01-18T14:20:00Z",
      "stats": {
        "clicks": 1520,
        "conversions": 45,
        "revenue": 4500.00,
        "pending_commission": 450.00
      }
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "total": 12
  }
}

Invite Affiliate

Send an invitation to join your campaign. The affiliate must click the link to accept.
POST /v1/campaigns/:campaign_id/affiliates
Content-Type: application/json

Request Body

FieldTypeRequiredDescription
emailstringAffiliate’s email address

Example

curl -X POST https://api.baclique.com/v1/campaigns/cmp_abc123/affiliates \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "affiliate@example.com"}'

Response

{
  "status": "pending_invite",
  "email": "affiliate@example.com",
  "invite_link": "https://baclique.com/c/summer-sale?invite=abc123def456",
  "expires_at": "2025-01-08T14:00:00Z"
}

Behavior

⚠️ Important: For privacy and consent reasons, affiliates are NOT added directly.
  1. An invitation link is generated (valid for 7 days)
  2. You send this link to the affiliate (via email, Slack, etc.)
  3. The affiliate clicks the link and creates/logs into their BaClique account
  4. They are then added to your campaign
This ensures the affiliate has given explicit consent to join your program.

Remove Affiliate

Remove an affiliate from a campaign.
DELETE /v1/campaigns/:campaign_id/affiliates/:affiliate_id

Example

curl -X DELETE https://api.baclique.com/v1/campaigns/cmp_abc123/affiliates/aff_xyz789 \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"

Response

{
  "success": true,
  "message": "Affiliate removed from campaign"
}
⚠️ Note: This removes the affiliate from the campaign but does not delete their historical data (clicks, conversions, commissions).

Affiliate Statuses

StatusDescription
activeAffiliate can generate links and earn commissions
pendingWaiting for approval (private campaigns only)
rejectedApplication rejected by creator

Code Examples

JavaScript - List All Affiliates

async function listAffiliates(campaignId) {
  const response = await fetch(
    `https://api.baclique.com/v1/campaigns/${campaignId}/affiliates`,
    {
      headers: {
        'Authorization': `Bearer ${process.env.BACLIQUE_API_KEY}`
      }
    }
  );
  
  return response.json();
}

Python - Invite Affiliate

import requests
import os

def invite_affiliate(campaign_id, email):
    response = requests.post(
        f"https://api.baclique.com/v1/campaigns/{campaign_id}/affiliates",
        headers={
            "Authorization": f"Bearer {os.environ['BACLIQUE_API_KEY']}",
            "Content-Type": "application/json"
        },
        json={"email": email}
    )
    data = response.json()
    
    # Returns { status, email, invite_link, expires_at }
    print(f"Send this link to {email}: {data['invite_link']}")
    return data