Set your referral code and payout email
update_affiliate
Sets the referral code people use to sign up under you, and the email your payouts go to.
The code is one way once somebody has referred through it: after that it cannot be undone or changed, and a change is refused with Affiliate code cannot be changed after being used by your referrals! The tool tells the client to check the code with check_affiliate_code and confirm the exact spelling with you before setting it.
Both the code and the payout email are required together and both are rewritten on every call. Read the current values with get_account first, where they sit under Affiliate as Code and PayPalEmail, and send back the one you are not changing.
A code is 3 to 12 letters and digits and is stored in lowercase, and one somebody else holds is refused with Affiliate code is already taken! It acts only on the account the token belongs to and needs no workspace. See Affiliates.
Request
Call it with a POST to https://api.modulify.ai/v1/update_affiliate, sending the inputs below as a JSON object. The token needs the account:write scope.
This method is marked destructive: it deletes or overwrites data. Check the inputs before you call it, and send an Idempotency-Key header whenever you might retry it.
curl -X POST https://api.modulify.ai/v1/update_affiliate \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"code":"CODE","email":"EMAIL"}'Over MCP, the same method is the update_affiliate tool.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
code |
string | Yes | The referral code to claim, 3 to 12 letters and digits. It cannot be changed once a referral has used it. |
email |
string | Yes | The PayPal address your payouts are sent to. |
Response
Every call answers with the JSON envelope of success, message, data, code and version. data holds the result described above, and on a method that returns a total, count carries it. The response headers carry the call's X-Request-Id and what is left of your per-minute budget in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Errors explains every status code a call can answer with.