# GET /ftp/accounts

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

UrbeStack release 0.2.35 API operation in the files group.

List FTP accounts and report FTP status

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

Administrators can see every customer's FTP accounts. Resellers can see their own accounts and those of their customers. Customers can see their own accounts. The response lists accounts by owner, then by login. It also reports whether FTP is installed, enabled, and running, whether TLS is required, the FTP port and passive port range, the ProFTPD version, and the service unit.

With no q, status, owner, page, or per_page, the response contains accounts and status. Use user in this view to select one customer's accounts. The detailed view uses q, status, owner, page, and per_page and includes the owner's package, the on-disk directory in path, and the last recorded sign-in in last_login_at. UrbeStack updates last_login_at hourly from ProFTPD sign-ins in the system journal. An invalid status returns 400.

Use page or per_page to request a page. Omit both to receive every matching account. In the detailed response, counts applies the other filters with status omitted. The all object gives the account and owner totals visible to the caller before filtering.

## As a command

- [urbestack-ftp-account-list](https://urbestack.com/docs/commands/urbestack-ftp-account-list.md): Lists FTP accounts with their owners and directories.

## Parameters

- `user` (query, Username): Customer username an administrator can use to limit the basic listing to that customer's FTP accounts.
- `q` (query, string, up to 200 characters): Case-insensitive substring of the FTP login or the owner's full username. The API ignores values over 200 characters or containing control characters.
- `status` (query, string, one of old, never, expiring): Account status filter. Use old for accounts created more than a year ago, never for accounts with no sign-in recorded in the system journal, or expiring for accounts with a scheduled expiration.
- `owner` (query, Username): Username of the owner whose FTP accounts to include in the detailed listing.
- `page` (query, integer, 1 or more): Page number, from 1 to 9 decimal digits, defaulting to 1. Requests beyond the last page return the last page, and the API ignores values outside the digit limit.
- `per_page` (query, integer, 1 to 1000): Number of accounts per page, from 1 to 4 decimal digits, defaulting to 25 when paging. The API ignores values outside the digit limit.

## 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 GET "$API/ftp/accounts?user=alice&q=text&status=old&owner=alice&page=1&per_page=1" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "accounts": [
    {
      "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
    }
  ],
  "all": {
    "owners": 1,
    "total": 1
  },
  "counts": {
    "all": 1,
    "expiring": 1,
    "never": 1,
    "old": 1
  },
  "more": true,
  "page": 1,
  "pages": 1,
  "per_page": 1,
  "status": {
    "active": true,
    "enabled": true,
    "installed": true,
    "passive_ports": "text",
    "port": 8443,
    "require_tls": true,
    "running": true,
    "state": "up",
    "unit": "text",
    "version": "0.0.1"
  },
  "total": 1
}
```

## Errors

- 400: Invalid <what>: expected a non-negative integer
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Username '<value>' is reserved
- 400: per_page is a number from 1 to 1000
- 400: status is one of old, never, expiring
- 401: Authentication required
- 404: User '<f.owner>' not found
- 404: User '<family>' not found
- 404: User '<user>' not found
