docs
MCP

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.

InputTypeDefault
program_idprg_…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.

InputTypeDefault
program_idprg_…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.

InputTypeDefault
program_idprg_…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.

InputTypeDefault
urla page on your site, with https://your program's website
program_idprg_…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.

InputTypeDefault
querythe words to look forrequired
limitinteger 1 to 105

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.

InputTypeDefault
period7d, 30d, 90d, ytd, all30d
limitinteger 1 to 5010

pending_commissions

Commissions waiting for approval, oldest first, optionally only those at or above an amount.

InputTypeDefault
min_amount_minorinteger, minor units0
limitinteger 1 to 10025

idle_partners

Active partners with no clicks and no sales in the last N days, the longest idle first.

InputTypeDefault
daysinteger 1 to 36530
limitinteger 1 to 10025

revenue_by_period

Revenue, sales, commissions and new customers that partners brought in. They're grouped by day, week or month, oldest first.

InputTypeDefault
granularityday, week, monthmonth
periodsinteger 1 to 90, buckets back from now12

partner_detail

Everything about one partner: status, group, balances, lifetime revenue, recent commissions.

InputTypeNotes
handle_or_emailstringThe partner's handle (their ?ref= value) or email address

payout_status

Payouts by status, with every failed or not-eligible payout and its reason.

InputTypeDefault
periodthis_month, last_month, allthis_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.

InputTypeDefault
limitinteger 1 to 10020

list_partners

Search partners by name, handle or email, optionally one status, newest first. A blank search lists everyone up to the limit.

InputTypeDefault
querystring, name, handle or email fragmentnone
statuspending, active, declined, suspendedall
limitinteger 1 to 10025

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.

InputTypeDefault
querystring, email, name or identifier fragmentnone
statuslead, trial, active, cancelled, refunded, suspendedall
limitinteger 1 to 10025

list_commissions

Commissions in any status, newest first, with totals for the filter. For the approval queue, use pending_commissions, which orders oldest first.

InputTypeDefault
statuspending, approved, due, paid, rejected, voidedall
partner_handlestring, only this partner's commissionsall partners
limitinteger 1 to 10025

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.

InputTypeDefault
limitinteger 1 to 10025

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".

InputTypeDefault
dimensionpartner, link, product, group, tag, periodpartner
fromISO date, inclusivetwelve months back
toISO date, inclusivenow
granularityday, week, month, for the period dimensionmonth

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.

InputTypeDefault
statusopen, reviewing, resolved, dismissedall
limitinteger 1 to 10025

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.

InputTypeNotes
thresholdsobjectNumber 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_offlist of check namesThe checks to switch off. Leave out to keep the saved list
disposable_domainslist of domainsExtra 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.

InputTypeDefault
statepending, approved, declinedall

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.

InputTypeNotes
endpoint_idstringwhe_…
limitinteger1 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.

InputTypeNotes
templatethe template's keyrequired
subject, bodytextoptional, 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.

InputTypeNotes
itemslist of template, with optional subject and body1 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.

InputTypeNotes
audience_allbooleantrue reaches every active partner
group_ids, tag_ids, partner_idslists of idsthey 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.

InputTypeNotes
subject, bodytextrequired
button_label, button_urltext and a linkoptional, 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.

InputTypeDefault
sequence_idseq_…every sequence
partnerhandle or part_ idevery partner
limitinteger, 1 to 20050

preview_sequence_step

Shows one sequence email with made-up values. {{partner_link}} becomes a sample link. It saves nothing and sends nothing.

InputTypeNotes
subject, bodytextrequired

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.

InputTypeDefault
objectstring, an object name such as commission or risk_flagnone; 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.

