# Import endpoints (Client API: game servers)

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

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

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

- Auth: Server access
- Default rate limit: 5 / minute (`user-server-import`)
- Route name: `user-server-import`
- Controller: [`ServerImportController::importServer`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/ServerImportController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/import.php#L28)

**Import server files** Import server files from a remote SFTP or FTP server. The server must be offline for imports to work.

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

Request body: [`ServerImportRequest`](https://featherpanel.com/docs/api/schemas/#schema-serverimportrequest) (application/json)

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `user` | string | yes | Username for SFTP/FTP authentication |
| `password` | string | yes | Password for SFTP/FTP authentication |
| `hote` | string | yes | Hostname or IP address of the remote server |
| `port` | integer | yes | Port number (1-65535). Typically 22 for SFTP, 21 for FTP |
| `srclocation` | string | yes | Source path on the remote server (absolute path) |
| `dstlocation` | string | yes | Destination path on the local server (relative to server root) |
| `wipe` | boolean | no | If true, clears the destination directory before importing |
| `type` | string | yes | Connection type |

```bash
curl -X POST "$PANEL_URL/api/user/servers/$UUID_SHORT/import" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"user":"","password":"","hote":"","port":0,"srclocation":"","dstlocation":"","wipe":false,"type":""}'
```

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

Responses: `202` Import process started successfully · `400` Bad request - Invalid data or server is online · `401` Unauthorized · `403` Forbidden - Feature disabled or insufficient permissions · `404` Server or node not found · `409` Conflict - Server is executing another power action · `500` Internal server error

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

- Auth: Server access
- Default rate limit: 30 / minute (`user-server-import`)
- Route name: `user-server-imports-list`
- Controller: [`ServerImportController::listImports`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Server/ServerImportController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/server/import.php#L52)

**List server imports** Get a list of all imports for a server with their statuses.

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

| Response `data` field | Type | Description |
| --- | --- | --- |
| `success` | boolean |  |
| `data` | object |  |

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

Responses: `200` List of imports · `401` Unauthorized · `403` Forbidden · `404` Server not found
