Skip to main content

Site Import API Reference

Complete reference for the Site Import REST API. See Site Import API guide for usage examples.

Authentication

All endpoints require authentication via one of:

MethodHeaderUse case
API KeyAuthorization: Bearer <key>Scripts and automation
API Key (alt)x-api-key: <key>Legacy support
SessionCookie-basedDashboard UI

POST /api/site-import

Create a site with all resources.

Request

{
"organizationId": "string (required)",
"name": "string (required)",
"domain": "string (optional)",
"database": {
"type": "mariadb | mysql | postgres | mongodb",
"name": "string",
"user": "string",
"password": "string"
},
"source": {
"type": "github | gitlab | docker | git",
"repo": "string (owner/name, for github/gitlab)",
"branch": "string (default: main)",
"buildPath": "string (default: /)",
"buildType": "dockerfile | nixpacks (default: dockerfile)",
"dockerImage": "string (for docker type)",
"githubId": "string (for github type)",
"gitlabId": "string (for gitlab type)",
"customGitUrl": "string (for git type)",
"customGitSSHKeyId": "string (for git type, optional)"
},
"envVars": { "KEY": "VALUE" },
"port": 80
}

Response 200

{
"importId": "string",
"status": "success",
"projectId": "string",
"applicationId": "string",
"databaseId": "string | undefined",
"databaseType": "string | undefined",
"databaseServiceHost": "string | undefined",
"domainId": "string | undefined"
}

Response 422 (partial failure)

Same shape as 200, with status: "partial" or status: "failed" and additional fields:

{
"importId": "string",
"status": "partial",
"errorMessage": "string",
"errorStep": "project_creation | database_creation | application_creation | domain_creation | deployment"
}

Response 401

{ "error": "Unauthorized" }

Response 400

{ "error": "Invalid input", "details": { "fieldErrors": {}, "formErrors": [] } }

POST /api/site-import/preview

Validate input without creating resources.

Request

Same body as POST /api/site-import.

Response 200

{
"valid": true,
"resources": {
"project": { "name": "string" },
"database": { "type": "string", "name": "string" },
"application": { "name": "string", "sourceType": "string", "buildType": "string" },
"domain": { "host": "string" }
},
"warnings": ["string"],
"errors": ["string"]
}

GET /api/site-import

List import history for the authenticated user's organization.

Query Parameters

ParamTypeDefaultDescription
limitnumber50Max results (1-100)
offsetnumber0Pagination offset

Response 200

Array of import records.

GET /api/site-import/:id

Get a single import record by ID.

Response 200

Full import record including inputConfig, status, resource IDs, and error details.

Response 404

Import not found or belongs to a different organization.

tRPC Endpoints

The same functionality is available via tRPC for use from the dashboard or TypeScript clients:

ProcedureTypeInput
siteImport.importmutationSame as POST body
siteImport.previewquerySame as POST body
siteImport.listquery{ limit?, offset? }
siteImport.getquery{ siteImportId }
siteImport.retrymutation{ siteImportId } — idempotent, updates record in-place
siteImport.deletemutation{ siteImportId, rollbackResources? } — delete record, optionally rollback resources

Import Statuses

StatusDescriptionAvailable Actions
pendingImport is in progressWait
successAll resources created, deployment triggeredDelete record
partialSome resources created before failureRetry, Rollback, Delete
failedNo resources createdRetry, Delete
note

success means resources were provisioned and deployment was triggered. The build and deploy are asynchronous — check the application's deployment logs for build status.