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

# API Introduction

> Build powerful integrations with the Affonso REST API

## Welcome to the Affonso API

The Affonso API allows you to programmatically manage your affiliate program. You can create affiliates, track referrals, send server-side tracking events for conversions and milestones, manage commissions, and process payouts.

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/api/authentication">
    Learn how to authenticate your API requests
  </Card>

  <Card title="Rate Limits" icon="gauge" href="/api/rate-limits">
    Understand API rate limits and best practices
  </Card>
</CardGroup>

<Info>
  To keep the hosted pixel or embedded dashboard more reliable when ad blockers
  or privacy tools are present, see
  <a href="/api/proxy-setup"> Proxy Setup (Optional)</a>.
</Info>

## Base URL

All API requests should be made to:

```
https://api.affonso.io/v1
```

## Available Resources

| Resource                                                  | Description                                                                |
| --------------------------------------------------------- | -------------------------------------------------------------------------- |
| [Affiliates](/api-reference/endpoint/affiliates/list)     | Manage your affiliate users                                                |
| [Referrals](/api-reference/endpoint/referrals/list)       | Track referrals and conversions                                            |
| [Clicks](/api-reference/endpoint/clicks/create)           | Record click events                                                        |
| [Conversions](/api-reference/endpoint/conversions/create) | Send backend purchases and let Affonso calculate commissions automatically |
| [Events](/api-reference/endpoint/events/create)           | Send normalized conversion, lead, trial, and milestone events              |
| [Commissions](/api-reference/endpoint/commissions/list)   | Manage commission transactions                                             |
| [Payouts](/api-reference/endpoint/payouts/list)           | Process affiliate payouts                                                  |
| [Embed](/api-reference/endpoint/embed/create-token)       | Generate tokens for embedded dashboards                                    |

## Partnership Status

The `partnershipStatus` field indicates the relationship status between an affiliate and a program:

* **`APPROVED`** - Affiliate is active and can promote the program
* **`PENDING`** - Affiliate applied but hasn't been approved yet
* **`REJECTED`** - Affiliate application was rejected
* **`null`** - No partnership exists (affiliate hasn't completed onboarding)

**Note:** `partnershipStatus` can be `null` for affiliates who haven't completed their onboarding process yet. The status is only set after the affiliate applies to and gets approved/rejected for a specific program.

## Response Format

All responses are returned in JSON format with the following structure:

```json Success Response theme={null}
{
  "success": true,
  "data": [...],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 100,
    "totalPages": 2,
    "hasNextPage": true,
    "hasPrevPage": false
  }
}
```

```json Error Response theme={null}
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid email format"
  }
}
```

## Need Help?

<Card title="Support" icon="envelope" href="mailto:support@affonso.io">
  Contact our support team for API assistance
</Card>
