# POST /import

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

UrbeStack release 0.2.35 API operation in the export group.

Queue a job to import an export and rebuild services

- Who may call it: administrator
- Token scope, any of: export
- Answers: 202 Accepted

Supply the export as a JSON object in data. The API returns 400 if data is missing or lacks a supported schema_version or a profile object. It returns 403 if the profile contains hooks, overrides, Apache includes, or registered files. Import profiles containing those sections at the shell with urbestack-import --trust-files.

The import job applies the export and rebuilds all services. Set profile_only to true to apply only the server profile from a full export. Set dry_run to true to report differences without applying changes.

The API returns 202 with the queued import job in job. Once queued, the job runs independently of the request and can finish after a gateway timeout. Use GET /jobs/{id} to read the report in the completed job's result or the log if the job fails. The API returns 500 if it cannot stage the export for the job.

## As a command

- [urbestack-import](https://urbestack.com/docs/commands/urbestack-import.md): Imports an UrbeStack configuration export and rebuilds the server from it.

## Request body

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

- `data` (object, required): Decoded contents of an export file.
- `dry_run` (boolean)
- `profile_only` (boolean)

## 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/import" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {},
    "dry_run": true,
    "profile_only": true
  }'
```

Response, 202 Accepted:

```
{
  "job": {
    "created_at": "2026-09-09T10:15:00Z",
    "created_by": 1,
    "created_by_name": "text",
    "dismissed_at": "text",
    "finished_at": "2026-09-09T10:15:04Z",
    "id": 1,
    "lane": "short",
    "log": "",
    "params": {},
    "progress": 100,
    "result": {},
    "started_at": "2026-09-09T10:15:01Z",
    "status": "queued",
    "type": "rebuild",
    "usual_seconds": 1
  }
}
```

## Errors

- 400: A new job is queued or running
- 400: Export has no profile section
- 400: Export has no schema_version
- 400: Export is not valid JSON
- 400: Invalid <what>: 
- 400: Invalid boolean
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Job parameters must be an object
- 400: Unknown job type
- 400: Unsupported export schema version <data.schema_version>
- 400: Username '<value>' is reserved
- 400: body is missing required field data
- 401: Authentication required
- 403: This profile carries 
- 404: User '<user>' not found
