Skip to main content

Endpoint

POST /api/sites/mirror

Request

curl -X POST https://beta-avallon.onrender.com/api/sites/mirror \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "downloadImages": true,
    "downloadFonts": true,
    "maxPages": 10,
    "maxDepth": 3
  }'

Request Body

url
string
required
URL of the website to import
downloadImages
boolean
Whether to download and embed images (default: true)
downloadFonts
boolean
Whether to download and embed fonts (default: true)
forceRender
boolean
Wait for JavaScript to render before capturing (default: false)
maxPages
number
Maximum number of pages to import (default: 10)
maxDepth
number
Maximum crawling depth (default: 3)

Response

success
boolean
Whether the import was successful
pages
array
Array of imported pages with HTML content
siteId
string
ID of the created website

Example Response

{
  "success": true,
  "pages": [
    {
      "filename": "index.html",
      "html": "<!DOCTYPE html>...",
      "title": "Home Page"
    },
    {
      "filename": "about.html",
      "html": "<!DOCTYPE html>...",
      "title": "About"
    }
  ],
  "siteId": "1234567890"
}

Credits

This endpoint uses 1 credit per import.

Errors

error
string
Error message if import fails
code
string
Error code (e.g., “INVALID_URL”, “IMPORT_FAILED”)