Baby Tracker API Documentation

Comprehensive documentation for the Baby Tracker API endpoints

API Documentation

Explore Baby Tracker's RESTful API endpoints for all your baby tracking needs

RESTful Endpoints

Baby Tracker provides a comprehensive set of RESTful endpoints for tracking all aspects of your baby's development. The API is fully documented with Swagger/OpenAPI and includes authentication, filtering, and pagination.

EndpointDescriptionMethods
/api/register/User registration with JWT token responsePOST
/api/token/Obtain JWT access and refresh tokensPOST
/api/babies/Manage baby profiles (name, birth_date, gender)GET, POST, PUT, DELETE
/api/feedings/Track breastfeeding, bottle feeds, and solid foodsGET, POST, PUT, DELETE
/api/sleep/Record sleep sessions with start/end timesGET, POST
/api/diaper-changes/Log diaper changes (wet, dirty, mixed)GET, POST
/api/growth-milestones/Track height, weight, and head circumferenceGET, POST
/api/doctor-appointments/Schedule and track medical appointmentsGET, POST, PUT, DELETE
/api/babies/{id}/milestones/Development milestones by categoryGET, POST, PUT, DELETE
/api/appointments/Manage doctor appointments and medical visitsGET, POST, PUT, DELETE
/api/pumping-sessions/Track breast pumping sessionsGET, POST, PUT, DELETE
/api/medications/Track medications and dosagesGET, POST, PUT, DELETE
/api/reminders/Set reminders for baby care tasksGET, POST, PUT, DELETE
/api/babies/{id}/ai-insights/Get AI-powered insights and recommendationsGET
/api/babies/{id}/visualizations/Get visualization data for charts and graphsGET

Full API documentation available at /api/docs/

View Full API Docs

Authentication

Baby Tracker uses JWT (JSON Web Token) authentication. All endpoints except registration and token obtaining require authentication.

Register a new user

POST
/api/register/
{ "username": "john_doe", "email": "john@example.com", "password": "securepassword123" }

Obtain JWT token

POST
/api/token/
{ "username": "john_doe", "password": "securepassword123" }

Authentication Header: Include the access token in all requests:Authorization: Bearer <access_token>

API Examples

Create a Baby Profile

POST
/api/babies/
Authorization: Bearer <token>
{ "name": "Emma Smith", "birth_date": "2024-01-15", "gender": "female" }

Log a Feeding Session

POST
/api/feedings/
Authorization: Bearer <token>
{ "baby": 1, "feeding_type": "breastfeeding", "quantity": 4.0, "last_side": "left_feeding" }

Get AI Insights for a Baby

GET
/api/babies/1/ai-insights/?type=feeding
Authorization: Bearer <token>

Available insight types: feeding, sleep, growth, diaper, comprehensive, all

Update an Appointment

PUT
/api/appointments/1/
Authorization: Bearer <token>
{ "baby": 1, "doctor_name": "Dr. Smith", "appointment_date": "2025-09-15T14:30:00Z", "notes": "Updated 6-month checkup appointment" }

Data Models

Understanding the data structures used in Baby Tracker API:

Baby Model

  • id: integer (read-only)
  • name: string (required)
  • birth_date: date (YYYY-MM-DD)
  • gender: string
  • user: integer (read-only)

Feeding Model

  • id: integer (read-only)
  • baby: integer (required)
  • time: datetime (auto-generated)
  • feeding_type: breastfeeding | bottle | solid
  • quantity: float (ounces/ml)
  • last_side: left_feeding | right_feeding | both_feeding

Milestone Model

  • id: integer (read-only)
  • baby: integer (required)
  • title: string (required)
  • category: physical | social | cognitive | language | emotional
  • date_achieved: date (required)
  • notes: string (optional)

Sleep Model

  • id: integer (read-only)
  • baby: integer (required)
  • start_time: datetime (required)
  • end_time: datetime (optional)

Diaper Change Model

  • id: integer (read-only)
  • baby: integer (required)
  • time: datetime (auto-generated)
  • diaper_type: wet | dirty | mixed