API Overview

SocialTwin API provides programmatic access to all platform services.

Base URL

Production:

https://amplifier-pages.pages.dev/api

Local Development:

http://localhost:3000/api

Authentication

All API endpoints require authentication using API keys. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Rate limiting: 1000 requests per hour per API key.

Service Endpoints

Strategy Worker

/api/strategy/*

Knowledge Worker

/api/knowledge/*

Content Generation

/api/generate/*

Approval Queue

/api/queue/*

Platform Manager

/api/platform/*

Lead Intelligence (CRM)

/api/crm/*

Error Handling

All errors follow a standard format:

{
  "error": "VALIDATION_ERROR",
  "message": "Invalid user_id provided",
  "code": 400,
  "timestamp": "2024-01-15T10:30:00Z"
}

400 - Bad Request (validation errors)

401 - Unauthorized (authentication required)

403 - Forbidden (authorization failed)

404 - Not Found

500 - Internal Server Error