# Subusers endpoints (Client API: game servers)

> 9 FeatherPanel Client API: game servers endpoints from user/server/subusers.php: methods, paths, auth, permissions, rate limits, parameters and responses.

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

Defined in [`backend/app/routes/user/server/subusers.php`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subusers.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

### GET `/api/user/servers/{uuidShort}/subusers`

- Auth: Server access
- Route name: `session-server-subusers`
- Controller: [`SubuserController::getSubusers`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/SubuserController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subusers.php#L27)

**Get server subusers** Retrieve all subusers for a specific server that the user owns or has subuser access to.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | string | yes | Server short UUID |
| `page` | query | integer | no | Page number for pagination |
| `per_page` | query | integer | no | Number of records per page |
| `search` | query | string | no | Search term to filter subusers by username or email |

| Response `data` field | Type | Description |
| --- | --- | --- |
| `data` | SubuserWithDetails\[\] |  |
| `pagination` | SubuserPagination |  |

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

Responses: `200` Server subusers retrieved successfully · `400` Bad request - Missing or invalid UUID short · `401` Unauthorized - User not authenticated · `403` Forbidden - Access denied to server · `404` Not found - Server not found · `500` Internal server error - Failed to retrieve subusers

### POST `/api/user/servers/{uuidShort}/subusers`

- Auth: Server access
- Route name: `session-server-create-subuser`
- Controller: [`SubuserController::createSubuser`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/SubuserController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subusers.php#L49)

**Create subuser** Create a new subuser for a server by email address. The user must exist in the system and not already be a subuser for this server.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | string | yes | Server short UUID |

Request body: [`SubuserCreateRequest`](https://featherpanel.com/docs/api/schemas/#schema-subusercreaterequest) (application/json) · Response data: [`SubuserWithDetails`](https://featherpanel.com/docs/api/schemas/#schema-subuserwithdetails)

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | string (email) | yes | Email address of user to add as subuser |

| Response `data` field | Type | Description |
| --- | --- | --- |
| `id` | integer | Subuser ID |
| `user_id` | integer | User ID |
| `server_id` | integer | Server ID |
| `permissions` | string\[\] | Array of permission strings |
| `created_at` | string (date-time) | Creation timestamp |
| `updated_at` | string (date-time) | Last update timestamp |
| `username` | string | User username |
| `email` | string (email) | User email |
| `first_name` | string | User first name |
| `last_name` | string | User last name |
| `uuid` | string | User UUID |

```bash
curl -X POST "$PANEL_URL/api/user/servers/$UUID_SHORT/subusers" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"email":""}'
```

Plugin events: [`featherpanel:user:server:subuser:created`](https://featherpanel.com/docs/plugins/events/server/#server-subuser-created)

Responses: `201` Subuser created successfully · `400` Bad request - Missing required fields, invalid email format, user not found, cannot add self, or subuser already exists · `401` Unauthorized - User not authenticated · `403` Forbidden - Access denied to server · `404` Not found - Server or user not found · `500` Internal server error - Failed to create subuser

### GET `/api/user/servers/{uuidShort}/subusers/permissions`

- Auth: Server access
- Route name: `session-server-get-valid-permissions`
- Controller: [`SubuserController::getValidPermissions`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/SubuserController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subusers.php#L71)

**Get valid permissions** Retrieve the list of valid permissions that can be assigned to subusers.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | string | yes | Server short UUID |

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

| Response `data` field | Type | Description |
| --- | --- | --- |
| `permissions` | string\[\] | Array of available permissions |
| `total` | integer | Total number of permissions |

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

Responses: `200` Valid permissions retrieved successfully · `400` Bad request - Missing or invalid UUID short · `401` Unauthorized - User not authenticated · `403` Forbidden - Access denied to server · `404` Not found - Server not found · `500` Internal server error - Failed to retrieve permissions

### GET `/api/user/servers/{uuidShort}/subusers/details`

- Auth: Server access
- Default rate limit: 30 / minute (`user-server-subusers`)
- Route name: `session-server-get-subusers-details`
- Controller: [`SubuserController::getSubusersWithDetails`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/SubuserController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subusers.php#L93)

**Get all subusers with details** Retrieve all subusers for a server with detailed user information.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | string | yes | Server short UUID |

| Response `data` field | Type | Description |
| --- | --- | --- |
| `data` | SubuserWithDetails\[\] |  |

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

Responses: `200` Subusers with details retrieved successfully · `400` Bad request - Missing or invalid UUID short · `401` Unauthorized - User not authenticated · `403` Forbidden - Access denied to server · `404` Not found - Server not found · `500` Internal server error - Failed to retrieve subusers

### GET `/api/user/servers/{uuidShort}/subusers/search-users`

- Auth: Server access
- Default rate limit: 30 / minute (`user-server-subusers`)
- Route name: `session-server-search-users`
- Controller: [`SubuserController::searchUsers`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/SubuserController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subusers.php#L117)

**Search users for subuser** Search for users by email or username to add as subusers. Excludes users who are already subusers for this server.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | string | yes | Server short UUID |
| `search` | query | string | yes | Search term for username or email |

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

| Response `data` field | Type | Description |
| --- | --- | --- |
| `users` | UserSearchResult\[\] |  |
| `total` | integer | Total number of users found |

```bash
curl -X GET "$PANEL_URL/api/user/servers/$UUID_SHORT/subusers/search-users?search=$SEARCH" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Users found successfully · `400` Bad request - Missing UUID short or search query · `401` Unauthorized - User not authenticated · `403` Forbidden - Access denied to server · `404` Not found - Server not found · `500` Internal server error - Failed to search users

### GET `/api/user/servers/{uuidShort}/subusers/{subuserId}`

- Auth: Server access
- Default rate limit: 30 / minute (`user-server-subusers`)
- Route name: `session-server-get-subuser`
- Controller: [`SubuserController::getSubuser`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/SubuserController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subusers.php#L141)

**Get specific subuser** Retrieve details of a specific subuser for a server that the user owns or has subuser access to.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | string | yes | Server short UUID |
| `subuserId` | path | integer | yes | Subuser ID |

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

| Response `data` field | Type | Description |
| --- | --- | --- |
| `id` | integer | Subuser ID |
| `user_id` | integer | User ID |
| `server_id` | integer | Server ID |
| `permissions` | string\[\] | Array of permission strings |
| `created_at` | string (date-time) | Creation timestamp |
| `updated_at` | string (date-time) | Last update timestamp |

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

Responses: `200` Subuser details retrieved successfully · `400` Bad request - Missing or invalid parameters · `401` Unauthorized - User not authenticated · `403` Forbidden - Access denied to server · `404` Not found - Server or subuser not found · `500` Internal server error - Failed to retrieve subuser

### DELETE `/api/user/servers/{uuidShort}/subusers/{subuserId}`

- Auth: Server access
- Route name: `session-server-delete-subuser`
- Controller: [`SubuserController::deleteSubuser`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/SubuserController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subusers.php#L166)

**Delete subuser** Remove a subuser from a server.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | string | yes | Server short UUID |
| `subuserId` | path | integer | yes | Subuser ID |

| Response `data` field | Type | Description |
| --- | --- | --- |
| `message` | string | Success message |

```bash
curl -X DELETE "$PANEL_URL/api/user/servers/$UUID_SHORT/subusers/$SUBUSER_ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Plugin events: [`featherpanel:user:server:subuser:deleted`](https://featherpanel.com/docs/plugins/events/server/#server-subuser-deleted)

Responses: `200` Subuser deleted successfully · `400` Bad request - Missing or invalid parameters · `401` Unauthorized - User not authenticated · `403` Forbidden - Access denied to server · `404` Not found - Server or subuser not found · `500` Internal server error - Failed to delete subuser

### GET `/api/user/servers/{uuidShort}/subusers/{subuserId}/details`

- Auth: Server access
- Route name: `session-server-get-subuser-details`
- Controller: [`SubuserController::getSubuserWithDetails`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/SubuserController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subusers.php#L189)

**Get subuser with details** Retrieve detailed information about a specific subuser including user and server information.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | string | yes | Server short UUID |
| `subuserId` | path | integer | yes | Subuser ID |

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

| Response `data` field | Type | Description |
| --- | --- | --- |
| `id` | integer | Subuser ID |
| `user_id` | integer | User ID |
| `server_id` | integer | Server ID |
| `permissions` | string\[\] | Array of permission strings |
| `created_at` | string (date-time) | Creation timestamp |
| `updated_at` | string (date-time) | Last update timestamp |
| `username` | string | User username |
| `email` | string (email) | User email |
| `first_name` | string | User first name |
| `last_name` | string | User last name |
| `uuid` | string | User UUID |

```bash
curl -X GET "$PANEL_URL/api/user/servers/$UUID_SHORT/subusers/$SUBUSER_ID/details" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Subuser details retrieved successfully · `400` Bad request - Missing or invalid parameters · `401` Unauthorized - User not authenticated · `403` Forbidden - Access denied to server · `404` Not found - Server or subuser not found · `500` Internal server error - Failed to retrieve subuser details

### PATCH `/api/user/servers/{uuidShort}/subusers/{subuserId}`

- Auth: Server access
- Default rate limit: 10 / minute (`user-server-subusers`)
- Route name: `session-server-update-subuser`
- Controller: [`SubuserController::updateSubuser`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/SubuserController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/subusers.php#L212)

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | \- | yes |  |
| `subuserId` | path | \- | yes |  |

```bash
curl -X PATCH "$PANEL_URL/api/user/servers/$UUID_SHORT/subusers/$SUBUSER_ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Plugin events: [`featherpanel:user:server:subuser:updated`](https://featherpanel.com/docs/plugins/events/server/#server-subuser-updated)