InputTypeDefault
name, product_nametextunchanged
website_url, terms_urla URL (terms_url takes null to remove it)unchanged
statusactive, pausedunchanged
cookie_daysinteger 1 to 365unchanged
url_paramslist of parameter names, the first is the defaultunchanged
holding_period_daysinteger 0 to 365unchanged
min_payout_minorinteger, minor units (5000 is 50.00)unchanged
payout_termnet_15, net_30, net_60unchanged
commission_on_net_revenue, block_self_referrals, require_tax_formstrue or falseunchanged
blocked_countrieslist of two-letter country codesunchanged
payout_methodslist 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 offeredunchanged
default_landing_urla URL where referral links send visitors (null clears it, so links go to website_url)unchanged
auto_enrol_customerstrue or false. On, every customer who converts from then on is emailed an invitation to be a partner. Customers you already have aren't contactedunchanged

update_branding

Sets the logo and colours partners see when they sign in to your portal.

InputTypeDefault
logo_urla public https image URL, or null to remove itunchanged
background_color, button_color, text_colorsix-digit hex, like #FF5A36unchanged

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.

InputTypeDefault
nametextrequired
rate_typepercent, fixedpercent
rate_valueinteger: basis points for percent (2000 is 20%), minor units for fixed (5000 is 50.00)required
first_payment_onlytrue or falsefalse
groupa group's name or slugeveryone
partner_handlea partner's handleeveryone
approval_modeimmediate, after_days, manualimmediate
approval_delay_daysinteger, with after_daysnone

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.

InputTypeDefault
rule_idflw_…required
name, rate_type, rate_value, approval_mode, approval_delay_daysas for create_commission_ruleunchanged

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.

InputTypeDefault
rule_idflw_…required
statusactive, inactiverequired

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.

InputTypeDefault
nametext; the signup link is made from it and never changesrequired
landing_urlwhere this group's links send visitorsyour website
descriptiona line about who the group is fornone

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.

InputTypeDefault
groupthe group's current name or slugrequired
name, landing_url, descriptionas for create_group, null clears the last twounchanged
make_defaulttrue or falseunchanged

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.

InputTypeDefault
partner_handlethe partner's handlerequired
destination_urla page on your website, with https://required
valuethe tracking value in the linkthe partner's handle
labela name the partner sees, like YouTubenone

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.

InputTypeDefault
partner_handlethe partner's handlerequired
codethe code customers type, spelled exactly as in your processorrequired
stripe_promotion_code_idpromo_…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.

InputTypeDefault
partnerthe partner's handle or part_ idrequired
email, name, identifierthe customer's details. Give at least onenone
external_customer_idthe payment processor's customer id, so later charges match themnone
statuslead, trial, active, cancelled, suspendedlead
metadataan object of extra fieldsnone

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.

InputTypeDefault
customer_idcus_… from list_customersrequired
partnerthe partner to move them tounchanged
email, name, identifiernull clears themunchanged
statusas for create_customerunchanged
metadatareplaces the extra fieldsunchanged

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.

InputTypeDefault
customer_idcus_…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.

InputTypeDefault
partnerthe partner's handle or part_ idrequired
first_name, last_name, display_name, company_name, website_url, country_codenull clears themunchanged
new_handlelowercase letters, numbers and hyphens. Changes their default linkunchanged
groupa group's name or slug, or null for noneunchanged
tagstag names or tag_ ids. Replaces the whole listunchanged
min_payout_minorinteger in minor units, or null for the program'sunchanged
statusactive or suspendedunchanged
suspension_reasona line kept on their recordnone
metadatareplaces the extra fieldsunchanged

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.

InputTypeDefault
partnerthe partner's handle or part_ idrequired

create_tag

Adds a tag for sorting partners. It's refused when the name already exists.

InputTypeDefault
namethe tag's namerequired
colorhex colour such as #3B82F6a grey

update_tag

Renames a tag or changes its colour. Partners keep it.

InputTypeDefault
tagthe tag's name or tag_ idrequired
name, coloras for create_tagunchanged

delete_tag

Deletes a tag. Partners who carry it lose it, and anything targeting it stops matching. Partners aren't deleted.

InputTypeDefault
tagthe tag's name or tag_ idrequired

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.

