# POST /ai/generate-website-page

**Resource:** [AI](./ai.md)  
**Scopes:** `ai:use`  
**Write operation:** yes

Generate a complete website landing page with AI -- picks industry-appropriate sections (hero, social proof, features, pricing, FAQ, CTA, etc.) from the business description. Creates website + homepage + all page sections in one call. By default (persist=true), inserts rows into websites, website_pages, and website_page_sections. Costs credits (ai_tool_generate).

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `prompt` | body | string | yes | Business description. Be specific about industry, tone, and target audience. |
| `persist` | body | boolean | no | If true (default), creates the website, homepage, and sections. If false, returns only the generated structure. |
| `name` | body | string | no | Override the AI-generated website name. |
| `page_type` | body | string | no | homepage (default) or page (for secondary pages like services, about, pricing). |

## Response example

```json
{
  "data": {
    "website": {
      "id": "uuid",
      "name": "Smith Plumbing",
      "created_at": "2026-04-19T..."
    },
    "homepage": {
      "id": "uuid",
      "title": "Home",
      "slug": "home",
      "path": "/home"
    },
    "section_count": 7,
    "persisted": true
  },
  "meta": {
    "credits_remaining": 9100
  }
}
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`