API reference
Affiliate program
The affiliate program pays the owner a share of every payment of the people who sign up with their link, as on the app's Affiliate page. Read the program and its statistics, change the link's code and send the balance to the owner's bank.
Money moves on a cash out only, the whole balance to the owner's own bank account on Stripe, so ask the owner first. Adding the bank account the first time happens in the app, since its country is final.
Only the owner of the X account sees the affiliate program, a team member's key gets forbidden.
The affiliate program object
The owner's affiliate program, as the app's Affiliate page shows it. Amounts are in US dollars. The owner earns a share of every payment of the people who sign up with their link.
Attributes
- objectstringAlways
affiliate_program. - codestring or nullThe link's code, the part after
?via=. - linkstring or nullThe affiliate link to share.
- rate_percentintegerThe share earned on every referral's payments. It grows with the number of active referrals, from 5 to 50 percent.
- active_referralsintegerReferrals paying now.
- next_rate_percentinteger or nullThe next rate,
nullat the top. - max_rate_percentintegerThe highest rate.
- rates_percentarray of integersEvery rate, from the first to the highest.
- currencystringAlways
usd. - earningsnumberEverything earned so far.
- balancenumberWhat is earned and not paid out yet.
- payout_accountobjectThe bank account payouts go to, on Stripe.
- can_cash_outboolean
truewith a payout account and a balance above zero. - referralsarray of objectsThe people who signed up with the link, each with
name,email,plan, the subscriptionstatus, what theyearnedthe owner and theirrate_percent. - payoutsarray of objectsThe payouts to the bank, newest first, each with
id,amount,currency,statusandcreated_at. - tweet_reviewobjectThe review post for 20 percent off the next payment, up to 3 times in the first three months.
- manage_urlstringThe app's Affiliate page.
{
"object": "affiliate_program",
"code": "acme",
"link": "https://gemlead.ai?via=acme",
"rate_percent": 15,
"active_referrals": 6,
"next_rate_percent": 20,
"max_rate_percent": 50,
"rates_percent": [5, 10, 15, 20, 25, 30, 40, 50],
"currency": "usd",
"earnings": 1284.6,
"balance": 342.15,
"payout_account": {
"connected": true,
"payouts_enabled": true
},
"can_cash_out": true,
"referrals": [
{
"name": "Nina Park",
"email": "nina@parkpicks.com",
"plan": "business",
"status": "active",
"earned": 309.15,
"rate_percent": 15
},
{
"name": "Leo Grant",
"email": "leo@grantsignals.io",
"plan": "starter",
"status": "trialing",
"earned": 0,
"rate_percent": 15
}
],
"payouts": [
{
"id": "py8Kq2LmXv",
"object": "affiliate_payout",
"amount": 942.45,
"currency": "usd",
"status": "paid",
"created_at": "2026-10-31T12:00:00.000Z"
}
],
"tweet_review": {
"discount_percent": 20,
"status": "approved",
"post_url": "https://x.com/acme/status/1985402219876543210",
"used": 1,
"remaining": 2,
"max": 3,
"discount_pending": false,
"can_submit": true,
"window_open": true,
"window_ends_at": "2026-12-14T09:21:05.000Z",
"submitted_at": "2026-10-02T11:04:37.000Z",
"reviewed_at": "2026-10-02T11:06:12.000Z",
"last_checked_at": "2026-11-06T06:00:00.000Z",
"reply_found": true,
"draft": null,
"draft_validated": false
},
"manage_url": "https://gemlead.ai/app/affiliate"
}Retrieve the affiliate program
Returns the link, the rate, the referrals, the balance, the payouts and the review post's discount.
Returns
Errors
- 403forbiddenThe key belongs to a team member. Only the owner of the X account can do this.
curl https://gemlead.ai/api/v1/affiliate \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "affiliate_program",
"code": "acme",
"link": "https://gemlead.ai?via=acme",
"rate_percent": 15,
"active_referrals": 6,
"next_rate_percent": 20,
"max_rate_percent": 50,
"rates_percent": [5, 10, 15, 20, 25, 30, 40, 50],
"currency": "usd",
"earnings": 1284.6,
"balance": 342.15,
"payout_account": {
"connected": true,
"payouts_enabled": true
},
"can_cash_out": true,
"referrals": [
{
"name": "Nina Park",
"email": "nina@parkpicks.com",
"plan": "business",
"status": "active",
"earned": 309.15,
"rate_percent": 15
},
{
"name": "Leo Grant",
"email": "leo@grantsignals.io",
"plan": "starter",
"status": "trialing",
"earned": 0,
"rate_percent": 15
}
],
"payouts": [
{
"id": "py8Kq2LmXv",
"object": "affiliate_payout",
"amount": 942.45,
"currency": "usd",
"status": "paid",
"created_at": "2026-10-31T12:00:00.000Z"
}
],
"tweet_review": {
"discount_percent": 20,
"status": "approved",
"post_url": "https://x.com/acme/status/1985402219876543210",
"used": 1,
"remaining": 2,
"max": 3,
"discount_pending": false,
"can_submit": true,
"window_open": true,
"window_ends_at": "2026-12-14T09:21:05.000Z",
"submitted_at": "2026-10-02T11:04:37.000Z",
"reviewed_at": "2026-10-02T11:06:12.000Z",
"last_checked_at": "2026-11-06T06:00:00.000Z",
"reply_found": true,
"draft": null,
"draft_validated": false
},
"manage_url": "https://gemlead.ai/app/affiliate"
}Check an affiliate code
Says whether a code is free for the affiliate link, as the link field checks it.
Query parameters
- codestringRequiredThe code to check, the part after
?via=. 2 to 32 lowercase letters, digits,-or_.
Returns
An object with object at affiliate_code, the code, the link it would make and whether it is available.
Errors
- A required parameter is missing.
paramnames it. - A parameter has a value the API does not accept.
paramnames it. - 403forbiddenThe key belongs to a team member. Only the owner of the X account can do this.
curl -G \
https://gemlead.ai/api/v1/affiliate/code_availability \
-H "Authorization: Bearer $GEMLEAD_API_KEY" \
-d code=acme-picks{
"object": "affiliate_code",
"code": "acme-picks",
"link": "https://gemlead.ai?via=acme-picks",
"available": true
}Change the affiliate code
Changes the affiliate link's code. The old link stops bringing referrals, so ask the owner first.
Body parameters
- codestringRequiredThe new code, 2 to 32 lowercase letters, digits,
-or_.
Returns
The affiliate program object with its new link, and a message.
Errors
- A required parameter is missing.
paramnames it. - A parameter has a value the API does not accept.
paramnames it. - 409code_takenThe code is taken or reserved. The link stays the same.
- 403forbiddenThe key belongs to a team member. Only the owner of the X account can do this.
curl -X PATCH https://gemlead.ai/api/v1/affiliate/code \
-H "Authorization: Bearer $GEMLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "acme-picks"
}'{
"object": "affiliate_program",
"code": "acme-picks",
"link": "https://gemlead.ai?via=acme-picks",
"rate_percent": 15,
"active_referrals": 6,
"next_rate_percent": 20,
"max_rate_percent": 50,
"rates_percent": [5, 10, 15, 20, 25, 30, 40, 50],
"currency": "usd",
"earnings": 1284.6,
"balance": 342.15,
"payout_account": {
"connected": true,
"payouts_enabled": true
},
"can_cash_out": true,
"referrals": [
{
"name": "Nina Park",
"email": "nina@parkpicks.com",
"plan": "business",
"status": "active",
"earned": 309.15,
"rate_percent": 15
},
{
"name": "Leo Grant",
"email": "leo@grantsignals.io",
"plan": "starter",
"status": "trialing",
"earned": 0,
"rate_percent": 15
}
],
"payouts": [
{
"id": "py8Kq2LmXv",
"object": "affiliate_payout",
"amount": 942.45,
"currency": "usd",
"status": "paid",
"created_at": "2026-10-31T12:00:00.000Z"
}
],
"tweet_review": {
"discount_percent": 20,
"status": "approved",
"post_url": "https://x.com/acme/status/1985402219876543210",
"used": 1,
"remaining": 2,
"max": 3,
"discount_pending": false,
"can_submit": true,
"window_open": true,
"window_ends_at": "2026-12-14T09:21:05.000Z",
"submitted_at": "2026-10-02T11:04:37.000Z",
"reviewed_at": "2026-10-02T11:06:12.000Z",
"last_checked_at": "2026-11-06T06:00:00.000Z",
"reply_found": true,
"draft": null,
"draft_validated": false
},
"manage_url": "https://gemlead.ai/app/affiliate",
"message": "The link is now https://gemlead.ai?via=acme-picks. The old one stops bringing referrals."
}Edit the payout account
Returns Stripe's page to finish or edit the bank account payouts go to. The first time, the owner adds the account in the app, under Affiliate and Payout, where its country is picked for good. An Idempotency-Key is ignored here, so a retry gets a fresh link.
Returns
An object with object at affiliate_payout_link, the Stripe url, its kind onboarding or update, and a message.
Errors
- No payout account yet. Add it in the app first.
- 403forbiddenThe key belongs to a team member. Only the owner of the X account can do this.
- Stripe did not answer. Nothing changed, try again in a minute.
curl -X POST \
https://gemlead.ai/api/v1/affiliate/payout_account \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "affiliate_payout_link",
"url": "https://connect.stripe.com/setup/e/acct_1Q2wErTy3uIoPa4S/Xy7zKq9LmN2v",
"kind": "update",
"message": "Open this Stripe page to edit the bank account payouts go to."
}Cash out the balance
Sends the whole affiliate balance to the owner's own bank account on Stripe, as the Affiliate page's Payout. Money moves, so ask the owner first and tell them the amount. Send an Idempotency-Key so a retry never pays twice.
Returns
An object with object at affiliate_cashout, the amount sent, its currency, its destination and a message.
Errors
- The balance is zero.
- No bank account yet. Add it in the app.
- Stripe still needs details of the bank account. Edit the payout account gives the link.
- A payout is already on its way.
- The payout failed and nothing was sent. The balance stays, try again later.
- 403forbiddenThe key belongs to a team member. Only the owner of the X account can do this.
curl -X POST https://gemlead.ai/api/v1/affiliate/cashout \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "affiliate_cashout",
"amount": 342.15,
"currency": "usd",
"destination": "The owner's bank account connected on Stripe.",
"message": "Payout sent."
}Draft the review post
Prepares the review post for 20 percent off the next payment. Send the owner's text, which the app's AI checks mentions @Gemlead and reads specific, or their notes, which Nico AI turns into the post. The owner then posts it from their own X account, adds the link in a reply, and you submit the post.
Body parameters
- textstringThe post as the owner wrote it, up to 8 000 characters. Give
textornotes. - notesstringThe owner's notes, up to 8 000 characters. Nico AI writes the post from them.
Returns
An object with object at tweet_review_draft, the post's text, validated, the post_on_x_url that opens X's composer with it, the program's tweet_review and a message.
Errors
- Both
textandnotes, or neither. - The app's AI refused the post. The message says what to change.
- 20 percent off already waits on the next payment. A new post waits until it is paid.
- The last post is still in review.
- 409offer_closedThe offer is only open in the first three months.
- 409offer_usedAll three discounts were used.
- 403forbiddenThe key belongs to a team member. Only the owner of the X account can do this.
- X or a Gemlead service did not answer. Nothing changed, try again in a minute.
curl -X POST \
https://gemlead.ai/api/v1/affiliate/tweet_review/draft \
-H "Authorization: Bearer $GEMLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"notes": "found 40 hot leads in a week, booked 6 calls, setup took 10 minutes"
}'{
"object": "tweet_review_draft",
"text": "Tried @Gemlead for a week: 40 hot leads on X, 6 calls booked, and the setup took 10 minutes. The scoring is scary good.",
"validated": true,
"post_on_x_url": "https://x.com/intent/tweet?text=Tried%20%40Gemlead%20for%20a%20week%3A%2040%20hot%20leads%20on%20X%2C%206%20calls%20booked%2C%20and%20the%20setup%20took%2010%20minutes.%20The%20scoring%20is%20scary%20good.",
"tweet_review": {
"discount_percent": 20,
"status": "approved",
"post_url": "https://x.com/acme/status/1985402219876543210",
"used": 1,
"remaining": 2,
"max": 3,
"discount_pending": false,
"can_submit": true,
"window_open": true,
"window_ends_at": "2026-12-14T09:21:05.000Z",
"submitted_at": "2026-10-02T11:04:37.000Z",
"reviewed_at": "2026-10-02T11:06:12.000Z",
"last_checked_at": "2026-11-06T06:00:00.000Z",
"reply_found": true,
"draft": "Tried @Gemlead for a week: 40 hot leads on X, 6 calls booked, and the setup took 10 minutes. The scoring is scary good.",
"draft_validated": true
},
"message": "Ready. The user posts it from their own X account (post_on_x_url opens X's composer), adds gemlead.ai or their affiliate link in a reply, then manage_affiliate tweet_submit with the post's link."
}Submit the review post
Submits the posted review. The app checks the post and its reply with the link on X, then 20 percent comes off the next payment. A deleted post loses it.
Body parameters
- post_urlstringRequiredThe X post's link, like
https://x.com/name/status/123.
Returns
The affiliate program object and a message.
Errors
- A required parameter is missing.
paramnames it. post_urlis not a public X post link.- This post was submitted already.
- The post was not validated first. Draft the review post, then post that one.
- The app's check refused the post. The message says why.
- 20 percent off already waits on the next payment. A new post waits until it is paid.
- The last post is still in review.
- 409offer_closedThe offer is only open in the first three months.
- 409offer_usedAll three discounts were used.
- 403forbiddenThe key belongs to a team member. Only the owner of the X account can do this.
curl -X POST \
https://gemlead.ai/api/v1/affiliate/tweet_review/submit \
-H "Authorization: Bearer $GEMLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"post_url": "https://x.com/acme/status/1987012345678901234"
}'{
"object": "affiliate_program",
"code": "acme",
"link": "https://gemlead.ai?via=acme",
"rate_percent": 15,
"active_referrals": 6,
"next_rate_percent": 20,
"max_rate_percent": 50,
"rates_percent": [5, 10, 15, 20, 25, 30, 40, 50],
"currency": "usd",
"earnings": 1284.6,
"balance": 342.15,
"payout_account": {
"connected": true,
"payouts_enabled": true
},
"can_cash_out": true,
"referrals": [
{
"name": "Nina Park",
"email": "nina@parkpicks.com",
"plan": "business",
"status": "active",
"earned": 309.15,
"rate_percent": 15
},
{
"name": "Leo Grant",
"email": "leo@grantsignals.io",
"plan": "starter",
"status": "trialing",
"earned": 0,
"rate_percent": 15
}
],
"payouts": [
{
"id": "py8Kq2LmXv",
"object": "affiliate_payout",
"amount": 942.45,
"currency": "usd",
"status": "paid",
"created_at": "2026-10-31T12:00:00.000Z"
}
],
"tweet_review": {
"discount_percent": 20,
"status": "approved",
"post_url": "https://x.com/acme/status/1987012345678901234",
"used": 2,
"remaining": 1,
"max": 3,
"discount_pending": true,
"can_submit": false,
"window_open": true,
"window_ends_at": "2026-12-14T09:21:05.000Z",
"submitted_at": "2026-11-06T10:12:03.000Z",
"reviewed_at": "2026-11-06T10:12:09.000Z",
"last_checked_at": "2026-11-06T06:00:00.000Z",
"reply_found": true,
"draft": null,
"draft_validated": false
},
"manage_url": "https://gemlead.ai/app/affiliate",
"message": "20% off is on the next payment. Keep the post up: a deleted post loses it."
}The affiliate statistics object
The Affiliate page's Statistics over a period, against a comparison period, counted in a time zone.
Attributes
- objectstringAlways
affiliate_stats. - timezonestringThe IANA time zone the days are counted in.
- currencystringAlways
usd. - periodobjectThe period counted, with its
time, itsstartandend, itsscale, thescalesit allows, thecomparisonand the compared period'scompared_startandcompared_end. - chartsarray of objectsOne per chart, each with its
key,title,about,unitcountorusd, the period'stotal, thecompared_total, thechange_percentand, withseries, its points withperiodandvalue.
{
"object": "affiliate_stats",
"timezone": "Europe/Paris",
"currency": "usd",
"period": {
"time": "last_7_days",
"start": "2026-10-30T23:00:00.000Z",
"end": "2026-11-06T22:59:59.999Z",
"scale": "day",
"scales": ["day", "hour"],
"comparison": "previous_period",
"compared_start": "2026-10-23T22:00:00.000Z",
"compared_end": "2026-10-30T22:59:59.999Z"
},
"charts": [
{
"key": "signups",
"title": "Sign-ups",
"about": "Accounts created with the affiliate link.",
"unit": "count",
"total": 9,
"compared_total": 6,
"change_percent": 50,
"series": [
{
"period": "2026-11-04",
"value": 2
},
{
"period": "2026-11-05",
"value": 3
},
{
"period": "2026-11-06",
"value": 1
}
]
}
]
}Retrieve affiliate statistics
Returns the Affiliate page's Statistics, sign-ups, new customers, commissions and payouts over a period, against a comparison period.
Query parameters
- timestringThe period, as in the page's menu. Defaults to
last_4_weeks, orcustomwithstartandend.todaylast_7_dayslast_4_weekslast_3_monthslast_12_monthsmonth_to_datequarter_to_dateyear_to_dateall_timecustom - startstringA custom period's first day,
YYYY-MM-DD, from 2025 on. - endstringA custom period's last day,
YYYY-MM-DD. - scalestringThe step of the series, among the period's
scales. Hours go up to 14 days and months start at 61 days. Defaults to the period's first.hourdaymonth - comparisonstringThe period to compare with. Defaults to
previous_period.previous_periodprevious_monthprevious_quarterprevious_yearno_comparison - timezonestringThe IANA time zone of the days, like
Europe/Paris. Defaults to the owner's, else UTC. - chartsarray of stringsOnly these charts. Defaults to all four.
signupsnew_customerscommissionspayouts - seriesboolean
trueadds each chart's points, one per step of the scale.
Returns
An affiliate statistics object.
Errors
- A required parameter is missing.
paramnames it. - A parameter has a value the API does not accept.
paramnames it. - 403forbiddenThe key belongs to a team member. Only the owner of the X account can do this.
curl -G https://gemlead.ai/api/v1/affiliate/stats \
-H "Authorization: Bearer $GEMLEAD_API_KEY" \
-d time=last_7_days \
-d charts=signups \
-d series=true{
"object": "affiliate_stats",
"timezone": "Europe/Paris",
"currency": "usd",
"period": {
"time": "last_7_days",
"start": "2026-10-30T23:00:00.000Z",
"end": "2026-11-06T22:59:59.999Z",
"scale": "day",
"scales": ["day", "hour"],
"comparison": "previous_period",
"compared_start": "2026-10-23T22:00:00.000Z",
"compared_end": "2026-10-30T22:59:59.999Z"
},
"charts": [
{
"key": "signups",
"title": "Sign-ups",
"about": "Accounts created with the affiliate link.",
"unit": "count",
"total": 9,
"compared_total": 6,
"change_percent": 50,
"series": [
{
"period": "2026-11-04",
"value": 2
},
{
"period": "2026-11-05",
"value": 3
},
{
"period": "2026-11-06",
"value": 1
}
]
}
]
}