# PATCH /ftp/accounts/{name}

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the files group.

Change an FTP account's password or directory

- Who may call it: administrator, reseller, customer
- Token scope, any of: files, all
- Answers: 200 OK

Administrators can update any FTP account, and customers can update their own. Supply password, directory, or both. The API returns 400 if neither is supplied or if the login format is invalid. It returns 404 if the account does not exist. A successful response includes the updated FTP account in account.

The password must contain 8 to 128 printable characters. The directory path starts with /, which represents the customer's home. UrbeStack normalizes repeated slashes and . components. The API returns 400 for a directory path that lacks the leading / or contains a control character or a .. component, a path over 4096 characters, or a component over 255 characters. UrbeStack creates missing directories with mode 0755 and gives the customer ownership. The FTP account is confined to the selected directory and its contents. ProFTPD applies the changes at the next login.

## As a command

- [urbestack-ftp-account-set](https://urbestack.com/docs/commands/urbestack-ftp-account-set.md): Changes the password, directory or both for a customer's FTP account.

## Parameters

- `name` (path, FtpAccountName, required): FTP login in the form <name>@<domain>, with @ encoded as %40.

## Request body

JSON, the type [FtpAccountPatch](https://urbestack.com/docs/api/types/FtpAccountPatch.md).

- `directory` (HomePath): A path within the customer's home directory, with / representing the home directory itself. The path cannot contain .. components or control characters.
- `password` (string, up to 128 characters)

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X PATCH "$API/ftp/accounts/alice" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "directory": "text",
    "password": "Sup3r-Secret-Passphrase"
  }'
```

Response, 200 OK:

```
{
  "account": {
    "created_at": "2026-09-09T10:15:00Z",
    "directory": "text",
    "expires_at": "2026-09-16T10:15:00Z",
    "id": 1,
    "last_login_at": "text",
    "name": "alice",
    "package": "basic",
    "path": "public_html/index.php",
    "user": "alice",
    "user_id": 2
  }
}
```

## Errors

- 400: --<_> is required
- 400: <what> climbs out of the home with ..
- 400: <what> has a name over 255 characters
- 400: <what> holds a control character
- 400: <what> is required
- 400: <what> is too long
- 400: <what> must start with /, which is the home
- 400: An FTP account is named <name>@<domain>
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid domain name
- 400: Invalid password: 8 to 128 printable characters
- 400: Invalid system password hash
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Nothing to change
- 400: Nothing to change: give a password, a directory or both
- 400: Username '<value>' is reserved
- 401: Authentication required
- 404: The FTP account <login> does not exist
- 404: User '<user>' not found
