Overview
Story endpoints handle the core journaling functionality: creating, reading, and managing personal narratives.All story endpoints require authentication. Users can only access and modify their own stories.
Save Journal Entry
Create a new journal entry with automatic AI analysis.Request Body
Journal entry content (must be non-empty)
Entry title (default:
"Journal Entry {date}")User’s mood (default:
"neutral")Array of tags (default:
[])Whether this entry has an audio recording
URL to the audio file (if
hasAudio is true)Response
Always
true on successful saveThe created story object
Success message
Example Request
Example Response
Background Processing
Saving a journal entry automatically triggers two background operations:- AI Analysis - Calls
/api/ai/analyzeto extract metadata - CRE Verification - Calls
/api/cre/triggerfor blockchain attestation
These operations are non-blocking (fire-and-forget). The story is saved immediately even if background tasks fail.
Error Responses
Get User Stories
Fetch all stories for the authenticated user.Response
Array of story objects (ordered by
story_date descending)Example Request
Example Response
Create Story (Advanced)
Create a story with full control over all fields (used for sync operations).Request Body
User ID (must match authenticated user)
Ethereum address (must match user’s wallet)
Story title
Story content
Whether audio exists (default:
false)Audio file URL
Array of tags (default:
[])User’s mood (default:
"neutral")IPFS content hash (for Web3 storage)
Public visibility (default:
false)ISO 8601 timestamp (for backdating)
ISO 8601 date (when the story occurred)
Response
The created story object
Example Request
Error Responses
Story Metadata
After a story is created, AI analysis generates metadata stored in thestory_metadata table:
GET /api/stories- Includes metadata in response- Direct Supabase queries with joins
Best Practices
Use /journal/save
For new entries, use
/api/journal/save for automatic background processingUse /stories POST
For sync operations or when you need control over timestamps
Check Ownership
The API automatically verifies ownership - you cannot access other users’ stories
Handle Async Analysis
AI analysis is non-blocking - metadata may not be available immediately
Create Book Collection
Compile multiple stories into a book for NFT minting.Request Body
User ID (must match authenticated user)
Ethereum address (must match user’s wallet)
Book title
Array of story UUIDs to include (must be non-empty)
Book description
IPFS hash for NFT metadata
Response
Always
true on successful creationThe created book object
Example Request
cURL
Next Steps
AI Analysis
Learn about automatic story analysis
Social Features
Add likes and follows to your stories