Skip to main content

Endpoint

POST /api/sites/modify

Request

curl -X POST https://beta-avallon.onrender.com/api/sites/modify \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "siteId": "1234567890",
    "message": "Add a testimonial section with 3 customer reviews",
    "currentCode": {
      "index.html": "<!DOCTYPE html>..."
    }
  }'

Request Body

siteId
string
required
ID of the website to modify
message
string
required
Description of the modification you want
currentCode
object
Current website content (optional, will be fetched if not provided)
chatHistory
array
Previous conversation history for context

Response

success
boolean
Whether the modification was successful
websiteContent
object
Updated website content with modifications applied
message
string
Description of what was changed

Example Response

{
  "success": true,
  "websiteContent": {
    "index.html": "<!DOCTYPE html>...",
    "about.html": "<!DOCTYPE html>..."
  },
  "message": "Added testimonial section with 3 customer reviews"
}

Credits

This endpoint uses 1 credit per modification.

Errors

error
string
Error message if modification fails
code
string
Error code