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.
| Endpoint | Description | Methods |
|---|---|---|
| /api/register/ | User registration with JWT token response | POST |
| /api/token/ | Obtain JWT access and refresh tokens | POST |
| /api/babies/ | Manage baby profiles (name, birth_date, gender) | GET, POST, PUT, DELETE |
| /api/feedings/ | Track breastfeeding, bottle feeds, and solid foods | GET, POST, PUT, DELETE |
| /api/sleep/ | Record sleep sessions with start/end times | GET, POST |
| /api/diaper-changes/ | Log diaper changes (wet, dirty, mixed) | GET, POST |
| /api/growth-milestones/ | Track height, weight, and head circumference | GET, POST |
| /api/doctor-appointments/ | Schedule and track medical appointments | GET, POST, PUT, DELETE |
| /api/babies/{id}/milestones/ | Development milestones by category | GET, POST, PUT, DELETE |
| /api/appointments/ | Manage doctor appointments and medical visits | GET, POST, PUT, DELETE |
| /api/pumping-sessions/ | Track breast pumping sessions | GET, POST, PUT, DELETE |
| /api/medications/ | Track medications and dosages | GET, POST, PUT, DELETE |
| /api/reminders/ | Set reminders for baby care tasks | GET, POST, PUT, DELETE |
| /api/babies/{id}/ai-insights/ | Get AI-powered insights and recommendations | GET |
| /api/babies/{id}/visualizations/ | Get visualization data for charts and graphs | GET |
Full API documentation available at /api/docs/
Authentication
Baby Tracker uses JWT (JSON Web Token) authentication. All endpoints except registration and token obtaining require authentication.
Register a new user
Obtain JWT token
Authentication Header: Include the access token in all requests:Authorization: Bearer <access_token>
API Examples
Create a Baby Profile
Log a Feeding Session
Get AI Insights for a Baby
Available insight types: feeding, sleep, growth, diaper, comprehensive, all
Update an 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