# SFTP Accounts endpoints (Client API: web hosting)

> 5 FeatherPanel Client API: web hosting endpoints from user/webspaces/sftp-accounts.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Source: https://featherpanel.com/docs/api/reference/user/webspaces/sftp-accounts/

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

- Auth: Signed-in user
- Default rate limit: 30 / minute (`user-webspaces`)
- Route name: `user-webspaces-sftp-accounts`
- Controller: [`WebSpaceSftpAccountController::index`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceSftpAccountController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/sftp-accounts.php#L26)

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

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

### POST `/api/user/webspaces/{uuidShort}/sftp-accounts`

- Auth: Signed-in user
- Default rate limit: 10 / minute (`user-webspaces`)
- Route name: `user-webspaces-sftp-accounts-create`
- Controller: [`WebSpaceSftpAccountController::create`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceSftpAccountController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/sftp-accounts.php#L43)

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

```bash
curl -X POST "$PANEL_URL/api/user/webspaces/$UUID_SHORT/sftp-accounts" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Plugin events: [`featherpanel:webspace:sftp:account:created`](https://featherpanel.com/docs/plugins/events/web-space/#web-space-sftp-account-created)

### PATCH `/api/user/webspaces/{uuidShort}/sftp-accounts/{accountId}`

- Auth: Signed-in user
- Default rate limit: 10 / minute (`user-webspaces`)
- Route name: `user-webspaces-sftp-accounts-update`
- Controller: [`WebSpaceSftpAccountController::update`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceSftpAccountController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/sftp-accounts.php#L60)

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

```bash
curl -X PATCH "$PANEL_URL/api/user/webspaces/$UUID_SHORT/sftp-accounts/$ACCOUNT_ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Plugin events: [`featherpanel:webspace:sftp:account:updated`](https://featherpanel.com/docs/plugins/events/web-space/#web-space-sftp-account-updated)

### DELETE `/api/user/webspaces/{uuidShort}/sftp-accounts/{accountId}`

- Auth: Signed-in user
- Default rate limit: 10 / minute (`user-webspaces`)
- Route name: `user-webspaces-sftp-accounts-delete`
- Controller: [`WebSpaceSftpAccountController::delete`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceSftpAccountController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/sftp-accounts.php#L78)

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

```bash
curl -X DELETE "$PANEL_URL/api/user/webspaces/$UUID_SHORT/sftp-accounts/$ACCOUNT_ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Plugin events: [`featherpanel:webspace:sftp:account:deleted`](https://featherpanel.com/docs/plugins/events/web-space/#web-space-sftp-account-deleted)

### POST `/api/user/webspaces/{uuidShort}/sftp-accounts/{accountId}/reset-password`

- Auth: Signed-in user
- Default rate limit: 10 / minute (`user-webspaces`)
- Route name: `user-webspaces-sftp-accounts-reset-password`
- Controller: [`WebSpaceSftpAccountController::resetPassword`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/WebSpaces/WebSpaceSftpAccountController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/user/webspaces/sftp-accounts.php#L96)

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

```bash
curl -X POST "$PANEL_URL/api/user/webspaces/$UUID_SHORT/sftp-accounts/$ACCOUNT_ID/reset-password" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Plugin events: [`featherpanel:webspace:sftp:password:reset`](https://featherpanel.com/docs/plugins/events/web-space/#web-space-sftp-password-reset)
