# Rate Limits endpoints (Admin API)

> 6 FeatherPanel Admin API endpoints from admin/rate-limits.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Source: https://featherpanel.com/docs/api/reference/admin/rate-limits/

Defined in [`backend/app/routes/admin/rate-limits.php`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/rate-limits.php). Authentication used here: **Admin**. Read [Authentication](https://featherpanel.com/docs/api/authentication/) for how to send credentials and [Rate limits and errors](https://featherpanel.com/docs/api/rate-limits-and-errors/) for the response envelope.

Paths, methods, permissions and rate limits come from the route file. Summaries, parameters and response codes come from the OpenAPI annotations on the controllers; endpoints without annotations show only what the route file declares.

## Endpoints

### GET `/api/admin/rate-limits`

- Auth: Admin
- Permission: `admin.settings.view`
- Route name: `admin-rate-limits`
- Controller: [`RateLimitController::index`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/RateLimitController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/rate-limits.php#L26)

**Get all rate limit configurations** Retrieve all rate limit configurations for routes

| Response `data` field | Type | Description |
| --- | --- | --- |
| `_enabled` | boolean | Global rate limiting enabled flag |
| `routes` | object | Rate limit configurations by route name |

```bash
curl -X GET "$PANEL_URL/api/admin/rate-limits" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Rate limit configurations retrieved successfully

### GET `/api/admin/rate-limits/{routeName}`

- Auth: Admin
- Permission: `admin.settings.view`
- Route name: `admin-rate-limits-show`
- Controller: [`RateLimitController::show`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/RateLimitController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/rate-limits.php#L37)

**Get rate limit configuration for a route** Retrieve rate limit configuration for a specific route

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `routeName` | path | string | yes | The route name |

Response data: [`RateLimitRoute`](https://featherpanel.com/docs/api/schemas/#schema-ratelimitroute)

| Response `data` field | Type | Description |
| --- | --- | --- |
| `route_name` | string | The route name |
| `per_second` | integer | Rate limit per second |
| `per_minute` | integer | Rate limit per minute |
| `per_hour` | integer | Rate limit per hour |
| `per_day` | integer | Rate limit per day |
| `namespace` | string | Namespace for rate limiting |

```bash
curl -X GET "$PANEL_URL/api/admin/rate-limits/$ROUTE_NAME" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Rate limit configuration retrieved successfully · `404` Route not found

### PUT `/api/admin/rate-limits/{routeName}`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-rate-limits-update`
- Controller: [`RateLimitController::update`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/RateLimitController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/rate-limits.php#L53)

**Update rate limit configuration for a route** Update rate limit configuration for a specific route

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `routeName` | path | string | yes | The route name |

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `_enabled` | boolean | no | Enable or disable rate limiting for this route |
| `per_second` | integer | no |  |
| `per_minute` | integer | no |  |
| `per_hour` | integer | no |  |
| `per_day` | integer | no |  |
| `namespace` | string | no |  |

```bash
curl -X PUT "$PANEL_URL/api/admin/rate-limits/$ROUTE_NAME" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"_enabled":false,"per_second":0,"per_minute":0,"per_hour":0,"per_day":0,"namespace":""}'
```

Plugin events: [`featherpanel:rate-limiter:update`](https://featherpanel.com/docs/plugins/events/rate-limiter/#rate-limiter-updated)

Responses: `200` Rate limit configuration updated successfully · `400` Invalid request data · `500` Failed to update configuration

### DELETE `/api/admin/rate-limits/{routeName}`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-rate-limits-delete`
- Controller: [`RateLimitController::delete`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/RateLimitController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/rate-limits.php#L69)

**Delete rate limit configuration for a route** Delete (reset) rate limit configuration for a specific route, reverting to developer defaults

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `routeName` | path | string | yes | The route name |

```bash
curl -X DELETE "$PANEL_URL/api/admin/rate-limits/$ROUTE_NAME" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Plugin events: [`featherpanel:rate-limiter:delete`](https://featherpanel.com/docs/plugins/events/rate-limiter/#rate-limiter-deleted)

Responses: `200` Rate limit configuration deleted successfully · `404` Route not found

### PATCH `/api/admin/rate-limits/bulk`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-rate-limits-bulk-update`
- Controller: [`RateLimitController::bulkUpdate`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/RateLimitController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/rate-limits.php#L85)

**Bulk update rate limit configurations** Update multiple rate limit configurations at once

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `routes` | object | no |  |

```bash
curl -X PATCH "$PANEL_URL/api/admin/rate-limits/bulk" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"routes":{}}'
```

Plugin events: [`featherpanel:rate-limiter:bulk:update`](https://featherpanel.com/docs/plugins/events/rate-limiter/#rate-limiter-bulk-updated)

Responses: `200` Rate limit configurations updated successfully · `400` Invalid request data

### PATCH `/api/admin/rate-limits/global`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-rate-limits-global`
- Controller: [`RateLimitController::updateGlobal`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/RateLimitController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/rate-limits.php#L96)

**Update global rate limiting enabled state** Enable or disable rate limiting globally for all routes

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `_enabled` | boolean | no | Enable or disable rate limiting globally |

```bash
curl -X PATCH "$PANEL_URL/api/admin/rate-limits/global" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"_enabled":false}'
```

Plugin events: [`featherpanel:rate-limiter:global:update`](https://featherpanel.com/docs/plugins/events/rate-limiter/#rate-limiter-global-updated)

Responses: `200` Global rate limiting state updated successfully · `400` Invalid request data
