/ftp/accounts
0.1.0Unchanged since publicationCreate an FTP account
filesallSet user to select the customer. The API returns 400 if an administrator omits user or if user identifies an administrator. For other callers, user defaults to the caller's username. The API returns 201 with the new FTP account in account.
The login is <name>@<domain>. The domain must belong to the customer. UrbeStack lowercases name, which must be 1 to 32 characters, start with an ASCII letter or digit, and contain only ASCII letters, digits, dots, hyphens, or underscores. The login must differ from existing FTP logins and the customer's own login. The customer's package may limit the number of FTP accounts. The required password must contain 8 to 128 printable characters. UrbeStack hashes it with SHA512-CRYPT.
The directory path starts with /, which represents the customer's home. UrbeStack normalizes repeated slashes and . components. The API returns 400 for a missing path, a 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 can use the new login immediately.
By default, the account has no expiration. To schedule removal, set expires_at to a valid future UTC timestamp in the format 2026-11-04T09:30:00Z. Invalid or nonfuture values return 400. After that time, nightly cleanup removes the FTP account and retains its directory.
As a command
Run as root on the serverdirectoryHomePathRequireddomainDomainNameRequirednamestring, matching ^[A-Za-z0-9][A-Za-z0-9._-]{0,31}$Requiredpasswordstring, up to 128 charactersRequiredexpires_atstring, matching ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$ or nulluserUsernameExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/ftp/accounts" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"directory": "text",
"domain": "example.com",
"expires_at": "2026-09-16T10:15:00Z",
"name": "alice",
"password": "Sup3r-Secret-Passphrase",
"user": "alice"
}'201 Created{
"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
27 errors, each a status and a sentence400--<_> is required400--password-stdin is required: the password comes on standard input400<name> is an administrator: administrators have no home, so no FTP accounts400<user.name> is an administrator: administrators have no home, so no FTP accounts400<what> climbs out of the home with ..400<what> has a name over 255 characters400<what> holds a control character400<what> is required400<what> is too long400<what> must start with /, which is the home400An FTP account name is 1 to 32 lowercase letters, digits, dots, dashes or underscores, before the @400Domain name required400Domain name too long400Invalid domain name400Invalid password: 8 to 128 printable characters400Invalid system password hash400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400Username '<value>' is reserved400expires_at has passed already: <t>400expires_at is a UTC time spelled as 2026-11-04T09:30:00Z400expires_at is not a day the calendar has: <t>400user is required: the customer the account is for401Authentication required404User '<user>' not found409<login> is the customer's own login409The FTP account <login> exists already409The package <p.name> allows <limit> urbestack.com/docs/api/post-ftp-accounts/