---
title: "Import a WordPress site"
method: POST
path: "/sites/import-wordpress"
tags: ["Sites"]
---

# Import a WordPress site

`POST /sites/import-wordpress`

## Request

- Base URL: `https://api.hypamoon.com/api/v1`
- URL: `https://api.hypamoon.com/api/v1/sites/import-wordpress`
- 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`)

Imports the published pages and posts of a WordPress site on a domain this project has proven it owns, as clean pages that keep their addresses, with images within the site limits, a /_redirects file for addresses that change, a collection per form (the form on the new site posts to it), products to the product collection where payments are available, and puts posts that do not fit into a private collection. Publishes through the same checks as POST /sites (or PUT /sites/{id}). The response is the same as for POST /sites, with import (the report) and data (the collections).

## Request body

- WordpressImportInput
  - `url` string, required: The https address of the WordPress site, on a domain this project has proven it owns (like https://www.example.com).
  - `site_id` string, uuid: Optional. An existing site of this project to put the import in. Without it, a new site is created.
  - `keep_existing` boolean: Only with site_id. true: a partial update. The imported files are added or replaced and every other file of the site stays; images already on the site are not fetched again. Needs if_match_version.
  - `if_match_version` string: With keep_existing: the version of the site from get_site or list_sites. If the site changed since, nothing changes (409).
  - `name` string: Optional. A name for the new site; default the site's own name.
  - `slug` string: Optional. The address of a new site, like deploy_site's slug.
  - `max_posts` integer: Optional. Read at most this many posts, newest first (default all, at most 500).

## Response `200`

The updated site, with import and data.

## Other responses

- `201`: The new site, with import and data.
- `202`: Four-eyes approval is on: the imported site waits for another owner or builder. 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: version_conflict, plan_limit_reached, slug_taken.
- `412`: Precondition Failed: version_conflict.
- `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)
