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

# Reseller account API

> Use Floodgate's reseller account API to apply for access, check approval, read account cooldowns, and list customer restrictions and violations.

Use the Floodgate reseller account API to check enrollment and read restrictions for your own customers. These endpoints use account authentication. Send customer model requests separately with a model API key and the customer header described in the [reseller guide](https://docs.floodgate.dev/reseller-program.md).

## Authentication and access

Use `https://floodgate.dev` as the host. Create a Personal Access Token in Profile and send it as `Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN`. Dashboard authentication also works.

Enrollment endpoints are available before approval. The status, customer, and violation endpoints require an approved enrollment. Otherwise they return HTTP 403 with `success: false` and the message `Approved reseller access is required`.

Every endpoint uses your authenticated account. There is no parameter for reading another reseller's data. Responses use the account API envelope with `success`, `message`, and `data`. Check `success` as well as the HTTP status.

| Method | Path | Purpose |
| - | - | - |
| GET | `/api/reseller/enrollment` | Read your application status |
| POST | `/api/reseller/enrollment` | Apply or reapply after rejection |
| GET | `/api/reseller/status` | Read account cooldown and restriction totals |
| GET | `/api/reseller/customers` | List customer restriction records |
| GET | `/api/reseller/violations` | List customer violation records |

## Read enrollment

```bash theme={null}
curl "https://floodgate.dev/api/reseller/enrollment" \
  -H "Authorization: Bearer $FLOODGATE_ACCESS_TOKEN"
```

When you have not applied, `data` contains `{"status":"none"}`. An existing application returns:

| Field under `data` | Meaning |
| - | - |
| `status` | `pending`, `approved`, `rejected`, or `revoked` |
| `use_case` | The service description you submitted |
| `expected_customers` | Your expected customer count |
| `contract_accepted_at` | When you accepted the customer ID contract, in Unix seconds |
| `created_at` | Application creation time, in Unix seconds |
| `review_note` | The rejection note when rejected; otherwise an empty string |

## Apply for access

Send a JSON body to `POST /api/reseller/enrollment`:

| Field | Requirement |
| - | - |
| `use_case` | A service description of 10 to 2,000 characters after trimming whitespace |
| `expected_customers` | An integer from 1 to 1,000,000 |
| `contract_accepted` | Must be `true` |

```bash theme={null}
curl "https://floodgate.dev/api/reseller/enrollment" \
  -H "Authorization: Bearer $FLOODGATE_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "use_case": "A coding assistant service for our customers.",
    "expected_customers": 100,
    "contract_accepted": true
  }'
```

Accepting the contract means you will use stable customer IDs without personal data and will not change IDs to evade restrictions. Do not include personal data in the application.

A successful submission has `success: true` and `data: null`. Your status becomes `pending`. Only administrator approval enables reseller behavior. You can resubmit after rejection. Pending or approved applications cannot be resubmitted, and revoked accounts must contact support.

## Read account status

```bash theme={null}
curl "https://floodgate.dev/api/reseller/status" \
  -H "Authorization: Bearer $FLOODGATE_ACCESS_TOKEN"
```

| Field under `data` | Meaning |
| - | - |
| `cooldown_active` | Whether an account cooldown is active |
| `expires_at` | Active cooldown expiry in Unix seconds; zero when no cooldown is active |
| `server_time` | Current server time in Unix seconds |
| `account_limit` | Current refusal threshold for starting an account cooldown |
| `restricted_customers` | Number of distinct customers with an active restriction |

The response also includes your qualifying model refusal count in the configured account window. That window defaults to one hour, and the count combines customers and keys. An account cooldown expiry does not report or lift a shared Standard pause.

## List restrictions

`GET /api/reseller/customers` returns restriction records, not a registry of every customer. A customer can have multiple history records.

```bash theme={null}
curl "https://floodgate.dev/api/reseller/customers?customer_id=customer_42&active=true&page=1&page_size=25" \
  -H "Authorization: Bearer $FLOODGATE_ACCESS_TOKEN"
```

| Query parameter | Behavior |
| - | - |
| `customer_id` | Optional exact, case-sensitive filter. Uses the same format as the customer header. |
| `active` | Set to `true` for restrictions that have started, have not expired, and have not been lifted. Omit it for history. |
| `page` | Page number, from 1 to 1,000,000. Default 1. |
| `page_size` | Records per page, from 1 to 100. Default 25. |

The response's `data` contains `items`, `total`, `page`, `page_size`, and `server_time`. Items are ordered newest first.

| Field in each item | Meaning |
| - | - |
| `id` | Restriction record ID |
| `user_id` | Your Floodgate account ID |
| `customer_id` | Your customer reference |
| `source` | The recorded violation source |
| `reason_code` | The restriction reason |
| `level` | Restriction level, from 1 to 4 |
| `starts_at` | Restriction start time, in Unix seconds |
| `expires_at` | Restriction expiry, in Unix seconds |
| `lifted_at` | Administrator lift time in Unix seconds, or zero |
| `created_at` | Record creation time, in Unix seconds |

Use `active=true` to ask the server for current restrictions. Expired or lifted records remain in history. The API does not let resellers lift restrictions.

## List violations

`GET /api/reseller/violations` accepts `customer_id`, `page`, and `page_size` with the same rules as the restriction endpoint. It does not have an active-only filter.

```bash theme={null}
curl "https://floodgate.dev/api/reseller/violations?customer_id=customer_42&page=1&page_size=25" \
  -H "Authorization: Bearer $FLOODGATE_ACCESS_TOKEN"
```

The response's `data` contains `items`, `total`, `page`, and `page_size`. Each item includes `id`, `user_id`, `customer_id`, `source`, `model`, `request_id`, and `created_at`. Times use Unix seconds. Items are ordered newest first.

Use the request ID and customer reference when asking support to review an event. Keep your Personal Access Token and model API key private.

See the [reseller guide](https://docs.floodgate.dev/reseller-program.md#handle-errors) for model request errors, expiry rules, and retry handling.


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