Admin Workspace

LLM Admin API

Quick Start

Copy this prompt to any AI assistant (Claude, ChatGPT, etc.) to create a new affiliate:

Please make a POST request to create a new LovePuzzle affiliate:

URL: https://lovepuzzle-api.allosaurus.workers.dev/api/llm-admin/affiliates
Method: POST
Headers:
  Authorization: Bearer pv4wr227WJY842cByWOGmBsKxPyiuubNdsDg2QlkF1rXK97nzycJEWhM1xGm4iZc
  Content-Type: application/json

Body:
{
  "email": "partner@example.com",
  "displayName": "Partner Name",
  "commissionRateBps": 2000,
  "status": "active"
}

This will:
1. Create a user account if one doesn't exist
2. Set up the affiliate with a 20% commission rate
3. Send them a setup email with login credentials
4. Generate their unique affiliate link

Please confirm the response.
🔒

Authentication

All requests require the API key in the Authorization header:

Authorization: Bearer pv4wr227WJY842cByWOGmBsKxPyiuubNdsDg2QlkF1rXK97nzycJEWhM1xGm4iZc

This key grants admin-level access. Keep it private - only share with trusted AI assistants in private conversations.

🌐

Base URL

https://lovepuzzle-api.allosaurus.workers.dev/api/llm-admin

Use the workers.dev URL above for programmatic/AI access. The api.lovepuzzle.com domain has Cloudflare Bot Fight Mode enabled which blocks automated requests.

POST

/affiliates

Create New Affiliate

Creates a new affiliate. If the email doesn't have an existing user account, one will be created automatically and a setup email sent.

Request Body

FieldTypeRequiredDescription
email string Yes Email address of the affiliate partner
displayName string No Display name for the affiliate. Defaults to email username
code string No Custom affiliate code (URL slug). Auto-generated from displayName if not provided
commissionRateBps number No Commission rate in basis points. Default: 2000 (20%). Range: 0-10000
status string No "active" (default) or "pending"
createUser boolean No Set to false to require existing user. Default: auto-creates if not found
website string No Affiliate's website URL

Example Request

curl -X POST https://lovepuzzle-api.allosaurus.workers.dev/api/llm-admin/affiliates \
  -H "Authorization: Bearer pv4wr227WJY842cByWOGmBsKxPyiuubNdsDg2QlkF1rXK97nzycJEWhM1xGm4iZc" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "sarah@example.com",
    "displayName": "Sarah'\''s Picks",
    "code": "sarah",
    "commissionRateBps": 2500,
    "status": "active",
    "website": "https://sarahspicks.com"
  }'

Response

{
  "success": true,
  "affiliate": {
    "id": "abc123",
    "code": "sarah",
    "displayName": "Sarah's Picks",
    "status": "active",
    "commissionRateBps": 2500,
    "commissionRatePercent": "25.0%",
    "affiliateLink": "https://lovepuzzle.com/sarah"
  },
  "user": {
    "id": "user_xyz",
    "email": "sarah@example.com",
    "wasCreated": true,
    "temporaryPassword": "aB3$kLm9pQr2"
  },
  "setupEmailSent": true
}
Note: If user.wasCreated is true, a temporary password is returned and a setup email is sent. The affiliate should change their password on first login.
GET

/affiliates

List All Affiliates

Query Parameters

ParamTypeDescription
limit number Max results (default 50, max 200)
status string Filter by status: active, pending, paused, rejected
GET

/affiliates/:id

Get Affiliate Details

Returns full details for a single affiliate including user info.

PUT

/affiliates/:id

Update Affiliate

Update any affiliate field including their custom landing page content.

Basic Fields

displayName, code, commissionRateBps, status, website, bio, payoutEmail, notes

Landing Page Fields

Pass a landingPageConfig object to customise their affiliate landing page at lovepuzzle.com/[code]:

FieldDescription
headlineMain headline (max 120 chars)
subheadlineSubtitle text (max 360 chars)
ctaTextButton text, e.g. "Create your puzzle now"
ctaUrlButton URL (default "/app/create")
badgeBadge label, e.g. "Recommended by Sarah"
highlightsFeature bullets (string array, max 6)
accentColorHex colour, e.g. "#e11d48"
heroImageUrlHero image URL
coupleNamese.g. "Sarah & Mike"
coupleStoryPersonal story (max 600 chars)
couplePhotoUrlCouple photo URL
galleryPhotoUrlsGallery images (string array, max 8)
🎨

Landing Page Customisation Example

Here's a full example of setting up an affiliate's custom landing page:

PUT /affiliates/:id
{
  "displayName": "Sarah's Picks",
  "bio": "Sarah is a relationship coach who loves helping couples.",
  "website": "https://sarahspicks.com",
  "landingPageConfig": {
    "headline": "Sarah recommends LovePuzzle",
    "subheadline": "Create a personalized puzzle gift your partner will adore. Sarah has helped hundreds of couples celebrate their love.",
    "ctaText": "Create your puzzle now",
    "badge": "Recommended by Sarah",
    "highlights": [
      "Ready in under 5 minutes",
      "Printable QR code gift card",
      "3 interactive love games",
      "Personalised reward message"
    ],
    "accentColor": "#e11d48",
    "coupleNames": "Sarah & Mike",
    "coupleStory": "We've been together for 8 years. I created a LovePuzzle for Mike's birthday and he absolutely loved it!",
    "couplePhotoUrl": "https://example.com/sarah-mike.jpg"
  }
}
Tip: The landing page is live at lovepuzzle.com/[affiliate-code]. Changes take effect immediately.
GET

/schema

API Schema for LLMs

Returns the complete API schema in JSON. Share this URL with any AI assistant so it understands the full API:

https://lovepuzzle-api.allosaurus.workers.dev/api/llm-admin/schema

The AI can fetch this endpoint first, then use the schema to make correct API calls without needing documentation.

💰

Commission Rate Reference

Commission rates are in basis points (bps). 100 bps = 1%.

RateBPS ValueExample
10%1000Standard tier
15%1500Growing partner
20%2000Default / established partner
25%2500Premium partner
30%3000Top-tier / influencer
🤖

Full LLM Prompt Template

Give this to an AI assistant for a complete affiliate setup conversation:

You are helping me set up a new affiliate partner for LovePuzzle.

API Base: https://lovepuzzle-api.allosaurus.workers.dev/api/llm-admin
Auth Header: Authorization: Bearer pv4wr227WJY842cByWOGmBsKxPyiuubNdsDg2QlkF1rXK97nzycJEWhM1xGm4iZc

STEP 1: First fetch the API schema:
GET /schema

STEP 2: Ask me for the partner details:
1. Partner's email address
2. Display name (for their affiliate page)
3. Custom affiliate code/slug (or auto-generate)
4. Commission rate (default 20%)
5. Their website URL (optional)

STEP 3: Create the affiliate via POST /affiliates

STEP 4: Ask me for their landing page customisation:
- Headline and subheadline for their page
- Call-to-action button text
- Feature highlights (up to 6 bullet points)
- Accent colour (hex)
- Their names as a couple
- Their love story / bio (how they'd recommend LovePuzzle)
- Photo URLs (couple photo, hero image, gallery)

STEP 5: Update the affiliate via PUT /affiliates/:id with the landingPageConfig

After each step, confirm what was done and show their live affiliate link: https://lovepuzzle.com/[code]