# POST /export

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

UrbeStack release 0.2.35 API operation in the export group.

Create an export file on the server

- Who may call it: administrator
- Token scope, any of: export
- Answers: 201 Created

By default, UrbeStack exports a server profile as JSON. The profile includes settings, packages, overrides, hooks, registered files, custom Apache configuration, mail and firewall configuration, server-wide ModSecurity settings, and the enabled PHP extensions for each installed PHP version. It records each plugin's name, version, and enabled status. The profile omits host identity settings and the SSH port.

Set full to true to also export user accounts with password hashes, second-factor secrets, and recovery codes. A full export includes domains and their DNS, mail, and ModSecurity settings, customer SSH keys, database definitions, and database users and grants. It also includes DKIM private keys and smarthost passwords. Use backups or migration to transfer database contents.

A nonempty passphrase requests encryption. UrbeStack reads the first line of passphrase. For a full export, the API returns 400 if passphrase is missing or shorter than 8 characters.

UrbeStack saves the file as urbestack-HOST-TIMESTAMP.json and appends .enc for an encrypted export. An existing file with the same output name is replaced. The API returns 201 with an ExportFile response. Use GET /exports/{file} to download the file.

## As a command

- [urbestack-export](https://urbestack.com/docs/commands/urbestack-export.md): Exports the UrbeStack server configuration as JSON.

## Request body

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

- `full` (boolean): Whether to include users, their password hashes and domains in the export.
- `passphrase` (string, up to 256 characters): Passphrase used to encrypt the export file. Required when full is true.

## 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 POST "$API/export" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "full": true,
    "passphrase": "a long passphrase"
  }'
```

Response, 201 Created:

```
{
  "encrypted": true,
  "file": "urbestack-panel-20260909T101500Z.json.enc",
  "kind": "profile",
  "name": "alice",
  "size": 1
}
```

## Errors

- 400: --encrypt requires --passphrase-stdin
- 400: --full exports contain password hashes; use --encrypt
- 400: A passphrase of at least 8 characters is required for a full export
- 400: Invalid boolean
- 400: Invalid file name
- 401: Authentication required