InputTypeDefault
groupthe group's name or slugrequired

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.

InputTypeDefault
couponthe code as partners type it, or its cpn_ idrequired

create_custom_field

Adds a question to the partner sign-up form, at the end. Every new applicant sees it.

InputTypeDefault
labelthe question applicants seerequired
kindsingle (free text), select (pick one), multiple (pick several)required
optionsthe choices, at least two for select and multiplenone
requiredtrue or falsefalse

update_custom_field

Changes a sign-up question. Answers applicants already gave are kept as they were written.

InputTypeDefault
fieldthe field's label or fld_ idrequired
label, kind, options, requiredas for create_custom_fieldunchanged

move_custom_field

Moves a sign-up question one place up or down on the form.

InputTypeDefault
fieldthe field's label or fld_ idrequired
directionup, downrequired

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.

InputTypeDefault
fieldthe field's label or fld_ idrequired

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.

InputTypeDefault
kindportal (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
hostnamefor example affiliates.acme.com or mail.acme.comrequired

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.

InputTypeDefault
kindas for set_domainrequired
link_domainfor kind: link, the domain's hostname or ldom_ idnone

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.

InputTypeDefault
kindas for set_domainrequired
link_domainfor kind: link, the domain's hostname or ldom_ idnone

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.

InputTypeDefault
titleup to 80 charactersrequired
bodyup to 250 charactersrequired
displaypopover (in the bell), bubble (a floating card)popover
pinned, dismissibletrue or falsefalse, true
groups, tagsnames or ids. Only those partners see itevery partner
starts_at, ends_atISO dates, for example 2026-12-01T09:00:00Zlive 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.

InputTypeDefault
notification_idntf_… from list_notificationsrequired
everything in create_notificationas thereunchanged

end_notification

Takes a notification off partners' portals now and keeps its seen and dismissed numbers.

InputTypeDefault
notification_idntf_…required

delete_notification

Deletes a notification and its seen and dismissed numbers. It can't be undone. To keep the numbers, end it instead.

InputTypeDefault
notification_idntf_…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.

InputTypeDefault
enabledtrue or falserequired

approve_commission

Approve one pending commission by id. It becomes due for payout once its holding period has run.

InputTypeNotes
commission_idstringcom_…

reject_commission

Reject one unpaid commission by id, with a reason the partner will see. The money is returned to the program.

InputTypeNotes
commission_idstringcom_…
reasonstring, 1 to 500 charsShown 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.

InputTypeNotes
partner_handlestringThe partner's handle
amount_minorwhole number above 0Minor units: 2500 is 25.00
currencystring, 3 letters, optionalDefaults to the program's, or the sale's
sale_idstring, optionalsal_…, a sale of this partner's
customer_idstring, optionalcus_…
reasonstring, up to 500 charsKept 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.

InputTypeNotes
emailstringRequired
groupstringGroup name or slug; leave out for none
namestringIf 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.

InputTypeNotes
application_idstringapp_…

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.

InputTypeNotes
application_idstringapp_…
reasonstring, up to 1000 charsOptional; 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.

InputTypeNotes
risk_flag_idstringrsk_…
statusresolved or dismissedDefault resolved
notestring, 1 to 1000 charsWhat 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.

InputTypeNotes
thresholdsobjectNumber names to values, like {"velocity_per_hour": 10}. read_risk_settings lists every name and range
switched_offlist of check namesThe checks to switch off. Replaces the saved list
disposable_domainslist of domainsExtra 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.

InputTypeNotes
risk_flag_idstringrsk_… from list_risk_flags
notestring, up to 1000 charsOptional; 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.

InputTypeNotes
risk_flag_idstringrsk_…
notestring, up to 1000 charsOptional

set_risk_flag_status

Marks a flag as being reviewed, or reopens it. To close one, use resolve_risk_flag.

InputTypeNotes
risk_flag_idstringrsk_…
statusreviewing or openRequired
notestring, up to 1000 charsOptional

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.

InputTypeNotes
lead_idstringcus_… 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.

InputTypeNotes
lead_idstringcus_…
notestring, 1 to 1000 charsWhy, 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.

InputTypeNotes
commission_idstringcom_…
amount_minorinteger, 0 or moreThe new amount in minor units (cents or pence): 2500 is 25.00. Whole numbers only
reasonstring, 1 to 500 charsWhy 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.

InputTypeNotes
commission_idslist of com_…Re-run the sales behind these. Give this or since
sincedate, like 2026-08-01Re-run every sale from then on
untildateWith since: the last day to include. Default: now
partner_handlestringWith since: only this partner's sales
rulescurrent or snapshotcurrent 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.

InputTypeNotes
sale_idstringThe sale_id from list_unattributed_sales
partner_handlestringThe 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.

InputTypeNotes
ordered_rule_idslist 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.

InputTypeNotes
rule_idstringflw_… 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.

InputTypeNotes
folderstring or nullThe folder's name; null or leave out for the top level
ordered_resource_idslist 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.

InputTypeNotes
fromstringThe folder's current name
tostring, 1 to 60 charsThe 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.

Put a link on the partners' resources shelf. Files are uploaded in the dashboard, so this tool mints links only.

InputTypeNotes
titlestring, 1 to 120 charsRequired
urlstringThe http(s) address the shelf links to
folderstring, up to 60 charsLeave out for the top level
publishbooleanDefault 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.

InputTypeNotes
resource_idstringres_…
titlestring, 1 to 120 charsOptional
urlstringOptional, links only
folderstring or nullOptional; null moves it to the top level
publishedbooleanOptional

delete_resource

Take one resource off the shelf for good. A file's stored blob goes with it.

InputTypeNotes
resource_idstringres_…

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.

InputTypeNotes
urlstringhttps://… on a public address
event_typesstring[]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.

InputTypeNotes
endpoint_idstringwhe_…
urlstringOptional
event_typesstring[]Optional. Replaces the list. Empty means every event
enabledbooleanOptional. 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.

InputTypeNotes
endpoint_idstringwhe_…

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.

InputTypeNotes
endpoint_idstringwhe_…

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.

InputTypeNotes
endpoint_idstringwhe_…
event_typestringOptional, 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.

InputTypeNotes
delivery_idstringwhd_…

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.

InputTypeNotes
campaign_idstringcamp_…; 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.

InputTypeNotes
sequence_idstringseq_…

resume_sequence

Turn a paused sequence back on.

InputTypeNotes
sequence_idstringseq_…

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.

InputTypeDefault
templatethe template's keyrequired
languagetwo-letter code such as fren
subject, bodytextrequired

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.

InputTypeDefault
templatethe template's keyrequired
languagetwo-letter codeen

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.

InputTypeNotes
templatethe template's keyrequired
enabledbooleantrue 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.

InputTypeNotes
templatethe template's keyrequired
subject, bodytextoptional, 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.

InputTypeNotes
name, subject, bodytextrequired
audience_all, group_ids, tag_ids, partner_idsboolean and lists of idsthe audience
button_label, button_urltext and a linkoptional, 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.

InputTypeNotes
campaign_idcamp_…required
other inputsas for create_campaign_draftunchanged when left out
remove_buttonbooleantrue 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.

InputTypeNotes
campaign_idcamp_…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.

InputTypeNotes
partnerhandle or part_ idrequired

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.

InputTypeNotes
nametextrequired
triggerapproved, idle or first_commissionrequired
trigger_daysinteger, 1 to 365for idle only: the quiet days before it starts
stepslist of delay_days, subject, body1 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.

InputTypeNotes
sequence_idseq_…required
other inputsas for create_sequenceunchanged 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.

InputTypeNotes
sequence_idseq_…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.

InputTypeNotes
sequence_idseq_…required
partnerhandle or part_ idrequired

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.

InputTypeNotes
sequenceslist of name, trigger, trigger_days and steps, each as for create_sequence1 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_affiliates only 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 optional brand, 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.

InputTypeDefault
viewdiscover, saved or hiddendiscover
channelwebsite or youtubeboth
searcha name, domain or handlenone
limit1 to 5020
offseta number0
branda domain, name or brand idyour oldest brand

On a trial, Discover shows your best 50 matches, the same as the screen.

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.

InputTypeNotes
typetopic, competitor or lookalikewhat the seed is
seedstringa topic like "email marketing software", a competitor's site or @handle, or a YouTube channel
countrytwo letters, like GBtopic searches only
branda domain, name or brand idoptional; 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.

InputTypeNotes
seedslist of linksa 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_idslist of row idsoptional; pick creators from your own rows instead, ids from recruit_affiliates. Ten creators at most, pasted and picked together
branda domain, name or brand idoptional; 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.

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.

InputTypeNotes
seedslist of linksthe same creators you gave recruit_clone_profile
prospect_idslist of row idsoptional, as above
profileobjectthe 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
countrytwo letters, like GBrequired
branda domain, name or brand idoptional; 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.

InputTypeNotes
idslist of row idsfrom recruit_affiliates
branda domain, name or brand idoptional; 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.

InputTypeNotes
idrow idsave the row first
branda domain, name or brand idoptional; 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.

InputTypeNotes
idrow ida saved row
branda domain, name or brand idoptional; leave out for your oldest brand
termsobjectleave 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?

On this page

Setup toolssetup_guidepayment_connection_statusget_install_instructionscheck_installsearch_docsRead toolstop_partnerspending_commissionsidle_partnersrevenue_by_periodpartner_detailpayout_statusrules_summaryrecent_referralslist_partnerslist_customerslist_commissionslist_applicationsreportlist_risk_flagsread_risk_settingspreview_risk_settingslist_leadslist_unattributed_salespreview_commission_rulelist_resourceslist_webhook_endpointslist_webhook_deliverieslist_tagslist_groupslist_custom_fieldslist_domainslist_notificationsmessaging_statuslist_email_templatespreview_email_templatepreview_email_templatescampaign_audience_sizepreview_campaign_emailenrolment_logpreview_sequence_stepschema_introspectWrite toolsupdate_program_settingsupdate_brandingremove_sample_datacreate_commission_ruleupdate_commission_ruleset_rule_statuscreate_groupupdate_groupcreate_partner_linkcreate_couponcreate_customerupdate_customerdelete_customerupdate_partnerdelete_partnercreate_tagupdate_tagdelete_tagdelete_groupdelete_couponcreate_custom_fieldupdate_custom_fieldmove_custom_fielddelete_custom_fieldset_domainverify_domainremove_domaincreate_notificationupdate_notificationend_notificationdelete_notificationset_notification_centreapprove_commissionreject_commissioncreate_commissioninvite_partnerapprove_applicationreject_applicationresolve_risk_flagsave_risk_settingsrun_risk_checkssuspend_flagged_partnerreject_flagged_commissionsset_risk_flag_statusapprove_leaddecline_leadedit_commission_amountretry_commissionsattribute_missed_salereorder_commission_rulesdelete_commission_rulereorder_resourcesrename_resource_folderadd_sample_datacreate_resource_linkupdate_resourcedelete_resourcecreate_webhook_endpointupdate_webhook_endpointdelete_webhook_endpointrotate_webhook_secretping_webhook_endpointreplay_webhook_deliverysend_campaignpause_sequenceresume_sequencesave_email_templatereset_email_templateset_email_template_enabledsend_test_emailcreate_campaign_draftupdate_campaign_draftdelete_campaignmark_email_address_validcreate_sequenceupdate_sequencedelete_sequencestop_sequence_enrolmentturn_on_activation_emailscreate_sequencesRecruitAffiliates.ai toolsrecruit_affiliatesrecruit_searchrecruit_clone_profilerecruit_clone_searchrecruit_saverecruit_find_emailrecruit_dealResourcesprogram://currentcatalog://events