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

  • objectstring
    Always affiliate_program.
  • codestring or null
    The link's code, the part after ?via=.
  • linkstring or null
    The affiliate link to share.
  • rate_percentinteger
    The share earned on every referral's payments. It grows with the number of active referrals, from 5 to 50 percent.
  • active_referralsinteger
    Referrals paying now.
  • next_rate_percentinteger or null
    The next rate, null at the top.
  • max_rate_percentinteger
    The highest rate.
  • rates_percentarray of integers
    Every rate, from the first to the highest.
  • currencystring
    Always usd.
  • earningsnumber
    Everything earned so far.
  • balancenumber
    What is earned and not paid out yet.
  • payout_accountobject
    The bank account payouts go to, on Stripe.
  • can_cash_outboolean
    true with a payout account and a balance above zero.
  • referralsarray of objects
    The people who signed up with the link, each with name, email, plan, the subscription status, what they earned the owner and their rate_percent.
  • payoutsarray of objects
    The payouts to the bank, newest first, each with id, amount, currency, status and created_at.
  • tweet_reviewobject
    The review post for 20 percent off the next payment, up to 3 times in the first three months.
  • manage_urlstring
    The app's Affiliate page.
Affiliate program object
{
  "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

GET/v1/affiliateread scopeMCPget_affiliate

Returns the link, the rate, the referrals, the balance, the payouts and the review post's discount.

Returns

The affiliate program object.

Errors

  • The key belongs to a team member. Only the owner of the X account can do this.
GET/v1/affiliate
curl https://gemlead.ai/api/v1/affiliate \
  -H "Authorization: Bearer $GEMLEAD_API_KEY"
Response200
{
  "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

GET/v1/affiliate/code_availabilityread scopeMCPget_affiliate

Says whether a code is free for the affiliate link, as the link field checks it.

Query parameters

  • codestringRequired
    The 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. param names it.
  • A parameter has a value the API does not accept. param names it.
  • The key belongs to a team member. Only the owner of the X account can do this.
GET/v1/affiliate/code_availability
curl -G \
  https://gemlead.ai/api/v1/affiliate/code_availability \
  -H "Authorization: Bearer $GEMLEAD_API_KEY" \
  -d code=acme-picks
Response200
{
  "object": "affiliate_code",
  "code": "acme-picks",
  "link": "https://gemlead.ai?via=acme-picks",
  "available": true
}

Change the affiliate code

PATCH/v1/affiliate/codewrite scopeMCPmanage_affiliate

Changes the affiliate link's code. The old link stops bringing referrals, so ask the owner first.

Body parameters

  • codestringRequired
    The 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. param names it.
  • A parameter has a value the API does not accept. param names it.
  • The code is taken or reserved. The link stays the same.
  • The key belongs to a team member. Only the owner of the X account can do this.
PATCH/v1/affiliate/code
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"
  }'
Response200
{
  "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

POST/v1/affiliate/payout_accountwrite scopeMCPmanage_affiliate

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

POST/v1/affiliate/payout_account
curl -X POST \
  https://gemlead.ai/api/v1/affiliate/payout_account \
  -H "Authorization: Bearer $GEMLEAD_API_KEY"
Response200
{
  "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

POST/v1/affiliate/cashoutwrite scopeMCPmanage_affiliate

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

POST/v1/affiliate/cashout
curl -X POST https://gemlead.ai/api/v1/affiliate/cashout \
  -H "Authorization: Bearer $GEMLEAD_API_KEY"
Response200
{
  "object": "affiliate_cashout",
  "amount": 342.15,
  "currency": "usd",
  "destination": "The owner's bank account connected on Stripe.",
  "message": "Payout sent."
}

Draft the review post

POST/v1/affiliate/tweet_review/draftwrite scopeMCPmanage_affiliate

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

  • textstring
    The post as the owner wrote it, up to 8 000 characters. Give text or notes.
  • notesstring
    The 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 text and notes, 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.
  • The offer is only open in the first three months.
  • All three discounts were used.
  • The 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.
POST/v1/affiliate/tweet_review/draft
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"
  }'
Response200
{
  "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

POST/v1/affiliate/tweet_review/submitwrite scopeMCPmanage_affiliate

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_urlstringRequired
    The X post's link, like https://x.com/name/status/123.

Returns

The affiliate program object and a message.

Errors

POST/v1/affiliate/tweet_review/submit
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"
  }'
Response200
{
  "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

  • objectstring
    Always affiliate_stats.
  • timezonestring
    The IANA time zone the days are counted in.
  • currencystring
    Always usd.
  • periodobject
    The period counted, with its time, its start and end, its scale, the scales it allows, the comparison and the compared period's compared_start and compared_end.
  • chartsarray of objects
    One per chart, each with its key, title, about, unit count or usd, the period's total, the compared_total, the change_percent and, with series, its points with period and value.
Affiliate statistics object
{
  "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

GET/v1/affiliate/statsread scopeMCPget_affiliate

Returns the Affiliate page's Statistics, sign-ups, new customers, commissions and payouts over a period, against a comparison period.

Query parameters

  • timestring
    The period, as in the page's menu. Defaults to last_4_weeks, or custom with start and end.
    todaylast_7_dayslast_4_weekslast_3_monthslast_12_monthsmonth_to_datequarter_to_dateyear_to_dateall_timecustom
  • startstring
    A custom period's first day, YYYY-MM-DD, from 2025 on.
  • endstring
    A custom period's last day, YYYY-MM-DD.
  • scalestring
    The 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
  • comparisonstring
    The period to compare with. Defaults to previous_period.
    previous_periodprevious_monthprevious_quarterprevious_yearno_comparison
  • timezonestring
    The IANA time zone of the days, like Europe/Paris. Defaults to the owner's, else UTC.
  • chartsarray of strings
    Only these charts. Defaults to all four.
    signupsnew_customerscommissionspayouts
  • seriesboolean
    true adds each chart's points, one per step of the scale.

Returns

An affiliate statistics object.

Errors

  • A required parameter is missing. param names it.
  • A parameter has a value the API does not accept. param names it.
  • The key belongs to a team member. Only the owner of the X account can do this.
GET/v1/affiliate/stats
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
Response200
{
  "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
        }
      ]
    }
  ]
}