Settings and keys

Manage program settings and your API key

Edit your program's terms after launch, and create or rotate the per-program API keys that authenticate your tracking integration.

View as Markdown

Everything you configured in the setup wizard stays editable after launch, and Settings also hold the API key that every server-side tracking call authenticates with. This guide shows where each setting lives, how to change terms safely, and how to rotate the key with the shortest possible gap in tracking.

Who this is for
Advertisers and agent developers
Time required
5 minutes
Prerequisites
An affiliate program created in the setup wizard. Creating or rotating an API key also needs owner or admin access to that program.
Outcome
You can change program terms after launch, and rotate your API key knowing exactly when the old one stops working

What lives in Settings

Settings belong to the program selected in the program menu. Open the program menu (your program's name at the top of the left menu, or in the top bar on smaller screens) and choose Program settings. The same menu also has Members and Billing. Everything on the Settings pages applies to that program.

The program menu, opened from the program name at the top left: the current program with Program settings, Members and Billing, and beside it your programs with their status and Create program

Program settings include the setup pages and Partner links, which controls the destinations and number of additional links partners can create:

PageWhat you edit there
BusinessOne card per field, each with its own Save: Business name, Website, Program URL (your public page), Program ID (read-only, with Copy), Logo, Tagline, About, Terms of Service and Resources. Saving a website suggests a logo, tagline and About for you to review
CommissionCommission type, rate and duration, attribution window and hold period
TrackingClick and signup (lead) tracking on your website, and the Partner link parameter (?via= or ?aff=)
Partner linksAllowed domains and pages, and an additional-link limit per partner
PaymentsHow sales are counted: two cards, Stripe and Server API, each with its own state. Either one is enough
Go live (Status once the program is live)What the program still needs to go live, its live state, and how new partners join (Auto-approve or Manual review)

The rest of the Settings menu:

GroupItemWhat it is
TeamMembersWho can work on the program, and their team roles
BillingBillingPlatform-fee invoices
DevelopersAPI keysThe program's secret keys for server-side tracking calls
DevelopersAI agentsConnect Claude, Cursor and other AI tools to Affitor over MCP with Connect an AI tool. Access is read-only, and the Connections list shows each connected tool

Your own settings are not part of a program. To change your profile, sign-in or payout details, click your name at the bottom of the left menu to open the account menu, then the gear for Your account: it has Profile, Login and security and Payouts. Refer a brand, your link for referring brands to Affitor (how it works), is a row in the same menu.

Step 1: Edit program terms after launch

Programs evolve — rates get adjusted, branding gets refreshed, approval policies tighten or loosen. None of this requires recreating the program.

  1. In the program menu, choose Program settings.
  2. Open the page you want to change: Commission for the rate and hold period, Go live (Status once live) for how new partners join, or Business for the business name, website, logo and branding.
  3. Make the change and save. On Commission, once terms are saved, select Set new terms before you change them.
Info

The Commission page sets your program-wide default. To pay different rates to different sets of partners, organize partners into groups — each group carries its own commission policy.

Step 2: Find your API key

Every server-side call to the tracking API (sales, refunds, and server-mode leads) authenticates with a Bearer token that is unique to your program. Integrations, SDKs, the CLI's tracking setup, and AI coding agents all authenticate with a program API key. CLI commands that create or list programs act as your account instead, and authenticate with your CLI login.

  1. In the program menu, choose Program settings.
  2. Under Developers, select API keys.

The dashboard shows each key only as a short hint in the Key column, and no read returns the full value. A key is shown once, in Copy your key, right after an owner or admin selects Create key or Rotate key. If you no longer have a key stored anywhere, you can't recover it from the dashboard; rotate it instead (Step 3).

Store the key as a server-side environment variable:

# .env — server-side only. Never ship this key to the browser.
AFFITOR_API_KEY=YOUR_PROGRAM_API_KEY
Info

To have an AI coding agent install tracking for you, point it at skill.md with your program ID (on the Business page) and keep the key in AFFITOR_API_KEY. From a terminal, npx affitor onboard uses the same key to wire in the tracking it can and verify it: see affitor onboard.

Step 3: Rotate the key

Rotate the key if it may have leaked, if it was committed to a repository, or as routine hygiene when a team member with key access leaves.

Only an owner or admin of the program can rotate a key. Other members do not see the keys table, so ask an owner or admin to rotate it and to hand you the new value through your secret manager.

Warning

Rotating never overlaps the two keys. Rotate key stops the old key at once, and you receive the new value only in Copy your key, so you cannot deploy it in advance. Between the rotation and the redeploy, every integration still sending the old key gets 401 responses. Copy the new value before you close Copy your key: it is shown one time only.

  1. Line up every place AFFITOR_API_KEY is stored — deployment environment, secret manager, CI — so you can update them straight away.
  2. In Program settings › Developers › API keys, open the ⋯ menu on the key's row, select Rotate key, then confirm with Rotate key. The old key stops working at that moment.
  3. Select Copy in Copy your key, update those places, and redeploy.

Verify it worked

Send a test-mode sale with the new key. It authenticates exactly like a real sale but creates no commission and no platform fee.

Request — POST /api/v1/track/sale:

curl -X POST https://api.affitor.com/api/v1/track/sale \
  -H "Authorization: Bearer YOUR_PROGRAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "additional_data": { "test_mode": true },
    "amount_cents": 9999,
    "currency": "USD",
    "sale_type": "payment"
  }'

Expected response:

{
  "success": true,
  "message": "Test sale event tracked successfully",
  "data": {
    "eventId": 789,
    "programId": 1,
    "test_mode": true
  }
}
Verify success
Network
  • POST /api/v1/track/sale with the new key returns 200 and "success": true — the key authenticates
  • If you rotated, the same request with the old key now returns 401: rotation is complete
Dashboard
  • The test event appears under your program's tracking events, flagged as a test — no commission is created
If it doesn't work
  • On a 401, read error.code first. api_key_rotation_required means the key passed its rotation deadline: rotate it and deploy the new value, because copying the same key again will not bring it back. Other 401 responses can also mean the key is disabled: ask an owner or admin to check its status and select Enable key if it should be active. Otherwise, check the Authorization: Bearer header, your environment variable, and the full value stored in your secret manager. If you no longer hold that value, ask an owner or admin to rotate the key (Step 3), copy it from Copy your key, then update and redeploy
  • See the error reference for every 401 cause and fix

Next steps

On this page

Share feedback

Tell us what is missing or unclear on “Manage program settings and your API key”.