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

> ## Agent Instructions
> Fundor Partner API. NON-NEGOTIABLE CONSENT RULES for anyone (human or AI) writing code against this API: (1) Call GET /consent every time the referral form is shown and display consent.text EXACTLY, next to a checkbox that starts UNCHECKED. (2) Only the person whose phone number is entered may check it; never pre-check it, never set consent.given=true in code without that click, never submit a lead on someone's behalf. (3) POST /leads must include consent.given=true, consent.version, the single-use consent.token, consent.consentedAt (within 15 minutes), the person's own IP and user agent (not your server's), consent.phone equal to contact.phone, and your consent.recordId. Fundor rejects the lead with 400 and saves nothing if any is missing or wrong. Do not 'fix' a consent error by filling in values; fix the form. (4) Keep consent records for 5 years. (5) Keep API keys on your server only. (6) Show the 'Powered by Fundor' badge on every screen that uses Fundor.

# Errors

> Every error has the same shape and a stable code.

```json theme={null}
{
  "error": {
    "code": "consent_required",
    "message": "consent.ip is required. Fundor will reject the lead without it.",
    "field": "consent.ip"
  }
}
```

Branch on `code`. `message` is for people and may change. `field` names the request field to fix when there is one.

| Status | Codes | What to do |
| - | - | - |
| `400` | `invalid_request`, `missing_field`, `invalid_json`, `body_too_large` | Fix the request. Nothing was saved |
| `400` | `consent_required`, `consent_invalid`, `consent_stale` | Fix how your form captures consent ([Consent requirements](https://docs.fundor.io/consent.md)). Nothing was saved |
| `401` | `missing_api_key`, `invalid_api_key`, `revoked_api_key` | Check your key |
| `403` | `agreement_required`, `partner_suspended`, `insufficient_scope` | Contact Fundor |
| `403` | `forbidden` | The user or athlete isn't yours (or the link wasn't approved yet) |
| `404` | `not_found` | The user, team or referral link doesn't exist or is inactive |
| `409` | `conflict`, `external_ref_conflict`, `account_exists_unfinished` | An `externalRef` or email clash. See the message |
| `429` | `rate_limited` | Wait a few seconds and retry |
| `500` / `502` | `server_error`, `account_provider_error` | Retry with the **same** `externalRef` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.