---
title: "Import a Vite + React repository (a Lovable or Bolt export) as a new site; other frameworks get a clear refusal"
method: POST
path: "/builder/imports"
tags: ["Builder"]
---

# Import a Vite + React repository (a Lovable or Bolt export) as a new site; other frameworks get a clear refusal

`POST /builder/imports`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/builder/imports`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Query parameters

- `orgId` string

## Request body

- object
  - `repoUrl` string: A public repository: https://github.com/<owner>/<name>
  - `installationId` string: A private repository through the customer GitHub App
  - `repoFullName` string
  - `branch` string
  - `name` string
  - `connect` boolean: Keep the new site in sync with this repository (needs the installation)
  - `checkOnly` boolean: Only check whether it can be imported

## Response `200`

The check, and the new site when it could be imported

- object
  - `check` object, required
    - `ok` boolean, required
    - `kind` 'vite-react' | 'next' | 'vue' | 'svelte' | 'angular' | 'astro' | 'remix' | 'other', required
    - `origin` 'lovable' | 'bolt' | 'hostingsurge' | 'other', required
    - `problems` object[], required: Why it cannot be imported (empty when ok)
      - `code` string, required
      - `message` string, required
      - `path` string, nullable, required
    - `notes` object[], required: What the import changes or leaves out, in plain words
      - `code` string, required
      - `message` string, required
      - `path` string, nullable, required
    - `files` integer, required
    - `skipped` object[], required
      - `path` string, required
      - `reason` 'binary' | 'too_large' | 'lockfile' | 'ignored' | 'limit', required
  - `session` object, nullable, required
    - `id` string, uuid, required
    - `organizationId` string, uuid, required
    - `projectId` string, uuid, required
    - `title` string, required
    - `status` 'active' | 'archived', required
    - `template` string, required
    - `model` string, required
    - `escalationModel` string, nullable, required
    - `turnCount` integer, required
    - `lastCommitSha` string, nullable, required
    - `sandbox` object, nullable, required
      - `status` 'starting' | 'running' | 'idle' | 'stopping' | 'stopped' | 'error', required
      - `previewUrl` string, nullable, required
      - `error` string, nullable, required
      - `lastActivityAt` string, required: ISO-8601 timestamp
    - `editVersion` integer: Live editing: the files' version for preview editors (+1 per edit batch)
    - `pendingEdits` integer: Live editing: preview edits not yet saved as a version (saved within 20 seconds)
    - `firstDraftReady` boolean: Builder v2: a turn has finished successfully, so the site has a first draft (the dashboard shows the live preview only from then on)
    - `publishedUrl` string, nullable: Builder v2: the live address after the last successful publish
    - `createdAt` string, required: ISO-8601 timestamp
    - `updatedAt` string, required: ISO-8601 timestamp

## Other responses

- `400`: Invalid request (code invalid_request); an import that fails its check answers 200 with the check and no session
- `401`: Missing or invalid session/token (code unauthorized)
- `402`: GitHub sync needs a paid plan (code upgrade_required, details.feature builder.github_export)
- `403`: Not permitted, or the GitHub App has no access to write (code forbidden, details.reason not_permitted)
- `404`: Not found, or the GitHub account is not connected to the team (code not_found)
- `409`: The repository already has code: say whether the site replaces it or the builder takes it (details.reason repository_not_empty)
- `501`: GitHub sync is not switched on for this server (code not_configured)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
