POST
/api/v1/affiliates/bulkRegister multiple affiliates at once. Each affiliate is processed independently - failures for individual entries don't affect others. Maximum 100 affiliates per request.
Request body
| Parameter | Type | Description |
|---|---|---|
affiliatesrequired | array | Array of affiliate objects (1-100 items). |
affiliates[].emailrequired | string | Email address of the affiliate. |
affiliates[].name | string | Full name (1-200 characters). |
affiliates[].referralCode | string | Custom referral code (3-50 chars, alphanumeric with hyphens/underscores). |
notify | boolean | Send welcome emails to all affiliates. Defaults to true. |
Example request
bash
curl -X POST https://anderro.com/api/v1/affiliates/bulk \
-H "Content-Type: application/json" \
-H "x-api-key: sk_your_secret_key" \
-d '{
"affiliates": [
{ "email": "[email protected]", "name": "Alice" },
{ "email": "[email protected]", "name": "Bob", "referralCode": "bob-ref" },
{ "email": "[email protected]" }
],
"notify": true
}'
Responses
200Bulk operation completed
json
{
"results": [
{
"email": "[email protected]",
"success": true,
"action": "created",
"partnershipId": "cuid_aaa"
},
{
"email": "[email protected]",
"success": true,
"action": "joined",
"partnershipId": "cuid_bbb"
},
{
"email": "[email protected]",
"success": false,
"error": "Already in program"
}
],
"summary": {
"total": 3,
"created": 1,
"joined": 1,
"failed": 1
}
}
Result actions
| Action | Meaning |
|---|---|
created | New user account created and added to your program |
joined | Existing Anderro user added to your program |
reactivated | Previously removed affiliate re-added to your program |
Partial success
The bulk endpoint always returns 200 even if some entries fail. Check the results array and summary to see which entries succeeded or failed.