Fermenty API Documentation

1. Home / Welcome

GET /api/welcome
Public, static content
{
  "message": "Welcome to Fermenty API!",
  "info": "This is the mobile API entry point."
}

2. Fermentos (Ferment Types)

GET /api/fermentos
List all ferment types. Public.
[
  {
    "id": 1,
    "name": "Kombucha",
    "description": "Fermented tea beverage...",
    "image_url": "https://.../kombucha.jpg"
  }
]
GET /api/fermentos/{id}
Get details for a ferment type. Public.
{
  "id": 1,
  "name": "Kombucha",
  "description": "Fermented tea beverage...",
  "image_url": "https://.../kombucha.jpg",
  "guides": [
    { "id": 10, "title": "Basic Guide", "steps": [ ... ] }
  ],
  "related_batches": [
    { "id": 101, "name": "My First Batch", "status": "active" }
  ]
}

3. FAQ, Privacy, Terms, Premium

GET /api/pages/{slug}
Static content (FAQ, privacy, terms, premium). Public.
{
  "title": "FAQ",
  "content": "...HTML or Markdown..."
}

4. Newsletter

POST /api/newsletter
Subscribe to newsletter. Public.
{ "email": "user@example.com" }
{ "status": "subscribed" }
POST /api/newsletter/unsubscribe
Unsubscribe from newsletter. Public.
{ "token": "..." }
{ "status": "unsubscribed" }
GET /api/newsletter/confirm/{token}
Confirm newsletter subscription. Public.
{ "status": "confirmed" }

5. Authentication

POST /api/auth/login
User login. Public.
{ "email": "user@example.com", "password": "..." }
{ "token": "...", "user": { "id": 1, "name": "User", "email": "user@example.com" } }
POST /api/auth/register
User registration. Public.
{ "name": "User", "email": "user@example.com", "password": "..." }
{ "token": "...", "user": { "id": 1, "name": "User", "email": "user@example.com" } }
POST /api/auth/google
Google login. Public.
{ "token": "google_id_token" }
{ "token": "...", "user": { ... } }
POST /api/auth/password/email
Password reset. Public.
{ "email": "user@example.com" }
{ "status": "email_sent" }

6. Dashboard (User Home)

GET /api/dashboard
User overview. Auth required.
{
  "user": { "id": 1, "name": "User", "premium": true },
  "active_batches": [ ... ],
  "recent_activity": [ ... ],
  "notifications": [ ... ],
  "premium_status": true
}

7. Batches

GET /api/batches
List user batches. Auth required.
[
  { "id": 101, "name": "Batch 1", "type": "Kombucha", "status": "active", "progress": 60 }
]
POST /api/batches
Create batch. Auth required.
{ "name": "Batch 1", "type_id": 1 }
{ "id": 101, "name": "Batch 1" }
GET /api/batches/{id}
Batch details. Auth required.
{ "id": 101, "name": "Batch 1", "type": "Kombucha", "status": "active", "logs": [ ... ], "events": [ ... ] }
PUT /api/batches/{id}
Update batch. Auth required.
{ ...fields to update... }
DELETE /api/batches/{id}
Delete batch. Auth required.
{ "status": "deleted" }
POST /api/batches/{id}/advance
Advance batch step. Auth required.
{ "status": "advanced", "batch": { ... } }

8. Batch Logs

GET /api/batches/{id}/logs
List logs for a batch. Auth required.
[
  { "id": 1, "date": "2026-04-20", "note": "Checked pH", "image_url": null }
]
POST /api/batches/{id}/logs
Add log entry. Auth required.
{ "date": "2026-04-20", "note": "Checked pH", "image": "...base64..." }
GET /api/batches/{id}/logs/{log_id}
Get log detail. Auth required.
PUT /api/batches/{id}/logs/{log_id}
Update log. Auth required.
DELETE /api/batches/{id}/logs/{log_id}
Delete log. Auth required.
{ "status": "deleted" }

9. Batch Events

POST /api/batches/{id}/events
Add event to batch. Auth required.
{ "type": "step_completed", "data": { } }
{ "status": "event_recorded" }

10. Batch Review

POST /api/batches/{id}/review
Submit review. Auth required.
{ "rating": 5, "notes": "Great batch!" }
{ "status": "reviewed" }
GET /api/batches/{id}/review
Get review. Auth required.
{ "rating": 5, "notes": "Great batch!" }

11. Community

GET /api/community
List community posts. Auth required for actions.
[
  { "id": 1, "user": { }, "content": "My recipe...", "likes": 3, "comments": [ ] }
]
POST /api/community
Create post. Auth required.
{ "content": "My recipe...", "image": "...base64..." }
GET /api/community/{post_id}
Get post detail. Auth required.
DELETE /api/community/{post_id}
Delete post. Auth required.
{ "status": "deleted" }
POST /api/community/{post_id}/like
Like post. Auth required.
{ "status": "liked" }
POST /api/community/{post_id}/comments
Add comment. Auth required.
{ "comment": "Nice!" }
DELETE /api/community/{post_id}/comments/{comment_id}
Delete comment. Auth required.
{ "status": "deleted" }

12. Profile

GET /api/profile
View profile. Auth required.
{ "id": 1, "name": "User", "email": "user@example.com", "avatar_url": "..." }
PUT /api/profile
Update profile. Auth required.
{ ...fields to update... }
POST /api/profile/avatar
Upload avatar. Auth required.
multipart/form-data (file)
{ "avatar_url": "..." }
POST /api/profile/deletion/request
Request account deletion. Auth required.
{ "status": "requested" }
GET /api/profile/deletion/confirm/{user_id}
Confirm account deletion. Auth required.
{ "status": "confirmed" }
DELETE /api/profile
Delete account. Auth required.
{ "status": "deleted" }

13. Notifications

GET /api/notifications
List notifications. Auth required.
[
  { "id": 1, "type": "reminder", "message": "Check your batch!", "read": false, "created_at": "2026-04-20T10:00:00Z" }
]
POST /api/notifications/{id}/read
Mark as read. Auth required.
{ "status": "read" }
POST /api/notifications/read-all
Mark all as read. Auth required.
{ "status": "all_read" }