Complete API documentation for the SocialAi backend.
http://localhost:3000
Currently, most endpoints are public. Authentication via Farcaster and SIWE will be required for:
- Creating posts
- Claiming profiles
- Modifying user data
Check system health and worker status.
Response:
{
"status": "healthy",
"timestamp": "2024-01-28T04:00:00.000Z",
"workers": [
{
"name": "farcaster",
"healthy": true
}
]
}Get detailed worker status.
Response:
[
{
"name": "farcaster",
"healthy": true,
"enabled": true
}
]List all users (paginated).
Query Parameters:
- None (returns first 100)
Response:
[
{
"id": "uuid",
"farcaster_id": 1234,
"ethereum_address": "0x...",
"ens_name": "user.eth",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
]Get a specific user by ID.
Parameters:
id(string) - User UUID
Response:
{
"id": "uuid",
"farcaster_id": 1234,
"ethereum_address": "0x...",
"ens_name": "user.eth",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}Error Responses:
404- User not found
List all profiles (paginated).
Query Parameters:
- None (returns first 100)
Response:
[
{
"id": "uuid",
"user_id": "uuid",
"username": "alice",
"display_name": "Alice",
"bio": "Builder",
"avatar_url": "https://...",
"banner_url": "https://...",
"website_url": "https://...",
"twitter_handle": "alice",
"claimed": true,
"verified": true,
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
]Get a specific profile by username.
Parameters:
username(string) - Profile username
Response:
{
"id": "uuid",
"user_id": "uuid",
"username": "alice",
"display_name": "Alice",
"bio": "Builder",
"avatar_url": "https://...",
"claimed": true,
"verified": true
}Error Responses:
404- Profile not found
List all internal posts (paginated).
Query Parameters:
- None (returns first 100, ordered by created_at DESC)
Response:
[
{
"id": "uuid",
"user_id": "uuid",
"content": "Hello world!",
"media_urls": ["https://..."],
"parent_id": null,
"root_id": null,
"reply_count": 0,
"recast_count": 0,
"like_count": 5,
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
]Get a specific post by ID.
Parameters:
id(string) - Post UUID
Response:
{
"id": "uuid",
"user_id": "uuid",
"content": "Hello world!",
"reply_count": 0,
"like_count": 5,
"created_at": "2024-01-01T00:00:00.000Z"
}Error Responses:
404- Post not found
List external posts from Farcaster, Reddit, etc.
Query Parameters:
source(optional) - Filter by source:farcaster,reddit
Response:
[
{
"id": "uuid",
"external_id": "farcaster_12345",
"source": "farcaster",
"author_id": "1234",
"author_name": "alice",
"content": "Cast content",
"url": "https://...",
"metadata": { "fid": 1234 },
"created_at": "2024-01-01T00:00:00.000Z",
"synced_at": "2024-01-01T00:00:00.000Z"
}
]Get a user's timeline (posts from followed users).
Parameters:
username(string) - Profile username
Response:
[
{
"id": "uuid",
"content": "Post content",
"username": "bob",
"display_name": "Bob",
"avatar_url": "https://...",
"created_at": "2024-01-01T00:00:00.000Z"
}
]List all feature flags.
Response:
[
{
"id": "uuid",
"flag_name": "farcaster_sync",
"enabled": true,
"description": "Enable Farcaster data synchronization",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
]Update a feature flag.
Parameters:
name(string) - Flag name
Request Body:
{
"enabled": true
}Response:
{
"id": "uuid",
"flag_name": "farcaster_sync",
"enabled": true,
"updated_at": "2024-01-01T00:00:00.000Z"
}Error Responses:
404- Feature flag not found
List all system settings.
Response:
[
{
"id": "uuid",
"key": "sync_interval",
"value": { "minutes": 5 },
"description": "Interval for worker synchronization",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
]Generate an AI summary of a post.
Parameters:
postId(string) - Post UUID
Response:
{
"summary": "This post discusses...",
"topics": ["web3", "social"],
"sentiment": "neutral"
}Error Responses:
404- Post not found
Get AI-powered recommendations for a user.
Parameters:
userId(string) - User UUID
Response:
[
{
"id": "uuid",
"username": "recommended_user",
"display_name": "Recommended User",
"bio": "..."
}
]All endpoints return standard HTTP status codes:
200- Success400- Bad Request404- Not Found429- Too Many Requests (rate limited)500- Internal Server Error
Error response format:
{
"error": "Error message"
}API requests are rate limited to:
- 100 requests per minute per IP address
Rate limit headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640995200
Currently, endpoints return a fixed number of results:
- Most list endpoints: 100 items
- Timeline: 100 items
- Posts: 100 items
Future versions will include proper pagination with limit and offset or cursor-based pagination.
CORS is enabled for all origins in development. In production, configure allowed origins via environment variables.
WebSocket support for real-time updates is planned for future releases.
For more information, see:
- Installation Guide - Setup instructions and environment configuration
- Architecture Overview - System architecture and components
- Development Guide - API development workflow and testing
- Testing Guide - API testing strategies and examples
- Troubleshooting - Common API issues and solutions
- Deployment Guide - Production deployment and configuration
Last Updated: 2026-02-07