Introduction
The iStory API provides a comprehensive REST interface for building Web3-powered voice journaling applications. All endpoints require authentication and are protected by rate limiting.Base URL
Authentication
All API endpoints require a Bearer token in theAuthorization header. iStory supports two authentication methods:
- Wallet Authentication (custom JWT)
- Google OAuth (Supabase session JWT)
Rate Limits
API routes are protected by a rate limiting middleware with route-specific limits:| Route Pattern | Limit | Window |
|---|---|---|
/api/ai/* | 10 requests | 1 minute |
/api/auth/* | 20 requests | 1 minute |
/api/email/send | 5 requests | 1 minute |
/api/cre/callback | 30 requests | 1 minute |
/api/waitlist | 10 requests | 1 minute |
All other /api/* | 60 requests | 1 minute |
429 Too Many RequestsHeaders:
Retry-After: 60
CORS
The API supports cross-origin requests from these origins:http://localhost:8081(Expo dev)http://localhost:19006(Expo web)http://localhost:3000(Next.js dev)https://e-story-dapp.vercel.apphttps://istory.vercel.app
GET, POST, PUT, DELETE, PATCH, OPTIONSAllowed headers:
Content-Type, Authorization
Response Format
Success Response
Error Response
Error messages never leak internal implementation details or stack traces.
Status Codes
| Code | Meaning |
|---|---|
200 | Success |
400 | Bad Request - Invalid input |
401 | Unauthorized - Missing or invalid token |
403 | Forbidden - Insufficient permissions |
404 | Not Found |
409 | Conflict - Duplicate resource or concurrent operation |
422 | Unprocessable Entity - Valid format but semantic error |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |
502 | Bad Gateway - External service error |
API Sections
Authentication
Wallet signature and OAuth login flows
AI Endpoints
Transcription, enhancement, analysis, and reflections
Story Endpoints
Create, read, and manage journal entries
Social Endpoints
Likes, follows, and social interactions
Security
The API implements a layered security model: Layer 0: Security headers (CSP, X-Frame-Options, CORS)Layer 1: Rate limiting (route-specific)
Layer 2: Bearer token authentication
Layer 3: Input validation (size limits, MIME types, text length)
Layer 4: Ownership verification (users can only modify their own resources)
SDK Support
JavaScript/TypeScript
cURL
Next Steps
Authentication Guide
Learn how to authenticate with wallet signatures
AI Integration
Integrate voice transcription and AI analysis