Skip to main content

Endpoint

POST /api/sites/generate

Request

curl -X POST https://beta-avallon.onrender.com/api/sites/generate \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Website",
    "description": "A modern portfolio website for a photographer",
    "mode": "full",
    "multiPage": true
  }'

Request Body

name
string
required
Name of the website
description
string
required
Description of what you want to build
mode
string
Generation mode: “full” (default) or “minimal”
multiPage
boolean
Whether to generate multiple pages (default: true)
style
string
Design style: “modern”, “minimal”, “bold”, etc.
colorScheme
string
Color scheme preferences

Response

success
boolean
Whether the request was successful
websiteContent
object
Object containing HTML files (key: filename, value: HTML content)
siteId
string
ID of the created website
previewUrl
string
Preview URL for the generated website

Example Response

{
  "success": true,
  "websiteContent": {
    "index.html": "<!DOCTYPE html>...",
    "about.html": "<!DOCTYPE html>...",
    "contact.html": "<!DOCTYPE html>..."
  },
  "siteId": "1234567890",
  "previewUrl": "https://preview.avallon.site/website-1234567890"
}

Credits

This endpoint uses 1 credit per website generation.

Errors

error
string
Error message if generation fails
code
string
Error code (e.g., “INSUFFICIENT_CREDITS”, “GENERATION_FAILED”)