All endpoints are under /api/v1/. Authenticate with a Bearer token.
Authentication
Create an API key from your API Keys dashboard (requires Agency plan). Include it in every request as a Bearer token.
curl -H "Authorization: Bearer pp_live_YOUR_KEY" \ https://piratepage.cc/api/v1/projects
401 — Missing or invalid API key
403 — Key valid but user not on Agency plan (downgraded)
429 — Rate limit exceeded (60 requests/minute per key)
Projects
/projectsList all projects, ordered by most recently updated.
/projectsCreate a project. Auto-creates a Homepage page.
Request body:
{ "name": "Acme Corp", "url": "https://acme.com", "description": "..." }Response:
{ "id": "clx...", "name": "Acme Corp", "homepageId": "clx..." }/projects/:idGet project details including knowledge base.
/projects/:idUpdate project fields.
Request body:
{ "name": "New Name", "url": "https://new.com" }/projects/:idDelete project and all its pages.
Knowledge Base
The knowledge base is a markdown document containing your product's positioning, voice, audience, and proof points. It feeds into every generation to produce copy specific to your product.
/projects/:id/knowledgeGet the knowledge base markdown.
Response:
{ "markdown": "# Acme Corp\n...", "lastUpdated": "2026-03-28T..." }/projects/:id/knowledgeReplace the knowledge base (max 50KB).
Request body:
{ "markdown": "# My Product\n\nDescripton..." }/projects/:id/knowledge/extractAI-extract knowledge base from a URL or text.
Request body:
{ "url": "https://example.com", "context": "optional extra text" }Response:
{ "markdown": "# Extracted KB\n..." }Pages
/projects/:id/pagesList all pages with hierarchy and share URLs.
/projects/:id/pagesCreate a new page.
Request body:
{ "name": "Pricing Page", "parentId": "optional" }Response:
{ "id": "clx...", "shareUrl": "https://piratepage.cc/p/abc123" }/projects/:id/pages/:pageIdGet page with sections, variations, and wizard answers.
/projects/:id/pages/:pageIdUpdate page name.
Request body:
{ "name": "Updated Name" }/projects/:id/pages/:pageIdDelete a page.
/projects/:id/pages/:pageId/duplicateDuplicate a page with all content.
Request body:
{ "name": "Copy of Homepage" }/projects/:id/pages/reorderBatch reorder pages (hierarchy + position).
Request body:
{ "pages": [{ "id": "...", "parentId": null, "order": 0 }] }Wizard
The wizard captures 9 questions about your product. These answers drive AI generation.
/projects/:id/pages/:pageId/wizardSave wizard answers.
Request body:
{
"answers": {
"productDescription": "Project management for construction",
"productNotDescription": "Not a general task manager",
"keyTakeaway": "Save 10 hours per week on scheduling",
"excitedUserDescription": "It just works for construction",
"competitors": "Monday, Asana, Procore",
"differentiation": "Built specifically for construction",
"userMotivations": "Reduce scheduling errors",
"userFears": "Too complex to set up",
"callToAction": "Start free trial"
},
"language": "en"
}/projects/:id/pages/:pageId/wizard/extractAI-extract wizard answers from a URL or text.
Request body:
{ "url": "https://example.com", "context": "optional text" }Response:
{ "answers": { "productDescription": "...", ... } }Generation
/projects/:id/pages/:pageId/generateGenerate or regenerate page sections. Takes ~20 seconds. Returns the share URL.
Request body:
{ "feedback": "optional regeneration feedback" }Response:
{
"id": "clx...",
"sections": [{ "type": "hero", "content": {...} }, ...],
"shareUrl": "https://piratepage.cc/p/abc123",
"durationMs": 18500
}Example:
curl -X POST \ -H "Authorization: Bearer pp_live_YOUR_KEY" \ -H "Content-Type: application/json" \ https://piratepage.cc/api/v1/projects/PROJECT_ID/pages/PAGE_ID/generate
/projects/:id/pages/:pageId/shareCreate or retrieve the public share URL.
Response:
{ "shareToken": "abc123", "shareUrl": "https://piratepage.cc/p/abc123" }Sections
Sections are the building blocks of a page (hero, features, FAQ, etc.). 19 types available: hero, features-grid, faq, cta, pricing, testimonials, and more.
/.../sectionsReplace all sections (bulk edit or reorder).
Request body:
{ "sections": [{ "id": "...", "type": "hero", "order": 0, "content": {...} }] }/.../sections/:sectionIdUpdate a section's content.
Request body:
{ "content": { "headline": "New headline", "subheadline": "..." } }/.../sections/addAdd a new section.
Request body:
{ "type": "faq", "insertAt": 3 }/.../sections/:sectionIdDelete a section.
/.../sections/:sectionId/moveMove a section up or down.
Request body:
{ "direction": "up" }/.../sections/:sectionId/duplicateDuplicate a section.
/.../sections/:sectionId/repromptRegenerate a section with a specific instruction.
Request body:
{ "instruction": "Make the headline shorter and punchier" }Variations
Generate 5 tone variations for any section: punchy, conversational, benefit-focused, problem-aware, bold-confident.
/.../sections/:sectionId/variations/generateGenerate 5 tone variations. Takes ~15 seconds.
/.../sections/:sectionId/variationsList all variations.
/.../sections/:sectionId/variations/:varIdPick, discard, or restore a variation.
Request body:
{ "action": "select" }/.../sections/:sectionId/variations/:varIdDelete a variation.
/.../sections/:sectionId/variationsDelete all variations.
Error Reference
All errors follow this format:
{ "error": { "code": "NOT_FOUND", "message": "Project not found" } }NOT_FOUND404Resource doesn't exist or you don't own itVALIDATION400Invalid request body or parametersPLAN_LIMIT402Feature requires upgrade or limit reachedUNAUTHORIZED401Missing or invalid API keyRATE_LIMITED429Too many requests (60/min per key)GENERATION_FAILED500AI generation failed (retry)PARSE_ERROR500AI returned unparseable responseINVALID_TRANSITION409Invalid approval state change