Create a referrer
POST
Enroll one of your customers in a program and generate their share link.
apiKeyheader
AuthorizationBearer <token>Use a secret key such as sk_test_... in test mode or sk_live_... in production.
Idempotency-Key?stringA unique key that makes retries safe. Keys expire after 24 hours.
Format
uuidapplication/json- body
program_id*stringThe program to enroll this customer in.
external_id*stringYour own user ID for this customer.
email*stringFormat
emailname?stringmetadata?Up to 20 string key-value pairs for your own use.
The referrer was created.
application/json- response
id*stringprogram_id*stringexternal_id*stringemail*stringFormat
emailname?string|nullreferral_code*stringshare_url*stringFormat
uristats?metadata?Up to 20 string key-value pairs for your own use.
created_at*stringFormat
date-timecurl -X POST 'https://api.referralapi.example/v1/referrers' \ -H 'Content-Type: application/json' \ -d '{ "program_id": "prog_8Hq2LmN4", "external_id": "user_1042", "email": "maya@example.com"}'Example Response
{ "id": "ref_3kT9wQx2", "program_id": "string", "external_id": "string", "email": "user@example.com", "name": "string", "referral_code": "MAYA-20", "share_url": "https://acme.example/?ref=MAYA-20", "stats": { "clicks": 0, "signups": 0, "conversions": 0 }, "metadata": { "property1": "string", "property2": "string" }, "created_at": "2019-08-24T14:15:22Z"}