---
title: "Import an existing site"
method: POST
path: "/sites/import"
tags: ["Sites"]
---

# Import an existing site

`POST /sites/import`

## Request

- Base URL: `https://api.hypamoon.com/api/v1`
- URL: `https://api.hypamoon.com/api/v1/sites/import`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://app.hypamoon.com/oauth/authorize`, token URL `https://api.hypamoon.com/oauth/token`, scopes: `sites:write`)

Fetches an existing static site from a domain this project has proven it owns (active here, or proven with the TXT record) and publishes it as a site, through the same checks as POST /sites. Only the same host, respecting robots.txt, within the site limits; links become relative, and forms that need a server lose their action. The response is the same as for POST /sites (or PUT /sites/{id}), with an import report.

## Request body

- SiteImportInput
  - `url` string, required: The https address of the existing site, on a domain this project connected (like https://www.example.com).
  - `site_id` string, uuid: Optional. An existing site of this project to replace with the imported files. Without it, a new site is created.
  - `name` string: Optional. A name for the new site; default the host name.
  - `slug` string: Optional. The address of a new site, like deploy_site's slug.
  - `max_pages` integer: Optional. At most this many pages (default 25, at most 50).

## Response `200`

The replaced site, with import.

## Other responses

- `201`: The new site, with import.
- `202`: Four-eyes approval is on: the imported site waits for another owner or builder, with import. Nothing has changed on the live site yet.
- `400`: Bad Request: invalid_json.
- `401`: Unauthorized: unauthorized, missing_api_key, invalid_api_key, api_key_revoked, project_deleted.
- `402`: Payment Required: plan_limit_reached.
- `403`: Forbidden: project_not_enabled, key_mode_mismatch, missing_scope, verification_required, forbidden, site_offline.
- `404`: Not Found: not_found.
- `409`: Conflict: plan_limit_reached, slug_taken.
- `422`: Unprocessable Content: validation_failed, site_limit_reached, slug_reserved, site_too_large, site_blocked.
- `429`: Too Many Requests: rate_limited, deploy_limit_reached.
- `500`: Internal Server Error: internal_error.
- `503`: Service Unavailable: service_unavailable.

---

[API](https://skmtc.dev/hypamoon/apis/hypamoon-api.md) · [All operations](https://skmtc.dev/hypamoon/apis/hypamoon-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hypamoon/apis/hypamoon-api/revisions/9f0b90004c06?raw)
