API

Build pages programmatically.

Create projects, run the wizard, generate pages, and manage sections — all through a REST API. Part of the Agency plan.

openapi.yamlpiratepage-api-skill.mdllms.txtImport into Postman, Claude Code, Cursor, or any API tool

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

GET/projects

List all projects, ordered by most recently updated.

POST/projects

Create 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..." }
GET/projects/:id

Get project details including knowledge base.

PATCH/projects/:id

Update project fields.

Request body:

{ "name": "New Name", "url": "https://new.com" }
DELETE/projects/:id

Delete 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.

GET/projects/:id/knowledge

Get the knowledge base markdown.

Response:

{ "markdown": "# Acme Corp\n...", "lastUpdated": "2026-03-28T..." }
PUT/projects/:id/knowledge

Replace the knowledge base (max 50KB).

Request body:

{ "markdown": "# My Product\n\nDescripton..." }
POST/projects/:id/knowledge/extract

AI-extract knowledge base from a URL or text.

Request body:

{ "url": "https://example.com", "context": "optional extra text" }

Response:

{ "markdown": "# Extracted KB\n..." }

Pages

GET/projects/:id/pages

List all pages with hierarchy and share URLs.

POST/projects/:id/pages

Create a new page.

Request body:

{ "name": "Pricing Page", "parentId": "optional" }

Response:

{ "id": "clx...", "shareUrl": "https://piratepage.cc/p/abc123" }
GET/projects/:id/pages/:pageId

Get page with sections, variations, and wizard answers.

PATCH/projects/:id/pages/:pageId

Update page name.

Request body:

{ "name": "Updated Name" }
DELETE/projects/:id/pages/:pageId

Delete a page.

POST/projects/:id/pages/:pageId/duplicate

Duplicate a page with all content.

Request body:

{ "name": "Copy of Homepage" }
PUT/projects/:id/pages/reorder

Batch 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.

PUT/projects/:id/pages/:pageId/wizard

Save 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"
}
POST/projects/:id/pages/:pageId/wizard/extract

AI-extract wizard answers from a URL or text.

Request body:

{ "url": "https://example.com", "context": "optional text" }

Response:

{ "answers": { "productDescription": "...", ... } }

Generation

POST/projects/:id/pages/:pageId/generate

Generate 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
POST/projects/:id/pages/:pageId/share

Create 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.

PUT/.../sections

Replace all sections (bulk edit or reorder).

Request body:

{ "sections": [{ "id": "...", "type": "hero", "order": 0, "content": {...} }] }
PATCH/.../sections/:sectionId

Update a section's content.

Request body:

{ "content": { "headline": "New headline", "subheadline": "..." } }
POST/.../sections/add

Add a new section.

Request body:

{ "type": "faq", "insertAt": 3 }
DELETE/.../sections/:sectionId

Delete a section.

POST/.../sections/:sectionId/move

Move a section up or down.

Request body:

{ "direction": "up" }
POST/.../sections/:sectionId/duplicate

Duplicate a section.

POST/.../sections/:sectionId/reprompt

Regenerate 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.

POST/.../sections/:sectionId/variations/generate

Generate 5 tone variations. Takes ~15 seconds.

GET/.../sections/:sectionId/variations

List all variations.

PUT/.../sections/:sectionId/variations/:varId

Pick, discard, or restore a variation.

Request body:

{ "action": "select" }
DELETE/.../sections/:sectionId/variations/:varId

Delete a variation.

DELETE/.../sections/:sectionId/variations

Delete 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 it
VALIDATION400Invalid request body or parameters
PLAN_LIMIT402Feature requires upgrade or limit reached
UNAUTHORIZED401Missing or invalid API key
RATE_LIMITED429Too many requests (60/min per key)
GENERATION_FAILED500AI generation failed (retry)
PARSE_ERROR500AI returned unparseable response
INVALID_TRANSITION409Invalid approval state change