> ## Documentation Index
> Fetch the complete documentation index at: https://referly.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Affiliates and referral links

> Use the affiliateLinks array as the source of truth for an affiliate's referral links. The legacy link property is deprecated.

Affiliate objects returned by the Affiliates API (for example **Get Affiliate(s)** and **Create an Affiliate**) include an **`affiliateLinks`** array: one entry per referral link slug for that affiliate, each with `id`, `link`, timestamps, and related IDs.

<Warning>
  The legacy **`link`** property on the affiliate object is **deprecated** and may be `null`. Use
  **`affiliateLinks`** (and the [Links](/api-reference/links/get) endpoints to manage links) as the
  source of truth.
</Warning>

* **Create affiliate** (`POST /affiliates`): optional body field **`affiliateLink`** sets the slug of the initial link; if omitted, a slug is generated.
* **Update affiliate** (`PUT /affiliates`): optional **`affiliateLink`** **adds** a new link; it does not remove or replace existing `affiliateLinks`.

<Columns cols={2}>
  <Card title="Affiliate endpoints" icon="users" href="/api-reference/affiliates/get">
    Create, read, update, and delete affiliates.
  </Card>

  <Card title="Link endpoints" icon="link" href="/api-reference/links/get">
    Manage an affiliate's referral links.
  </Card>
</Columns>
