Get your free beta license ↗
API operation · files group
POST

/ftp/accounts

First published 3 Oct 20260.1.0Unchanged since publication

Create an FTP account

Who may call it
AdministratorResellerCustomer
Token scope, any of
filesall
Answers201 Created

Set 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 server

Request body

JSON ·FtpAccountCreate· 6 fields
directoryHomePathRequired
A path within the customer's home directory, with / representing the home directory itself. The path cannot contain .. components or control characters.
domainDomainNameRequired
One of the customer's domains.
namestring, matching ^[A-Za-z0-9][A-Za-z0-9._-]{0,31}$Required
Part of the login before the @, converted to lowercase.
passwordstring, up to 128 charactersRequired
expires_atstring, matching ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$ or null
Future UTC expiration time, such as 2026-11-04T09:30:00Z. The nightly run removes the account after expiration and preserves its directory. Omit this field to create an account with no expiration.
Username of the customer for whom an administrator is creating the FTP account.

Example

See the API overview for how to set $API and $TOKEN.
Request
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"
  }'
Response · 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 sentence
400--<_> is required
400--password-stdin is required: the password comes on standard input
400<name> is an administrator: administrators have no home, so no FTP accounts
400<user.name> is an administrator: administrators have no home, so no FTP accounts
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
400An FTP account name is 1 to 32 lowercase letters, digits, dots, dashes or underscores, before the @
400Domain name required
400Domain name too long
400Invalid domain name
400Invalid password: 8 to 128 printable characters
400Invalid system password hash
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Username '<value>' is reserved
400expires_at has passed already: <t>
400expires_at is a UTC time spelled as 2026-11-04T09:30:00Z
400expires_at is not a day the calendar has: <t>
400user is required: the customer the account is for
401Authentication required
404User '<user>' not found
409<login> is the customer's own login
409The FTP account <login> exists already
409The package <p.name> allows <limit>
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/post-ftp-accounts/