Check a referral code is free
check_affiliate_code
Checks whether a referral code is free before you claim it.
Codes are unique across Modulify, so a code somebody else holds is reported as taken. Always check before setting one with update_affiliate, because a code cannot be changed once a referral has used it.
A free code answers ok with Affiliate code is available., and a taken one not-ok with Affiliate code is not available. A code must be 3 to 12 letters and digits, and anything else is refused with Code is not valid, please check again! It acts only for the account the token belongs to and needs no workspace. See Affiliates.
Request
Call it with a POST to https://api.modulify.ai/v1/check_affiliate_code, sending the inputs below as a JSON object. The token needs the account:read scope.
It only reads and changes nothing, so retrying it is safe.
curl -X POST https://api.modulify.ai/v1/check_affiliate_code \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"code":"CODE"}'Over MCP, the same method is the check_affiliate_code tool.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
code |
string | Yes | The code to test, 3 to 12 letters and digits. It is compared in lowercase. |
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.