Tool reference
Every tool and resource the MCP server exposes: what each takes, its defaults, and what it returns.
Every AffiliateRail tool takes an optional program_id (prg_…). Leave it out and the tool uses your organization's first program. The program://current resource lists the rest, so "in the Acme program" in a prompt is enough for the assistant to pass the right id. Errors come back as readable messages the assistant can act on.
Setup tools
These are for an agent setting a program up. Ask your agent to "set up my affiliate program" and it starts with setup_guide. Then it works through each step the guide names. These tools only read, so your agent can run them without asking you first.
setup_guide
The setup steps from the Getting started page. It says which are done, the next one to do, and the tool to call for each. Your agent calls it again after every step until complete is true. It also says if the demo data is still in your program.
| Input | Type | Default |
|---|---|---|
program_id | prg_… | your first program |
payment_connection_status
Whether Stripe or Paddle is connected, so your sales reach AffiliateRail. If neither is, it returns a link for you to open while signed in. Your agent can't connect Stripe for you: Stripe asks you to approve it yourself.
| Input | Type | Default |
|---|---|---|
program_id | prg_… | your first program |
get_install_instructions
The exact tracking tag for your program, and where it goes in each kind of site (Next.js, React, WordPress, Webflow and others). It also says what the payment step needs for the processor you use. It's the same tag Settings shows you.
| Input | Type | Default |
|---|---|---|
program_id | prg_… | your first program |
check_install
Opens your live page and says whether your program's tag is on it. It also says whether a real visit through a partner link has arrived. It never records a click itself. The step is done once one real visit arrives.
| Input | Type | Default |
|---|---|---|
url | a page on your site, with https:// | your program's website |
program_id | prg_… | your first program |
search_docs
Searches this documentation and returns the matching sections, each with a link to the heading. Your agent uses it to look up how something works instead of guessing. For example: installing the tag, Stripe and Paddle, attribution, payouts or the API.
| Input | Type | Default |
|---|---|---|
query | the words to look for | required |
limit | integer 1 to 10 | 5 |
Read tools
Available to every connection.
top_partners
Rank partners by the revenue they brought in over a period. Each row has commissions earned and customers referred.
| Input | Type | Default |
|---|---|---|
period | 7d, 30d, 90d, ytd, all | 30d |
limit | integer 1 to 50 | 10 |
pending_commissions
Commissions waiting for approval, oldest first, optionally only those at or above an amount.
| Input | Type | Default |
|---|---|---|
min_amount_minor | integer, minor units | 0 |
limit | integer 1 to 100 | 25 |
idle_partners
Active partners with no clicks and no sales in the last N days, the longest idle first.
| Input | Type | Default |
|---|---|---|
days | integer 1 to 365 | 30 |
limit | integer 1 to 100 | 25 |
revenue_by_period
Revenue, sales, commissions and new customers that partners brought in. They're grouped by day, week or month, oldest first.
| Input | Type | Default |
|---|---|---|
granularity | day, week, month | month |
periods | integer 1 to 90, buckets back from now | 12 |
partner_detail
Everything about one partner: status, group, balances, lifetime revenue, recent commissions.
| Input | Type | Notes |
|---|---|---|
handle_or_email | string | The partner's handle (their ?ref= value) or email address |
payout_status
Payouts by status, with every failed or not-eligible payout and its reason.
| Input | Type | Default |
|---|---|---|
period | this_month, last_month, all | this_month |
rules_summary
The program's commission rules in priority order. Each shows its scope, default rate, approval mode, branch count and what it has produced. No inputs beyond program_id.
recent_referrals
The latest referred visits, newest first. Each has the partner, status (visit, lead, converted) and landing page.
| Input | Type | Default |
|---|---|---|
limit | integer 1 to 100 | 20 |
list_partners
Search partners by name, handle or email, optionally one status, newest first. A blank search lists everyone up to the limit.
| Input | Type | Default |
|---|---|---|
query | string, name, handle or email fragment | none |
status | pending, active, declined, suspended | all |
limit | integer 1 to 100 | 25 |
list_customers
Search customers by email, name or identifier, optionally one status, newest first. Each row carries the partner who referred them. It's empty when the sale arrived direct.
| Input | Type | Default |
|---|---|---|
query | string, email, name or identifier fragment | none |
status | lead, trial, active, cancelled, refunded, suspended | all |
limit | integer 1 to 100 | 25 |
list_commissions
Commissions in any status, newest first, with totals for the filter. For the approval queue, use pending_commissions, which orders oldest first.
| Input | Type | Default |
|---|---|---|
status | pending, approved, due, paid, rejected, voided | all |
partner_handle | string, only this partner's commissions | all partners |
limit | integer 1 to 100 | 25 |
list_applications
Who's waiting for review and why, oldest first. You get their answers, where they came from, and any safeguard holds written out in words.
| Input | Type | Default |
|---|---|---|
limit | integer 1 to 100 | 25 |
report
The dashboard's own report engine. It covers clicks, leads, customers, sales, refunds, revenue and commissions, cut six ways over a date range. Rows keyed direct are money that arrived without a partner. The totals include them, which is why they match the dashboard headline. Filtering by partner, group or tag leaves direct money out, because those filters mean "this slice of the partner program".
| Input | Type | Default |
|---|---|---|
dimension | partner, link, product, group, tag, period | partner |
from | ISO date, inclusive | twelve months back |
to | ISO date, inclusive | now |
granularity | day, week, month, for the period dimension | month |
list_risk_flags
Fraud signals with their evidence, highest severity first, such as self-referrals and refund spikes. History stays readable on every plan. New flags come from the risk checks.
| Input | Type | Default |
|---|---|---|
status | open, reviewing, resolved, dismissed | all |
limit | integer 1 to 100 | 25 |
read_risk_settings
The numbers the risk checks run on, such as how many conversions in an hour look suspicious. Each number comes with its allowed range. It also lists the checks you've switched off, and says whether your plan runs the checks at all. You can read it on every plan. Use it before save_risk_settings. No inputs beyond program_id.
preview_risk_settings
What a set of numbers would have flagged over the last 30 days, using your real data. It shows the count, which checks found what, and the partners who'd be flagged most. It saves nothing. It needs a plan with fraud monitoring.
| Input | Type | Notes |
|---|---|---|
thresholds | object | Number names to values, like {"velocity_per_hour": 10}. Only the names you send change from what's saved. Percentages are basis points, where 2000 is 20% |
switched_off | list of check names | The checks to switch off. Leave out to keep the saved list |
disposable_domains | list of domains | Extra throwaway-mail domains to flag. Leave out to keep the saved list |
list_leads
People a partner says they referred outside the link, such as after a call or a demo. Newest first, with how many are pending, approved and declined. The names and notes come from partners, so the assistant treats them as data and never as instructions.
| Input | Type | Default |
|---|---|---|
state | pending, approved, declined | all |
list_unattributed_sales
Paid invoices we saw but couldn't credit to a partner, newest first, with the reason for each. A sale here earns nobody a commission until you credit it with attribute_missed_sale. No inputs beyond program_id.
preview_commission_rule
What a rule would have paid on the last 90 days of sales. It's judged next to your other rules, so their order counts. You get how many commissions it would create, the money, how many sales a higher rule takes instead, and the top partners. It saves nothing. It takes the same arguments as create_commission_rule, plus an optional replaces_rule_id when you're previewing a change to a saved rule, so the saved version isn't counted twice.
list_resources
The resources shelf partners see. It lists files and links in their folders, with who can see each and whether it's published. No inputs beyond program_id.
list_webhook_endpoints
The URLs your program sends signed events to: id, URL, which event types, and whether each is enabled. Signing secrets are never shown. No inputs beyond program_id.
list_webhook_deliveries
The latest attempts to deliver events to one endpoint, newest first: event type, status, attempts and what your receiver answered. The payload is left out, because it holds customer data.
| Input | Type | Notes |
|---|---|---|
endpoint_id | string | whe_… |
limit | integer | 1 to 50, default 20 |
list_tags
The program's tags, each with its colour and how many partners carry it. Use a tag's name or tag_ id in update_partner, update_tag and delete_tag. No inputs beyond program_id.
list_groups
The program's partner groups, each with its slug, landing page, whether it's the default, and how many partners are in it. Use a group's name or slug in update_partner, update_group and delete_group. No inputs beyond program_id.
list_custom_fields
The extra questions on your partner sign-up form, in the order applicants see them, each with its fld_ id, kind and options. Use a field's label or fld_ id in update_custom_field, move_custom_field and delete_custom_field. No inputs beyond program_id.
list_domains
Your portal domain, tracker domain, email sending domain and every branded link domain. Each one says whether it's live and which DNS records are still to add. A server with no host credentials still lists the names, with live: false. No inputs beyond program_id.
list_notifications
The announcements partners see in their portal, pinned first and then newest. Each one has a phase: scheduled, live or ended. The answer also says whether the notification centre is switched on. Use an ntf_ id in update_notification, end_notification and delete_notification. No inputs beyond program_id.
messaging_status
Every campaign with its delivery stats, and every sequence with its enrolment counts. You can see at a glance what's sending, paused or done. No inputs beyond program_id.
list_email_templates
The twelve automated emails, such as the welcome email and the payout sent email. Each one shows when it is sent, whether it is on, and what each language says: our copy, or the copy you saved. It also says whether your plan lets you edit the copy. Use a template's key in save_email_template, preview_email_template and send_test_email. No inputs beyond program_id.
preview_email_template
Shows one automated email the way a partner would see it, with made-up values. Pass subject and body to see an edit you haven't saved. It saves nothing and sends nothing.
| Input | Type | Notes |
|---|---|---|
template | the template's key | required |
subject, body | text | optional, but pass both or neither |
preview_email_templates
The same as preview_email_template, for up to twelve emails in one call. If one edit fails the checks, that email is left out. Preview it alone to read why.
| Input | Type | Notes |
|---|---|---|
items | list of template, with optional subject and body | 1 to 12 |
campaign_audience_size
How many active partners an audience reaches, before you save or send a campaign. It only reads. Someone whose address has bounced is counted here and skipped when the campaign sends.
| Input | Type | Notes |
|---|---|---|
audience_all | boolean | true reaches every active partner |
group_ids, tag_ids, partner_ids | lists of ids | they add together |
preview_campaign_email
Shows a campaign's subject and body, and its button if you pass one, with made-up values. It saves nothing and sends nothing.
| Input | Type | Notes |
|---|---|---|
subject, body | text | required |
button_label, button_url | text and a link | optional, pass both or neither |
enrolment_log
Where each partner got to in a sequence, and which of its emails reached them. It also says how an enrolment ended: finished, stopped, bounced or clicked.
| Input | Type | Default |
|---|---|---|
sequence_id | seq_… | every sequence |
partner | handle or part_ id | every partner |
limit | integer, 1 to 200 | 50 |
preview_sequence_step
Shows one sequence email with made-up values. {{partner_link}} becomes a sample link. It saves nothing and sends nothing.
| Input | Type | Notes |
|---|---|---|
subject, body | text | required |
schema_introspect
Field definitions for every object on this surface: fields, types, enums and which tools touch each object. They're generated from the same source as the REST API's OpenAPI document. The assistant uses it to build calls from real field names instead of guessing. Takes no program_id, because the definitions are the same for everyone.
| Input | Type | Default |
|---|---|---|
object | string, an object name such as commission or risk_flag | none; lists all objects |
Write tools
These are registered only when the connection carries a write scope, and the scope is checked again on every call. Keep them on "needs approval" in your assistant's tool permissions, so you confirm each change before it happens.
Every write tool also takes confirm, default false, and preview_token. Called without confirm: true, the server applies nothing and returns a confirmation card instead. The card shows ids resolved to the names you recognise, amounts formatted from the stored values, and a field-level list of exactly what would change. For example: "Approve com_x93: $42.00 USD to Maria Alvarez, matured 28 Aug". The assistant shows you that card. It only repeats the call with confirm: true once you agree.
The card carries a preview_token, and the confirmed call has to send it back. Without the token, nothing changes. A confirm without it, or with a token from a different change, is refused. The card comes back. Tokens last fifteen minutes. Each one only works for the same arguments, the same program and the same connection.
A token confirms one change, once. Let's say the connection drops after the assistant confirms, and it calls again with the same token. Nothing happens twice: no second link, no second invitation, no second campaign send. The second call answers with the ids the first call made and replayed: true. If the first call failed, the token is still free, so fix the cause and confirm again with the same card. To do the same thing again on purpose, ask for a new card.
The card is also a rehearsal: the real change runs and is rolled back, so anything it would be refused for (your plan's limit, a value the settings page wouldn't accept, a name that's taken) shows up on the card. You're never asked to agree to something that can't happen.
update_program_settings
Changes how your program runs. Only the settings you pass change. Each one follows the same rules as the settings page. For example, tax forms need the Scale plan, and countries are two-letter codes. A value the settings page would refuse is refused on the card, before you're asked to agree.
| Input | Type | Default |
|---|---|---|
name, product_name | text | unchanged |
website_url, terms_url | a URL (terms_url takes null to remove it) | unchanged |
status | active, paused | unchanged |
cookie_days | integer 1 to 365 | unchanged |
url_params | list of parameter names, the first is the default | unchanged |
holding_period_days | integer 0 to 365 | unchanged |
min_payout_minor | integer, minor units (5000 is 50.00) | unchanged |
payout_term | net_15, net_30, net_60 | unchanged |
commission_on_net_revenue, block_self_referrals, require_tax_forms | true or false | unchanged |
blocked_countries | list of two-letter country codes | unchanged |
payout_methods | list of paypal, wise, bank_transfer, wire, crypto, payoneer: which methods partners may pick. It moves no money. A method marked coming soon can't be newly offered | unchanged |
default_landing_url | a URL where referral links send visitors (null clears it, so links go to website_url) | unchanged |
auto_enrol_customers | true or false. On, every customer who converts from then on is emailed an invitation to be a partner. Customers you already have aren't contacted | unchanged |
update_branding
Sets the logo and colours partners see when they sign in to your portal.
| Input | Type | Default |
|---|---|---|
logo_url | a public https image URL, or null to remove it | unchanged |
background_color, button_color, text_color | six-digit hex, like #FF5A36 | unchanged |
remove_sample_data
Programs start with demo partners, sales and commissions, so the dashboard isn't empty on day one. This removes them, and only them. Every row it touches has an id starting sample_. The card counts what will go. Do it before you invite real partners. No inputs beyond program_id.
create_commission_rule
Adds a rule that pays partners. It's a percentage or a fixed amount, on every payment or only on a customer's first. It can apply to everyone, one group or one partner. The card says the rule in plain words, like "30% on every payment, for partners in the group Agencies". It also checks your plan's rule limit before you're asked. A rule for one partner doesn't count toward the limit. Tier ladders, where the rate rises with a partner's results, are built on the Commission rules page.
| Input | Type | Default |
|---|---|---|
name | text | required |
rate_type | percent, fixed | percent |
rate_value | integer: basis points for percent (2000 is 20%), minor units for fixed (5000 is 50.00) | required |
first_payment_only | true or false | false |
group | a group's name or slug | everyone |
partner_handle | a partner's handle | everyone |
approval_mode | immediate, after_days, manual | immediate |
approval_delay_days | integer, with after_days | none |
update_commission_rule
Changes a rule's name, rate or approval, by id (rules_summary lists them). A changed rate applies to new sales only. Commissions already made keep their rate. On a rule with tiers, it changes only the rate used when no tier matches, and the card says so.
| Input | Type | Default |
|---|---|---|
rule_id | flw_… | required |
name, rate_type, rate_value, approval_mode, approval_delay_days | as for create_commission_rule | unchanged |
set_rule_status
Pauses a rule so it stops paying on new sales, or resumes it. Pausing keeps the rule and its history. delete_commission_rule removes one for good.
| Input | Type | Default |
|---|---|---|
rule_id | flw_… | required |
status | active, inactive | required |
create_group
Adds a group of partners, like Creators or Agencies, with its own signup link. The card shows the link. To give the group its own rate, follow up with create_commission_rule and group set to its name.
| Input | Type | Default |
|---|---|---|
name | text; the signup link is made from it and never changes | required |
landing_url | where this group's links send visitors | your website |
description | a line about who the group is for | none |
update_group
Renames a group, changes where its links land, or makes it the default group for new partners. Renaming never changes the signup link, so links you've already shared keep working.
| Input | Type | Default |
|---|---|---|
group | the group's current name or slug | required |
name, landing_url, description | as for create_group, null clears the last two | unchanged |
make_default | true or false | unchanged |
create_partner_link
Makes a tracked link for one partner to a particular page on your site, like your pricing page. Every partner already has a link to your homepage. The card shows the full link.
| Input | Type | Default |
|---|---|---|
partner_handle | the partner's handle | required |
destination_url | a page on your website, with https:// | required |
value | the tracking value in the link | the partner's handle |
label | a name the partner sees, like YouTube | none |
create_coupon
Credits a partner with every sale that uses a coupon code, with no link needed. It suits podcasts and video, where nobody clicks. The code has to exist in Stripe or Paddle too. For Stripe, pass the promotion code's id, which starts promo_. Stripe sales are matched by that id, and the card warns you if it's missing.
| Input | Type | Default |
|---|---|---|
partner_handle | the partner's handle | required |
code | the code customers type, spelled exactly as in your processor | required |
stripe_promotion_code_id | promo_… | none |
create_customer
Records a customer against a partner, for example someone who signed up outside the tracking link. Their later sales credit that partner. It's refused if the email already belongs to a customer. Find them with list_customers and use update_customer instead.
| Input | Type | Default |
|---|---|---|
partner | the partner's handle or part_ id | required |
email, name, identifier | the customer's details. Give at least one | none |
external_customer_id | the payment processor's customer id, so later charges match them | none |
status | lead, trial, active, cancelled, suspended | lead |
metadata | an object of extra fields | none |
update_customer
Changes a customer's details or status, or moves them to another partner. A move changes who is credited for their future sales, so the card names the partner who loses them and the one who gains them. Commissions already created stay where they are. refunded is set by the ledger and can't be set by hand.
| Input | Type | Default |
|---|---|---|
customer_id | cus_… from list_customers | required |
partner | the partner to move them to | unchanged |
email, name, identifier | null clears them | unchanged |
status | as for create_customer | unchanged |
metadata | replaces the extra fields | unchanged |
delete_customer
Deletes a customer record. It's refused on the card when the customer has sales, because money that moved stays on the ledger. Set their status to cancelled or suspended instead.
| Input | Type | Default |
|---|---|---|
customer_id | cus_… | required |
update_partner
Changes a partner's details, handle, group, tags or minimum payout, or suspends or reinstates them. Only what you pass changes. Suspending stops them signing in to their portal, and the card calls it out. A pending partner is approved with approve_application, not here.
| Input | Type | Default |
|---|---|---|
partner | the partner's handle or part_ id | required |
first_name, last_name, display_name, company_name, website_url, country_code | null clears them | unchanged |
new_handle | lowercase letters, numbers and hyphens. Changes their default link | unchanged |
group | a group's name or slug, or null for none | unchanged |
tags | tag names or tag_ ids. Replaces the whole list | unchanged |
min_payout_minor | integer in minor units, or null for the program's | unchanged |
status | active or suspended | unchanged |
suspension_reason | a line kept on their record | none |
metadata | replaces the extra fields | unchanged |
delete_partner
Deletes a partner and everything attributed to them: links, referrals, customers, commissions and payouts. It can't be undone, and it's refused for a partner who has been paid. Suspend those with update_partner. The card counts what will go.
| Input | Type | Default |
|---|---|---|
partner | the partner's handle or part_ id | required |
create_tag
Adds a tag for sorting partners. It's refused when the name already exists.
| Input | Type | Default |
|---|---|---|
name | the tag's name | required |
color | hex colour such as #3B82F6 | a grey |
update_tag
Renames a tag or changes its colour. Partners keep it.
| Input | Type | Default |
|---|---|---|
tag | the tag's name or tag_ id | required |
name, color | as for create_tag | unchanged |
delete_tag
Deletes a tag. Partners who carry it lose it, and anything targeting it stops matching. Partners aren't deleted.
| Input | Type | Default |
|---|---|---|
tag | the tag's name or tag_ id | required |
delete_group
Deletes a partner group. Its partners are left without a group, commission rules scoped to it are deleted with it, and its signup link stops working. The default group can't be deleted. Make another the default first with update_group.
| Input | Type | Default |
|---|---|---|
group | the group's name or slug | required |
delete_coupon
Stops a coupon code crediting a partner. The code stays in your payment processor, so remove it there too if it should stop working.
| Input | Type | Default |
|---|---|---|
coupon | the code as partners type it, or its cpn_ id | required |
create_custom_field
Adds a question to the partner sign-up form, at the end. Every new applicant sees it.
| Input | Type | Default |
|---|---|---|
label | the question applicants see | required |
kind | single (free text), select (pick one), multiple (pick several) | required |
options | the choices, at least two for select and multiple | none |
required | true or false | false |
update_custom_field
Changes a sign-up question. Answers applicants already gave are kept as they were written.
| Input | Type | Default |
|---|---|---|
field | the field's label or fld_ id | required |
label, kind, options, required | as for create_custom_field | unchanged |
move_custom_field
Moves a sign-up question one place up or down on the form.
| Input | Type | Default |
|---|---|---|
field | the field's label or fld_ id | required |
direction | up, down | required |
delete_custom_field
Removes a question from the sign-up form. New applicants are no longer asked it, and the fields after it move up. It can't be undone.
| Input | Type | Default |
|---|---|---|
field | the field's label or fld_ id | required |
set_domain
Attaches a hostname and returns the DNS records to add. You add the records yourself at your DNS host, then call verify_domain. The card checks the name and that nobody else uses it. It doesn't contact the host, so the records only appear once you confirm.
| Input | Type | Default |
|---|---|---|
kind | portal (where partners sign in), tracker (first-party click counting), link (a branded short-link domain, you can have several), email (the sending domain for partner email) | required |
hostname | for example affiliates.acme.com or mail.acme.com | required |
Setting portal or tracker again replaces the current one. An email domain needs none set first.
verify_domain
Asks the host to re-check ownership and DNS, and says whether the domain is live and what's still missing. A new record can take a few minutes to show up, so live: false straight after adding it is normal. When a link domain goes live, your existing partner links get their short form on it.
| Input | Type | Default |
|---|---|---|
kind | as for set_domain | required |
link_domain | for kind: link, the domain's hostname or ldom_ id | none |
remove_domain
Detaches a domain. This is destructive. Removing the portal domain sends partners back to the default address, and links you gave them on the custom one stop working. Removing a link domain stops every short link on it, and the card counts them. Removing the tracker domain stops first-party click counting on that host. Adding it back means new DNS records.
| Input | Type | Default |
|---|---|---|
kind | as for set_domain | required |
link_domain | for kind: link, the domain's hostname or ldom_ id | none |
create_notification
Shows partners an announcement in their portal. It reaches real partners as soon as it's live, and the card says who will see it and from when. It isn't an email.
| Input | Type | Default |
|---|---|---|
title | up to 80 characters | required |
body | up to 250 characters | required |
display | popover (in the bell), bubble (a floating card) | popover |
pinned, dismissible | true or false | false, true |
groups, tags | names or ids. Only those partners see it | every partner |
starts_at, ends_at | ISO dates, for example 2026-12-01T09:00:00Z | live now, until ended |
A pinned notification that partners can't dismiss, with no ends_at, stays until you end it. The card says so.
update_notification
Changes a notification's text, look, audience or dates. Partners see the change straight away if it's live.
| Input | Type | Default |
|---|---|---|
notification_id | ntf_… from list_notifications | required |
everything in create_notification | as there | unchanged |
end_notification
Takes a notification off partners' portals now and keeps its seen and dismissed numbers.
| Input | Type | Default |
|---|---|---|
notification_id | ntf_… | required |
delete_notification
Deletes a notification and its seen and dismissed numbers. It can't be undone. To keep the numbers, end it instead.
| Input | Type | Default |
|---|---|---|
notification_id | ntf_… | required |
set_notification_centre
The one switch for the bell in the partner portal. Off hides every notification without deleting any. It's on by default.
| Input | Type | Default |
|---|---|---|
enabled | true or false | required |
approve_commission
Approve one pending commission by id. It becomes due for payout once its holding period has run.
| Input | Type | Notes |
|---|---|---|
commission_id | string | com_… |
reject_commission
Reject one unpaid commission by id, with a reason the partner will see. The money is returned to the program.
| Input | Type | Notes |
|---|---|---|
commission_id | string | com_… |
reason | string, 1 to 500 chars | Shown to the partner |
create_commission
Pay a partner a commission the rules didn't make: a bonus, or a missed referral tied to a sale. It's approved straight away and paid after the holding period. The card shows the partner, the amount and the reason.
| Input | Type | Notes |
|---|---|---|
partner_handle | string | The partner's handle |
amount_minor | whole number above 0 | Minor units: 2500 is 25.00 |
currency | string, 3 letters, optional | Defaults to the program's, or the sale's |
sale_id | string, optional | sal_…, a sale of this partner's |
customer_id | string, optional | cus_… |
reason | string, up to 500 chars | Kept in the audit log |
invite_partner
Invite someone by email as a pending partner, optionally into a named group. They still go through the review queue.
| Input | Type | Notes |
|---|---|---|
email | string | Required |
group | string | Group name or slug; leave out for none |
name | string | If known |
approve_application
Approve a pending application by id (list_applications has the queue). The partner goes active, their links go live, and they're told by email.
| Input | Type | Notes |
|---|---|---|
application_id | string | app_… |
reject_application
Decline a pending application. The applicant reads the reason word for word. Leave it out and the program's default sentence is used instead.
| Input | Type | Notes |
|---|---|---|
application_id | string | app_… |
reason | string, up to 1000 chars | Optional; shown to the applicant |
resolve_risk_flag
Close one open or reviewing flag. Mark it resolved (you acted on it) or dismissed (false alarm). The note is required, because it's the audit trail.
| Input | Type | Notes |
|---|---|---|
risk_flag_id | string | rsk_… |
status | resolved or dismissed | Default resolved |
note | string, 1 to 1000 chars | What you found |
save_risk_settings
Changes the numbers the risk checks run on, switches checks off, or adds throwaway-mail domains. Only what you send changes. The card lists each change and shows how many flags the old and the new numbers raise over 30 days, so you see the effect before you agree. A number outside its range is refused with the range. It needs a plan with fraud monitoring.
| Input | Type | Notes |
|---|---|---|
thresholds | object | Number names to values, like {"velocity_per_hour": 10}. read_risk_settings lists every name and range |
switched_off | list of check names | The checks to switch off. Replaces the saved list |
disposable_domains | list of domains | Extra throwaway-mail domains to flag. Replaces the saved list |
run_risk_checks
Starts the same sweep the hourly job runs. It raises flags for anything new and leaves what's already flagged alone. The card says how many new flags it would raise. It changes no commission. It needs a plan with fraud monitoring. No inputs beyond program_id.
suspend_flagged_partner
Suspends the partner a risk flag is about and closes the flag as resolved. Their links stop paying. The card names the partner and totals the unpaid commissions they hold, so you can see what's at stake. Those commissions stay as they are. Reject them with reject_flagged_commissions if they aren't owed. Reinstate the partner with update_partner.
| Input | Type | Notes |
|---|---|---|
risk_flag_id | string | rsk_… from list_risk_flags |
note | string, up to 1000 chars | Optional; added to the flag's note and the audit log |
reject_flagged_commissions
Rejects every unpaid commission a risk flag's evidence points at, and closes the flag as resolved. The card names the partner and totals the money. Commissions already paid or inside a payout are skipped, each with its reason. The partner isn't suspended. A rejection can't be undone, but create_commission can add one back.
| Input | Type | Notes |
|---|---|---|
risk_flag_id | string | rsk_… |
note | string, up to 1000 chars | Optional |
set_risk_flag_status
Marks a flag as being reviewed, or reopens it. To close one, use resolve_risk_flag.
| Input | Type | Notes |
|---|---|---|
risk_flag_id | string | rsk_… |
status | reviewing or open | Required |
note | string, up to 1000 chars | Optional |
approve_lead
Approves a partner-submitted lead. It becomes a customer credited to that partner, so their first payment earns a commission through your rules. Approving pays nothing. If the same partner already has that customer, the lead folds into them. If another partner has them, the card is refused and names that partner.
| Input | Type | Notes |
|---|---|---|
lead_id | string | cus_… from list_leads |
decline_lead
Declines a lead with a note the partner reads word for word. The partner can submit the same person again as a new lead.
| Input | Type | Notes |
|---|---|---|
lead_id | string | cus_… |
note | string, 1 to 1000 chars | Why, in a sentence. Shown to the partner |
edit_commission_amount
Changes an unpaid commission's amount, with a reason kept in the audit log. The partner's balance moves by the difference. The card shows the old and new amounts and says whether the partner is owed more or less. A commission that's paid, inside a payout, or a clawback is refused on the card.
| Input | Type | Notes |
|---|---|---|
commission_id | string | com_… |
amount_minor | integer, 0 or more | The new amount in minor units (cents or pence): 2500 is 25.00. Whole numbers only |
reason | string, 1 to 500 chars | Why it's changing |
retry_commissions
Judges sales again by your rules. It creates commissions that are missing, such as a sale that arrived before its rule existed. It also updates unpaid ones whose amount differs. Paid commissions are never touched, and running it twice changes nothing more. The card is a dry run: it counts what would be created and changed, shows the net money, and lists examples. It handles up to 500 sales a call.
| Input | Type | Notes |
|---|---|---|
commission_ids | list of com_… | Re-run the sales behind these. Give this or since |
since | date, like 2026-08-01 | Re-run every sale from then on |
until | date | With since: the last day to include. Default: now |
partner_handle | string | With since: only this partner's sales |
rules | current or snapshot | current uses today's rules; snapshot uses the rules as they stood when the sale was recorded. Default current |
attribute_missed_sale
Says a sale came through a partner. The customer is created, and every unattributed invoice we saw for them goes through your rules. A commission is created and held for the holding period, then paid in your next payout run. The card names the partner and the commission that would be created.
| Input | Type | Notes |
|---|---|---|
sale_id | string | The sale_id from list_unattributed_sales |
partner_handle | string | The partner's handle |
reorder_commission_rules
Sets the order your rules are tried in. The first rule that matches a sale pays it. Send every rule id exactly once, first to last. The card shows the old order next to the new one. Use preview_commission_rule first if you're unsure what a rule's place means for the money.
| Input | Type | Notes |
|---|---|---|
ordered_rule_ids | list of flw_… | Every rule in the program, in the order you want |
delete_commission_rule
Deletes a rule for good. Sales it would have matched fall through to the next rule, or earn nothing if none matches. Commissions it already made keep their amounts. The card says how many that is. To stop a rule paying without losing it, use set_rule_status with inactive.
| Input | Type | Notes |
|---|---|---|
rule_id | string | flw_… from rules_summary |
reorder_resources
Puts the listed resources in this order inside one folder. Ones you leave out follow after. Partners see the new order straight away.
| Input | Type | Notes |
|---|---|---|
folder | string or null | The folder's name; null or leave out for the top level |
ordered_resource_ids | list of res_… | From that folder, in the order you want |
rename_resource_folder
Renames a folder on the shelf, and every resource in it moves with it. Renaming to a name that already exists merges the two folders.
| Input | Type | Notes |
|---|---|---|
from | string | The folder's current name |
to | string, 1 to 60 chars | The new name |
add_sample_data
Turns the demo data back on, for a demo or a screenshot. That means sample partners, each with their own sales and commissions. The card counts what will be added. It's refused once a real partner, sale or click exists, because demo rows beside real ones would muddy your numbers. remove_sample_data takes them off again. No inputs beyond program_id.
create_resource_link
Put a link on the partners' resources shelf. Files are uploaded in the dashboard, so this tool mints links only.
| Input | Type | Notes |
|---|---|---|
title | string, 1 to 120 chars | Required |
url | string | The http(s) address the shelf links to |
folder | string, up to 60 chars | Leave out for the top level |
publish | boolean | Default true |
update_resource
Rename a resource, move it to a folder, repoint a link, or publish and unpublish it. list_resources has the ids. Only the fields you send change.
| Input | Type | Notes |
|---|---|---|
resource_id | string | res_… |
title | string, 1 to 120 chars | Optional |
url | string | Optional, links only |
folder | string or null | Optional; null moves it to the top level |
published | boolean | Optional |
delete_resource
Take one resource off the shelf for good. A file's stored blob goes with it.
| Input | Type | Notes |
|---|---|---|
resource_id | string | res_… |
create_webhook_endpoint
Start sending signed events to an HTTPS URL. The address must be public: private and local ones are refused, the same as on the settings page. The signing secret is shown once, in the confirmed answer, and never again, so the assistant should hand it to you to store. If the connection drops and the call is retried with the same token, the answer says the secret was already shown and gives nothing twice. Lost it? rotate_webhook_secret makes a new one.
| Input | Type | Notes |
|---|---|---|
url | string | https://… on a public address |
event_types | string[] | Optional. Types from catalog://events. Leave out for every event. An unknown type is refused with the nearest matches |
update_webhook_endpoint
Change an endpoint's URL or event types, or switch it off and on. Only what you pass changes. The signing secret stays the same.
| Input | Type | Notes |
|---|---|---|
endpoint_id | string | whe_… |
url | string | Optional |
event_types | string[] | Optional. Replaces the list. Empty means every event |
enabled | boolean | Optional. false pauses deliveries |
delete_webhook_endpoint
Delete an endpoint for good. Deliveries stop and its delivery log goes with it. To pause instead, use update_webhook_endpoint with enabled: false.
| Input | Type | Notes |
|---|---|---|
endpoint_id | string | whe_… |
rotate_webhook_secret
Make a new signing secret, shown once in the confirmed answer. The old secret keeps signing alongside the new one for 24 hours, then stops. Your receiver has to switch inside that time or its signature checks start failing. The answer gives the exact time the old secret stops.
| Input | Type | Notes |
|---|---|---|
endpoint_id | string | whe_… |
ping_webhook_endpoint
Send one sample event, signed like a real one, to your endpoint's URL now, and report what came back. It goes through the same safe sender as real deliveries, so private addresses are refused. It's sent once, not retried, and shows up in the delivery log.
| Input | Type | Notes |
|---|---|---|
endpoint_id | string | whe_… |
event_type | string | Optional, from catalog://events. Defaults to sale.created |
replay_webhook_delivery
Queue a fresh copy of an earlier delivery, with the same payload and the same webhook-id. A receiver that de-duplicates ignores it if it already handled the first one. Find the id with list_webhook_deliveries.
| Input | Type | Notes |
|---|---|---|
delivery_id | string | whd_… |
send_campaign
Send a draft or paused campaign now, to the audience already saved on it. This is real email to real partners, and it can't be recalled. So the tool is marked destructive, and its card names the campaign and the audience before anything is sent.
| Input | Type | Notes |
|---|---|---|
campaign_id | string | camp_…; messaging_status has the list |
pause_sequence
Stop a sequence sending. Nobody is dropped: resuming carries each partner on from the step they were on.
| Input | Type | Notes |
|---|---|---|
sequence_id | string | seq_… |
resume_sequence
Turn a paused sequence back on.
| Input | Type | Notes |
|---|---|---|
sequence_id | string | seq_… |
save_email_template
Saves your own copy of one automated email in one language. It replaces our copy from the next send. This needs a plan that allows custom emails, and a merge tag it doesn't know is refused. The card shows the old and the new text.
| Input | Type | Default |
|---|---|---|
template | the template's key | required |
language | two-letter code such as fr | en |
subject, body | text | required |
reset_email_template
Puts one language of an automated email back to our copy. Your saved copy is removed, and the on or off switch stays as it was.
| Input | Type | Default |
|---|---|---|
template | the template's key | required |
language | two-letter code | en |
set_email_template_enabled
Switches one automated email on or off for every partner. This works on every plan. The invitation, approved, declined and payout reminder emails can't be switched off.
| Input | Type | Notes |
|---|---|---|
template | the template's key | required |
enabled | boolean | true sends it, false stops it |
send_test_email
Sends one [Test] copy of an automated email, with made-up values, to the owner of the organization. It never goes to a partner. Pass subject and body to test an edit you haven't saved, or leave both out to test the live email.
| Input | Type | Notes |
|---|---|---|
template | the template's key | required |
subject, body | text | optional, pass both or neither |
create_campaign_draft
Saves a draft campaign: a name, a subject, a body, who it goes to, and an optional button. Nothing is sent. Check the audience with campaign_audience_size, then send it with send_campaign.
| Input | Type | Notes |
|---|---|---|
name, subject, body | text | required |
audience_all, group_ids, tag_ids, partner_ids | boolean and lists of ids | the audience |
button_label, button_url | text and a link | optional, pass both or neither |
update_campaign_draft
Changes a draft campaign. Only what you pass changes. A campaign that is scheduled, sending or sent can't be edited.
| Input | Type | Notes |
|---|---|---|
campaign_id | camp_… | required |
| other inputs | as for create_campaign_draft | unchanged when left out |
remove_button | boolean | true takes the button off |
delete_campaign
Deletes a campaign and its delivery records, meaning the list of who was sent what. Partners keep any email they already got. It's refused while the campaign is sending.
| Input | Type | Notes |
|---|---|---|
campaign_id | camp_… | required |
mark_email_address_valid
A campaign skips an address that bounced hard or was reported as spam. After you've spoken to the partner, this lets the address get email again. It's refused when the address isn't blocked.
| Input | Type | Notes |
|---|---|---|
partner | handle or part_ id | required |
create_sequence
Creates an email sequence: a trigger and up to ten emails with a wait between them. It starts paused, so nobody is emailed until resume_sequence.
| Input | Type | Notes |
|---|---|---|
name | text | required |
trigger | approved, idle or first_commission | required |
trigger_days | integer, 1 to 365 | for idle only: the quiet days before it starts |
steps | list of delay_days, subject, body | 1 to 10 |
update_sequence
Changes a sequence's name, trigger or emails. Only what you pass changes. Passing steps replaces every email, and partners already in the sequence carry on from the same step number.
| Input | Type | Notes |
|---|---|---|
sequence_id | seq_… | required |
| other inputs | as for create_sequence | unchanged when left out |
delete_sequence
Deletes a sequence, its emails and its history of who was in it. Partners in it stop getting it. The card counts how many are still in it. To stop it and keep the history, use pause_sequence.
| Input | Type | Notes |
|---|---|---|
sequence_id | seq_… | required |
stop_sequence_enrolment
Takes one partner out of one sequence. They get no more of its emails, and the sequence carries on for everyone else. It's refused when they aren't in it.
| Input | Type | Notes |
|---|---|---|
sequence_id | seq_… | required |
partner | handle or part_ id | required |
turn_on_activation_emails
Switches on the three ready-made emails that go to a partner you've just approved. The first call creates the sequence, and a later one turns a paused sequence back on. Partners you approved earlier aren't added. It's refused when the emails are already on.
No inputs beyond program_id.
create_sequences
Creates several sequences you wrote, all paused. A name that's already in use is skipped, so running it twice doesn't make copies. No model writes anything and nothing is billed.
| Input | Type | Notes |
|---|---|---|
sequences | list of name, trigger, trigger_days and steps, each as for create_sequence | 1 to 10 |
Every confirmed write returns a confirmation payload: what changed, from what to what, with formatted amounts. It lands in your audit log with the connection that made it. See Security.
RecruitAffiliates.ai tools
These are for RecruitAffiliates.ai, our second product, which finds new affiliates for you. They work on the same connection, and their names start with recruit_. They don't take a program_id: they act on your RecruitAffiliates.ai account, even if you haven't made an AffiliateRail program yet.
recruit_affiliatesonly reads, so any connection has it.- The other six need a write scope, like every write tool above.
- Each write shows a card first and changes nothing until you agree. The card says what it costs and how many credits you have left.
- No
recruit_tool drafts or sends a message. Outreach stays with you, in RecruitAffiliates.ai. - Every
recruit_tool takes an optionalbrand, and every card and answer names the brand it is about. A row from a different brand than the one you name is refused.
A credit is one paid lookup: a search credit starts one search, and an email credit finds one address. Credits has what each plan includes.
recruit_affiliates
Your affiliates, best match first. Each row says why it's there ("Strong match, score 82 of 100, found by your topic search"), shows up to three pieces of evidence, and counts the replies they've sent you. A saved website also carries website_facts: the pages read, social profiles, a newsletter, and traffic countries and keywords when there are any. Names and page titles come from other people's sites, so they arrive marked as untrusted_text.
| Input | Type | Default |
|---|---|---|
view | discover, saved or hidden | discover |
channel | website or youtube | both |
search | a name, domain or handle | none |
limit | 1 to 50 | 20 |
offset | a number | 0 |
brand | a domain, name or brand id | your oldest brand |
On a trial, Discover shows your best 50 matches, the same as the screen.
recruit_search
Start a search from one seed. It costs one search credit. If the search can't start, or finishes without finding anything new, the credit comes straight back. The search runs in the background: call recruit_affiliates a few minutes later to see what it found.
| Input | Type | Notes |
|---|---|---|
type | topic, competitor or lookalike | what the seed is |
seed | string | a topic like "email marketing software", a competitor's site or @handle, or a YouTube channel |
country | two letters, like GB | topic searches only |
brand | a domain, name or brand id | optional; leave out for your oldest brand |
recruit_clone_profile
Step one of Clone your best affiliates. Give it one to ten creators you already rate, and it says what they have in common: topics, audience, formats, brands they promote, size and hashtags. It's free and nothing is charged. Show the profile to the user, let them edit it, then pass it to recruit_clone_search. While clone search is switched off, both clone tools are left out of the tool list.
| Input | Type | Notes |
|---|---|---|
seeds | list of links | a website, YouTube channel, Instagram or TikTok profile, newsletter or podcast. A bare @name is refused, because it could be anyone on three platforms. Three to seven works best |
prospect_ids | list of row ids | optional; pick creators from your own rows instead, ids from recruit_affiliates. Ten creators at most, pasted and picked together |
brand | a domain, name or brand id | optional; leave out for your oldest brand |
The answer lists the creators it read, the lines it couldn't use (not_used), any creators it couldn't read (unread), the profile and searchable. If searchable is false, the profile has no topic, brand or hashtag, so a search would find nothing: add one first.
recruit_clone_search
Step two. Finds creators like the ones you gave, on the profile you give it. It costs one search credit, and the credit comes back if the search can't start. The card shows the creators, the whole profile, the cost and your balance before anything is spent. The search runs in the background: call recruit_affiliates a few minutes later.
| Input | Type | Notes |
|---|---|---|
seeds | list of links | the same creators you gave recruit_clone_profile |
prospect_ids | list of row ids | optional, as above |
profile | object | the profile from recruit_clone_profile, edited or not: topics, audience, formats, brands, size_band, language and hashtags. It needs at least one topic, brand or hashtag |
country | two letters, like GB | required |
brand | a domain, name or brand id | optional; leave out for your oldest brand |
recruit_save
Save up to 25 rows. It's free. Each saved row gets a deal from your default offer, the same as pressing Save.
| Input | Type | Notes |
|---|---|---|
ids | list of row ids | from recruit_affiliates |
brand | a domain, name or brand id | optional; leave out for your oldest brand |
recruit_find_email
Find one saved row's email address. It costs one email credit, and only when a usable address comes back. If nothing is found, the credit is refunded. A row you've already revealed costs nothing.
| Input | Type | Notes |
|---|---|---|
id | row id | save the row first |
brand | a domain, name or brand id | optional; leave out for your oldest brand |
recruit_deal
Read a saved row's deal: the terms in words, every version you've offered, and the verdict. Pass terms to offer new terms, which become the next version. It never marks terms agreed and never turns anyone into a partner. You do both in RecruitAffiliates.ai.
| Input | Type | Notes |
|---|---|---|
id | row id | a saved row |
brand | a domain, name or brand id | optional; leave out for your oldest brand |
terms | object | leave out to read; the same shape as your offer: rate (percent in basis points, where 2000 is 20%, or a fixed amount in minor units), duration and up to 5 tiers |
Resources
program://current
Your default program's settings and plan, plus how many partners and commissions it has. It also lists every other program on the organization, with its id, currency and portal address. Assistants are told to read this first when they need to know which program, currency or plan they're looking at.
catalog://events
The webhook event catalogue. It lists every event the platform emits, grouped by family, with a description and an example payload. It's the same content as the webhooks guide, shaped for a model.
Was this page helpful?