Create an affiliate
A named affiliate: visits whose landing URL carries its slug in one of the site's affiliate parameters (settings.affiliates.params) are its own; commissionPercent (0 to 100, two decimals at most; 0 by default) sets its share of their revenue. 400 for a slug with nothing left once normalized, 409 for a slug the site already has.
Requires affiliates:write on the site (an API key, or a signed-in member's role). Share links: 401.
x-api-key<token>An organization API key (ak_…), with the permissions and the sites it was created with. For servers and scripts: no cookie and no Origin check. Also accepted as Authorization: Bearer ak_… (apiKeyBearer). A request carries one credential: a key sent with a share token or a live session cookie is 400 (details.reason: ambiguous_credentials).
Scope: affiliates:write
siteId*stringapplication/json- body
name*string1 <= length <= 80slug*stringNormalized as ingest normalizes the link's value: lowercased, only a-z 0-9 _ - kept, cut to 64
length <= 256commissionPercent?number0 <= value <= 100Created
application/json- response
data*curl -X POST 'https://pilotfox.app/api/v1/sites/string/affiliates' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "slug": "string"}'{ "data": { "id": "string", "name": "string", "slug": "string", "commissionPercent": 0, "shareEnabled": true, "createdAt": "string", "updatedAt": "string" }}