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

/import

First published 3 Oct 20260.1.0Unchanged since publication

Queue a job to import an export and rebuild services

Who may call it
AdministratorResellerCustomer
Token scope, any of
export
Answers202 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

Run as root on the server

Request body

JSON ·ImportRequest· 3 fields
dataobjectRequired
Decoded contents of an export file.
dry_runboolean
profile_onlyboolean

Example

See the API overview for how to set $API and $TOKEN.
Request
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

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