# Power endpoints (Client API: game servers)

> 1 FeatherPanel Client API: game servers endpoint from user/server/power.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Source: https://featherpanel.com/docs/api/reference/user/server/power/

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

### POST `/api/user/servers/{uuidShort}/power/{action}`

- Auth: Server access
- Default rate limit: 2 / minute (`user-server-power`)
- Route name: `session-server-power`
- Controller: [`ServerPowerController::sendPowerAction`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/Power/ServerPowerController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/power.php#L27)

**Send power action to server** Send a power action (start, stop, restart, kill) to a server through the Wings daemon.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | string | yes | Server short UUID |
| `action` | path | string | yes | Power action to perform |

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

| Response `data` field | Type | Description |
| --- | --- | --- |
| `response` | object | Response from Wings daemon |

```bash
curl -X POST "$PANEL_URL/api/user/servers/$UUID_SHORT/power/$ACTION" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Plugin events: [`featherpanel:server:power:action`](https://featherpanel.com/docs/plugins/events/server/#server-power-action)

Responses: `200` Power action sent successfully · `400` Bad request - Invalid server configuration or invalid power action · `401` Unauthorized - User not authenticated or Wings daemon unauthorized · `403` Forbidden - Access denied to server or Wings daemon · `404` Not found - Server or node not found · `422` Unprocessable entity - Invalid server data · `500` Internal server error - Failed to send power action
