Vocal Journaling API Gateway
This workspace publishes the public API contract for vocal-journaling-api.
Use this API as an authenticated JSON/multipart interface for:
- Voice upload and analysis
- Text chat and coaching endpoints
- Aggregated insights
- Recent history retrieval
/health remains public.
Authentication and onboarding
This portal now has two distinct layers:
- Developer portal sign-in
- App user authentication
Developer portal sign-in
Developers sign in to this portal with Supabase credentials. Once signed in, Zuplo can manage developer-facing API keys from the portal UI.
This is for:
- Access to the portal as a known developer
- API key lifecycle management in Zuplo
- Future developer-key-protected gateway routes
App user authentication
The application routes in this API are still user-scoped. Protected routes currently require a valid Supabase user access token in the request:
Code
This is for:
- Identifying the end user whose data is being read or written
- Voice uploads, history, insights, chat, and coaching
- Provisioning and storing per-user analysis data
So today the flow is:
- A developer signs into the portal
- A developer can manage Zuplo API keys
- App requests still send a Supabase user JWT when calling user-scoped endpoints
Developer API keys do not replace app user identity for the current endpoint set.
Error contract
All documented errors use:
Code
Error code matrix
| Endpoint | Code | Meaning |
|---|---|---|
POST /api/v1/voice | MISSING_FILE | audio file was not included |
POST /api/v1/voice | INVALID_FILE_TYPE | File MIME type is not allowed |
POST /api/v1/voice | INVALID_FILE_SIZE | Uploaded file exceeds VOICE_UPLOAD_MAX_BYTES |
POST /api/v1/chat | INVALID_REQUEST | Missing text, non-string text, or length > 10,000 |
POST /api/v1/coaching | INVALID_REQUEST | text is present but invalid |
GET /api/v1/insights | INVALID_REQUEST | period is not day, week, or month |
GET /api/v1/history | INVALID_REQUEST | limit or days outside documented bounds |
*/api/v1/* | UNAUTHORIZED | Missing or invalid bearer token |
* | INTERNAL_ERROR | Unexpected server failure |
Endpoint Reference
POST /api/v1/voice — Upload and analyze a recording
- Auth: required (
Bearertoken) - Content type:
multipart/form-data - Form field:
audio(required): audio bytes only
- Validation:
audiorequired- MIME must be audio-compatible
VOICE_UPLOAD_MAX_BYTESdefault: 25 MB
Success response
Code
Examples
Code
Code
Code
Error example
Code
POST /api/v1/chat — Chat text analysis
- Auth: required
- Content type:
application/json - Body:
text(required string, maxLength 10000)
Code
Code
POST /api/v1/coaching — Generate coaching guidance
- Auth: required
- Content type:
application/json - Body:
text(optional string, maxLength 10000)- omitted text uses fallback coaching prompt
Code
Code
GET /api/v1/insights — Aggregate summary
- Auth: required
- Query:
periodoptional:day | week | month(defaultmonth)
Success response
Code
Query examples
Code
Code
Code
Code
GET /api/v1/history — Recent voice history
- Auth: required
- Query:
limitoptional integer1..100(default10)daysoptional integer1..365(default30)
Success response
Code
Code
Code
Code
Code
GET /health — Public health check
- Auth: none
Code
Rate limits and environment
Policies and limits are defined in config/routes.oas.json and gateway policy files.
Code
For endpoint-level API behavior tests:
Code
For gateway/contract checks:
Code
Local requestId assertions and error shape tests are included in the API route suite.