🚀 Spreadli API

Documentation for developers

GET /api/health

Check API and service health status

Response

{
  "status": "healthy",
  "timestamp": "2024-12-11T10:00:00.000Z",
  "version": "0.2.1",
  "services": {
    "redis": { "status": "healthy", "latency_ms": 12 },
    "openai": { "status": "configured" }
  }
}
GET /api/user

Get user info, role, and credits

Authentication

Authorization: Bearer <jwt_token> or query param ?email=...

Query Parameters

Parameter Type Required Description
email string Optional User email (if not using Bearer token)

Response

{
  "authenticated": true,
  "email": "user@example.com",
  "role": "PRO",
  "credits": 198,
  "subscription_id": "sub_01..."
}

Rate Limits

POST /api/repurpose

Generate social media content from source text

Authentication

Required Authorization: Bearer <jwt_token>

Request Body

{
  "source": "Your long-form content here...",
  "platforms": ["twitter", "linkedin", "hooks"],
  "brandVoice": "Professional but friendly"
}

Response

{
  "results": {
    "twitter": "Thread content...",
    "linkedin": "Post content...",
    "hooks": ["Hook 1", "Hook 2", "Hook 3"]
  },
  "creditsRemaining": 197
}
POST /api/checkout

Create Paddle checkout session for PRO upgrade

Request Body

{
  "email": "user@example.com",
  "plan": "pro_monthly"
}

Response

{
  "checkoutUrl": "https://buy.paddle.com/..."
}
POST /api/paddle/webhook

Paddle webhook receiver (subscription events)

Note: This endpoint is for Paddle webhooks only. Not for public use.