API Overview
Scribe Backend provides a RESTful API for generating personalized academic outreach emails using a multi-step AI pipeline. The API is built with FastAPI and follows OpenAPI 3.0 specifications.Base URL
API Characteristics
Authentication
JWT-based authentication via Supabase Auth with Bearer token in Authorization header
Response Format
All responses are JSON with consistent error structure and HTTP status codes
Rate Limiting
Currently no hard rate limits, but batch operations limited to 100 items
Versioning
API version 1.0.0, future versions will use path-based versioning
Interactive Documentation
Scribe Backend provides auto-generated interactive API documentation powered by FastAPI’s Swagger UI:/docs endpoint allows you to:
- Explore all available endpoints
- View request/response schemas
- Test API calls directly in the browser
- Authenticate with JWT tokens
- View example requests and responses
The interactive docs require authentication for protected endpoints. Click the Authorize button and enter your JWT token.
Response Format
All API responses follow a consistent JSON structure:Success Response
Error Response
HTTP Status Codes
Scribe Backend uses standard HTTP status codes:| Status Code | Meaning |
|---|---|
| 200 OK | Request succeeded |
| 201 Created | Resource created successfully |
| 202 Accepted | Async task accepted for processing |
| 400 Bad Request | Invalid request parameters |
| 401 Unauthorized | Missing or invalid authentication |
| 403 Forbidden | Authenticated but insufficient permissions |
| 404 Not Found | Resource not found |
| 422 Unprocessable Entity | Validation error |
| 429 Too Many Requests | Rate limit exceeded |
| 500 Internal Server Error | Server error |
| 503 Service Unavailable | Service temporarily unavailable |
Pagination
List endpoints support pagination via query parameters:Maximum number of items to return (max: 100)
Number of items to skip
Health Check
The API provides a public health check endpoint:The health check endpoint is public and does not require authentication.
API Endpoints Summary
User Management
POST /api/user/init- Initialize user profileGET /api/user/profile- Get current user profile
Email Generation
POST /api/email/generate- Generate single email (async)GET /api/email/status/{task_id}- Check generation statusGET /api/email/{email_id}- Retrieve email by IDGET /api/email/- List user’s emails (paginated)PATCH /api/email/{email_id}- Update email properties
Queue Management
POST /api/queue/batch- Submit batch (1-100 recipients)GET /api/queue/- Get all user’s queue itemsDELETE /api/queue/{id}- Cancel pending queue item
Template Management
POST /api/templates/- Generate template from resume
Authentication Guide
Learn how to authenticate API requests
Error Handling
Understand error responses and troubleshooting
User Endpoints
User management endpoint documentation
Email Endpoints
Email generation endpoint documentation
