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

# Create Tier

> Create a new rate limit tier (admin only)

## Authentication

<ParamField header="Authorization" type="string" required>
  Bearer token: `Bearer <admin_token>`
</ParamField>

## Request Body

<ParamField body="tier" type="string" required>
  Tier name (e.g., "client", "server", "premium")
</ParamField>

<ParamField body="allowed_limit" type="integer" required>
  Maximum requests allowed per window
</ParamField>

<ParamField body="window_seconds" type="integer" required>
  Time window in seconds
</ParamField>

<ParamField body="is_active" type="boolean" default="false">
  Whether this tier is active
</ParamField>

### Example Request

```bash theme={null}
curl -X POST https://api.sari-platform.com/api/rate-limits/tiers \
  -H "Authorization: Bearer <admin_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "tier": "premium",
    "allowed_limit": 5000,
    "window_seconds": 3600,
    "is_active": true
  }'
```

## Response

```json theme={null}
{
  "tier": "premium",
  "allowed_limit": 5000,
  "window_seconds": 3600,
  "is_active": true,
  "created_at": "2024-01-15T10:00:00Z"
}
```

<Note>
  Only one tier of each name can be active at a time. Activating a new tier may deactivate existing ones.
</Note>

## Errors

| Status | Description              |
| ------ | ------------------------ |
| 400    | Invalid request body     |
| 401    | Invalid or expired token |
| 403    | Admin access required    |
| 409    | Tier already exists      |
