LinkJoltDevelopers

Manage API Keys

← Back to LinkJolt.io

← All guides

Invite affiliates programmatically

Send branded affiliate invitation emails from your own signup flow, CRM, or workflow tool.

Beginner

5 min read

Ultimate plan

When to use this

  • Automatically invite every new customer as an affiliate
  • Bulk-invite a list from your CRM
  • Trigger invites from a Zapier/Make/n8n workflow
  • Build a referral-at-signup flow in your own product

Send an invite

curl https://linkjolt.io/api/v1/affiliates/invite \
  -X POST \
  -H "Authorization: Bearer lj_pk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane@example.com",
    "name": "Jane Smith",
    "campaignId": "camp_abc"
  }'

Rate limit

This endpoint has a tighter rate limit than other endpoints: 10 invites per minute per key. This is to protect your domain's email deliverability. If you need to send more, space them out over time.

Handling duplicates

If a pending invitation already exists for the same email + campaign, you'll get 409 duplicate. You can either ignore it or fetch existing invites via your dashboard.

Bulk invite from CSV

import fs from 'fs';
import { parse } from 'csv-parse/sync';

const rows = parse(fs.readFileSync('affiliates.csv'), { columns: true });
const campaignId = 'camp_abc';

for (const row of rows) {
  const res = await invite(row.email, row.name, campaignId);
  if (res.duplicate) console.log('skip (exists):', row.email);
  else console.log('invited:', row.email);

  // Respect rate limit — 10/min = 1 per 6s
  await new Promise(r => setTimeout(r, 6500));
}

Full reference: POST /api/v1/affiliates/invite