# User Sessions endpoints (Admin API)

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

Source: https://featherpanel.com/docs/api/reference/admin/user-sessions/

Defined in [`backend/app/routes/admin/user-sessions.php`](https://github.com/MythicalLTD/FeatherPanel/blob/3faf369c3b4b626654434921a2ee2655ff85da45/backend/app/routes/admin/user-sessions.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/users/{uuid}/sessions`

- Auth: Admin
- Permission: `admin.users.list`
- Route name: `admin-user-sessions`
- Controller: [`UserSessionsController::index`](https://github.com/MythicalLTD/FeatherPanel/blob/3faf369c3b4b626654434921a2ee2655ff85da45/backend/app/Controllers/Admin/UserSessionsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/3faf369c3b4b626654434921a2ee2655ff85da45/backend/app/routes/admin/user-sessions.php#L26)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | \- | yes |  |

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

### POST `/api/admin/users/{uuid}/sessions/revoke-all`

- Auth: Admin
- Permission: `admin.users.edit`
- Route name: `admin-user-sessions-revoke-all`
- Controller: [`UserSessionsController::revokeAll`](https://github.com/MythicalLTD/FeatherPanel/blob/3faf369c3b4b626654434921a2ee2655ff85da45/backend/app/Controllers/Admin/UserSessionsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/3faf369c3b4b626654434921a2ee2655ff85da45/backend/app/routes/admin/user-sessions.php#L37)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | \- | yes |  |

```bash
curl -X POST "$PANEL_URL/api/admin/users/$UUID/sessions/revoke-all" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

### DELETE `/api/admin/users/{uuid}/sessions/{id}`

- Auth: Admin
- Permission: `admin.users.edit`
- Route name: `admin-user-session-revoke`
- Controller: [`UserSessionsController::revoke`](https://github.com/MythicalLTD/FeatherPanel/blob/3faf369c3b4b626654434921a2ee2655ff85da45/backend/app/Controllers/Admin/UserSessionsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/3faf369c3b4b626654434921a2ee2655ff85da45/backend/app/routes/admin/user-sessions.php#L48)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | \- | yes |  |
| `id` | path | \- | yes |  |

```bash
curl -X DELETE "$PANEL_URL/api/admin/users/$UUID/sessions/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```
