Recomly APIEndpoints
Invite advocate
Enroll a new advocate in a campaign.
POST /api/app/campaigns/{campaignId}/invite
Enrolls a new advocate in a campaign. Generates a unique referral link and portal access for them, and sends an invite email and/or SMS depending on which contact channels are provided.
Request
See API Basics for required headers.
Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Advocate's full name. Max 100 characters. |
email | string | Conditional | Advocate's email address. Required if phone is not provided. |
phone | string | Conditional | Advocate's US phone number in E.164 format, e.g. +12125550100. Required if email is not provided. SMS delivery requires the SMS feature on your plan. |
At least one of email or phone is required. Both may be provided.
Sample request
curl -X POST https://api.recomly.com/api/app/campaigns/c7a3f1d2-84b0-4e9a-bcd2-1f3e5a7c9012/invite \
-H "Authorization: Bearer rk_live_abc123:def456" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Smith",
"email": "jane@example.com"
}'Sample response
Status: 201 Created
{
"advocate": {
"advocateId": "e9c5a3b1-72d4-4f8e-ace5-3g5h7i9j0123",
"campaignId": "c7a3f1d2-84b0-4e9a-bcd2-1f3e5a7c9012",
"orgId": "a1b2c3d4-0000-4000-8000-e5f6a7b8c9d0",
"name": "Jane Smith",
"email": "jane@example.com",
"notificationPreference": "email",
"referralCode": "a1b2c3d4",
"portalToken": "7f3a1d2e4b5c6f8a9e0d1b2c3f4a5e6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f",
"creditBalanceCents": 0,
"enrolledAt": "2026-04-04T15:00:00.000Z"
}
}Error responses
See API Basics for standard status codes and error response format.

