---
id: "brand/settings"
type: "doc"
url: "https://affitor.com/docs/brand/settings"
kind: "guide"
updated: "2026-11-09"
---
# 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.

Everything you configured in the [setup wizard](/docs/brand/quickstart/setup-program) stays editable after launch, and Settings also hold the API key that every server-side [tracking call](/docs/api-reference/overview) 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.

<PageMeta
  items={[
    { label: 'Who this is for', value: 'Advertisers and agent developers' },
    { label: 'Time required', value: '5 minutes' },
    { label: 'Prerequisites', value: 'An affiliate program created in the setup wizard. Creating or rotating an API key also needs owner or admin access to that program.' },
    { label: 'Outcome', value: '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](/docs/brand/program-menu.png)

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

| Page | What you edit there |
|---------|--------------------|
| **Business** | One 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 |
| **Commission** | Commission type, rate and duration, attribution window and hold period |
| **Tracking** | Click and signup (lead) tracking on your website, and the **Partner link parameter** (`?via=` or `?aff=`) |
| **Partner links** | [Allowed domains and pages, and an additional-link limit per partner](/docs/brand/partner-links) |
| **Payments** | How 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:

| Group | Item | What it is |
|---------|------|------------|
| **Team** | **Members** | Who can work on the program, and their [team roles](/docs/brand/team-roles) |
| **Billing** | **Billing** | Platform-fee invoices |
| **Developers** | **API keys** | The program's secret keys for server-side tracking calls |
| **Developers** | **AI agents** | Connect Claude, Cursor and other AI tools to Affitor over [MCP](/docs/api-reference/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](/docs/partners/quickstart/get-your-referral-link#refer-a-brand-to-affitor)), 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.

:::tip

The **Commission** page sets your program-wide default. To pay different rates to different sets of partners, [organize partners into groups](/docs/brand/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:

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

:::note

To have an AI coding agent install tracking for you, point it at [skill.md](https://affitor.com/docs/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`](/docs/brand/cli/commands#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.

:::caution

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`:

```bash
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:

```json
{
  "success": true,
  "message": "Test sale event tracked successfully",
  "data": {
    "eventId": 789,
    "programId": 1,
    "test_mode": true
  }
}
```

<VerifySuccess
  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",
  ]}
  ifNotWorking={[
    "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](/docs/api-reference/errors) for every `401` cause and fix",
  ]}
/>

## Next steps

<FeatureCards>
  <FeatureCard icon="book" title="API Reference" href="/docs/api-reference/overview">Base URL, auth modes, and every tracking endpoint your key unlocks.</FeatureCard>
  <FeatureCard icon="zap" title="3-Step Integration Guide" href="/docs/brand/tracking/quickstart-integration">Put the key to work: get clicks, signups, and sales tracking live end to end.</FeatureCard>
  <FeatureCard icon="code" title="CLI Quickstart" href="/docs/brand/cli/quickstart">Hand the one-line instruction to an AI coding agent and let it wire up tracking for you.</FeatureCard>
</FeatureCards>
