# Sessions endpoints (Client API: account)

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

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

Defined in [`backend/app/routes/user/sessions.php`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/sessions.php). Authentication used here: **Signed-in user**. 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/user/sessions`

- Auth: Signed-in user
- Default rate limit: 60 / minute (`user-session`)
- Route name: `user-sessions-list`
- Controller: [`SessionsController::index`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/User/SessionsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/sessions.php#L25)

**List active sessions**

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

Responses: `200` Active sessions

### POST `/api/user/sessions/revoke-others`

- Auth: Signed-in user
- Default rate limit: 10 / minute (`user-session`)
- Route name: `user-sessions-revoke-others`
- Controller: [`SessionsController::revokeOthers`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/User/SessionsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/sessions.php#L37)

**Sign out every other session**

```bash
curl -X POST "$PANEL_URL/api/user/sessions/revoke-others" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Other sessions revoked

### DELETE `/api/user/sessions/{id}`

- Auth: Signed-in user
- Default rate limit: 30 / minute (`user-session`)
- Route name: `user-sessions-revoke`
- Controller: [`SessionsController::revoke`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/User/SessionsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/sessions.php#L49)

**Sign out one session**

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes |  |

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

Responses: `200` Session revoked
