A cloud API server that acts as an intermediary between the Myndy mobile app and the Myndy AI assistant, facilitating data collection, storage, and retrieval.
Get StartedMyndy API is a comprehensive health and productivity data platform with over 100 endpoints across multiple functional categories. The system features optimized batch processing, comprehensive authentication, and seamless mobile integration.
All API endpoints are relative to:
https://www.myndyai.com
The API supports multiple authentication methods including JWT tokens, API keys, and OAuth integration with external services like Todoist.
Security & Data Isolation: All API endpoints require proper OAuth 2.0 authentication. Every database operation is automatically scoped to the authenticated user's ID extracted from the OAuth token, ensuring complete data isolation between users. Only OAuth authentication is supported - no backdoor API keys or alternative access methods.
WHERE user_id = %s automaticallyuser_id column with proper indexingStart OAuth 2.0 authorization flow for API access.
response_type=code
&client_id=YOUR_CLIENT_ID
&redirect_uri=YOUR_CALLBACK_URL
&scope=user_data+health_data
&state=RANDOM_STATE_VALUE
Redirects to your callback URL with authorization code
YOUR_CALLBACK_URL?code=AUTHORIZATION_CODE&state=RANDOM_STATE_VALUE
Exchange authorization code for OAuth access token.
grant_type=authorization_code
&code=AUTHORIZATION_CODE
&client_id=YOUR_CLIENT_ID
&client_secret=YOUR_CLIENT_SECRET
&redirect_uri=YOUR_CALLBACK_URL
{
"access_token": "oauth2_access_token_here",
"token_type": "Bearer",
"expires_in": 7776000,
"refresh_token": "oauth2_refresh_token_here",
"scope": "user_data health_data"
}
200 OK Token exchange successful
400 Bad Request Invalid authorization code
401 Unauthorized Invalid client credentials
Get authenticated user information using OAuth token.
Yes (OAuth Bearer token)
{
"sub": "user-id",
"email": "user@example.com",
"name": "User Name",
"preferred_username": "username"
}
OAuth Token: Include in Authorization header: Authorization: Bearer <oauth_access_token>
POST /oauth/token - Refresh OAuth token (with refresh_token grant)POST /oauth/revoke - Revoke OAuth access tokenGET /api/v1/auth/oauth/connect/todoist - Connect Todoist (OAuth required)POST /api/v1/auth/oauth/disconnect/todoist - Disconnect TodoistGET /api/v1/auth/oauth/status/todoist - Check Todoist connection statusiOS-compatible location tracking with consolidated database storage. All location data has been migrated to the dedicated location_data table with 11,932 total records.
Upload GPS location data from iOS apps with OAuth JWT authentication.
Yes (JWT token)
{
"latitude": 37.7749,
"longitude": -122.4194,
"altitude": 50.0,
"horizontalAccuracy": 10.0,
"verticalAccuracy": 5.0,
"timestamp": "2025-09-28T03:45:00Z",
"speed": 5.2,
"course": 180.0
}
{
"locations": [
{
"latitude": 37.7749,
"longitude": -122.4194,
"horizontalAccuracy": 10.0,
"timestamp": "2025-09-28T03:45:00Z"
}
]
}
{
"success": true,
"inserted": 1,
"total": 1,
"message": "Successfully saved 1 location points",
"errors": []
}
201 Created Location data uploaded
401 Unauthorized Invalid authentication
400 Bad Request Missing required fields
Retrieve location history with time-based filtering.
Yes (JWT token)
{
"success": true,
"locations": [
{
"id": "location-uuid",
"latitude": 37.7749,
"longitude": -122.4194,
"altitude": 50.0,
"horizontalAccuracy": 10.0,
"timestamp": "2025-09-28T03:45:00Z",
"speed": 5.2,
"course": 180.0
}
],
"count": 1
}
location_data tablehorizontalAccuracy → accuracy (optional, defaults to 10.0), course → headingUser profile management, device registration, and account operations.
Get current user information.
Yes (JWT token)
{
"id": "user-id",
"email": "user@example.com",
"name": "User Name",
"role": "user",
"created_at": "2025-09-28T14:30:00Z"
}
Register a new device for the authenticated user.
Yes (JWT token)
{
"name": "iPhone 15 Pro"
}
{
"id": "device-id",
"name": "iPhone 15 Pro",
"lastSync": "2025-09-28T14:30:00Z"
}
201 Created Device registered
401 Unauthorized Invalid authentication
GET /api/v1/user/profile - Get user profilePUT /api/v1/user/profile - Update user profileGET /api/v1/device/list - List user's devicesSMS webhook processing, TextBee integration, and message management.
TextBee webhook endpoint for incoming SMS messages.
No (Webhook)
{
"from": "+1234567890",
"to": "+0987654321",
"message": "Hello from SMS",
"timestamp": "2025-09-28T14:30:00Z"
}
{
"status": "received",
"message_id": "sms-uuid",
"processed": true
}
Get SMS messages for the authenticated user.
Yes (JWT token)
{
"messages": [
{
"id": "sms-uuid",
"from": "+1234567890",
"to": "+0987654321",
"message": "Hello from SMS",
"timestamp": "2025-09-28T14:30:00Z",
"processed": true
}
],
"count": 1
}
POST /api/v1/sms/send - Send SMS messageGET /api/v1/sms/stats - Get SMS statisticsPOST /api/v1/sms/process/{message_id} - Process specific messageGET /api/v1/sms/unprocessed - Get unprocessed messagesPOST /api/v1/sms/archive/{message_id} - Archive messagePOST /api/v1/sms/bulk-archive - Bulk archive messagesComprehensive health metrics management with optimized batch processing and comprehensive deduplication. All endpoints require OAuth JWT authentication.
Upload a single health data point.
Yes (JWT token)
{
"id": "uuid-v4",
"type": "heart_rate",
"timestamp": "2025-09-28T14:30:00Z",
"source": "healthkit",
"value": 72.0,
"data": {
"unit": "bpm",
"confidence": 0.98
}
}
{
"id": "uuid-v4",
"message": "Health data point created"
}
201 Created Health data point created
200 OK Health data point updated
401 Unauthorized Invalid authentication
Performance Optimized: Batch upload with 99.99% reduction in database queries through bulk processing and 4-level deduplication.
Yes (JWT token)
[
{
"id": "uuid-v4-1",
"type": "heart_rate",
"timestamp": "2025-09-28T14:30:00Z",
"source": "healthkit",
"value": 72.0
},
{
"id": "uuid-v4-2",
"type": "steps",
"timestamp": "2025-09-28T14:30:00Z",
"source": "healthkit",
"value": 10000
}
]
{
"inserted": 1850,
"updated": 150,
"total": 2000,
"success_rate": "100.0%",
"errors": []
}
Retrieve health data with filtering and pagination.
Yes (JWT token)
{
"data": [
{
"id": "uuid-v4",
"type": "heart_rate",
"timestamp": "2025-09-28T14:30:00Z",
"source": "healthkit",
"value": 72.0,
"user_id": "user-id"
}
],
"nextPageToken": "pagination-token"
}
POST /api/v1/healthdata/bulk - Bulk upload in grouped format (50%+ smaller payloads)GET /api/v1/healthdata/aggregate - Aggregated metrics and summariesGET /api/v1/health - Alias endpoint for health data retrievalReal-time user context with intelligent data aggregation from existing health and location data. All endpoints require OAuth JWT authentication.
Get current user status with intelligent aggregation from database records.
Yes (JWT token)
{
"user_id": "user-id",
"timestamp": "2025-09-28T14:30:00Z",
"mood": "focused",
"stress_level": 3,
"activity": "working",
"health": {
"heart_rate": 72,
"steps": 8500,
"sleep_quality": "good"
},
"location": {
"latitude": 37.7749,
"longitude": -122.4194,
"accuracy": 10.5
},
"context_tags": ["meeting", "focused"],
"source": "aggregated"
}
200 OK Status retrieved successfully
401 Unauthorized Invalid authentication
Update user status with support for partial updates using intelligent deep merging.
Yes (JWT token)
{
"mood": "excited",
"health": {
"heart_rate": 78
},
"context_tags": ["presentation"],
"change_type": "partial"
}
{
"success": true,
"status_id": "uuid-v4",
"timestamp": "2025-09-28T14:30:00Z",
"change_type": "partial"
}
GET /api/v1/status/history - Historical status records with time filteringPOST /api/v1/status/mood - Record mood entryGET /api/v1/status/mood - Get mood historyManage tasks and projects with seamless integration to connected productivity services like Todoist. Requires authentication and automatically uses your connected Todoist account if available.
Retrieve tasks with optional filtering
{
"status": "success",
"tasks": [
{
"id": "123456789",
"content": "Buy groceries",
"description": "Milk, bread, eggs",
"completed": false,
"priority": 2,
"due_date": "2025-05-31T10:00:00Z",
"project_id": "987654321",
"labels": ["shopping", "urgent"],
"url": "https://todoist.com/showTask?id=123456789",
"created_at": "2025-05-30T09:00:00Z",
"updated_at": "2025-05-30T09:00:00Z"
}
]
}
Create a new task
{
"content": "Buy groceries",
"description": "Milk, bread, eggs",
"due_date": "2025-05-31T10:00:00Z",
"priority": 2,
"labels": ["shopping", "urgent"]
}
Update an existing task
{
"content": "Updated task title",
"completed": true
}
Delete a task
Retrieve all projects
{
"status": "success",
"projects": [
{
"id": "987654321",
"name": "Work",
"color": "blue",
"is_favorite": false,
"url": "https://todoist.com/app/project/987654321"
}
]
}
Create a new project
Check todolist service status and connection
{
"status": "success",
"service": "todoist",
"connected": true,
"message": "Service is operational"
}
Barcode, QR code, and NFC tag scanning with product lookup and data management.
Record a new scan from a barcode, QR code, or NFC tag
{
"code": "123456789012",
"type": "barcode",
"location": {
"latitude": 37.7749,
"longitude": -122.4194
}
}
Get scan history for the authenticated user
Look up information about a specific code
{
"code": "123456789012",
"type": "UPC",
"product": {
"name": "Example Product",
"brand": "Example Brand",
"category": "Food",
"image_url": "https://example.com/image.jpg"
},
"scan_count": 5,
"last_scanned": "2025-05-30T10:00:00Z"
}
Get scan statistics for the authenticated user
{
"total_scans": 150,
"unique_codes": 75,
"most_scanned": {
"code": "123456789012",
"count": 8,
"product_name": "Example Product"
},
"scan_types": {
"barcode": 120,
"qr_code": 25,
"nfc": 5
},
"recent_activity": {
"last_7_days": 12,
"last_30_days": 45
}
}
Get detailed analytics for a specific barcode including scan frequency and location history
Update or create user-contributed product information
{
"name": "S-Balance",
"brand": "Vital Health",
"category": "Supplements",
"description": "Natural balance supplement",
"nutrition": {
"serving_size": "2 tablets",
"calories": 5
},
"ingredients": ["Magnesium", "Calcium", "Vitamin D3"]
}
Legacy endpoint for product updates (mobile app compatibility)
{
"name": "S-Balance",
"brand": "Vital Health",
"barcode": ""
}
Checks the health status of the API server.
No
{
"status": "healthy",
"timestamp": "2023-05-01T12:00:00Z"
}
200 OK Server is healthy
All API errors follow a consistent format:
{
"error": "Error message"
}
| Status Code | Description |
|---|---|
| 400 Bad Request | Missing or invalid request parameters |
| 401 Unauthorized | Missing or invalid authentication |
| 403 Forbidden | Insufficient permissions |
| 404 Not Found | Resource not found |
| 409 Conflict | Resource already exists |
| 500 Internal Server Error | Server error |
The API implements comprehensive rate limiting and performance optimizations:
Security: All endpoints require OAuth JWT authentication. Rate limit exceeded returns 429 Too Many Requests.
We provide client libraries for easy integration with the Myndy API:
For React Native mobile applications:
// Path: clients/mobile/myndyApi.js
// Include in your React Native project
Usage example:
import { MyndyApiClient } from './myndyApi';
const apiClient = new MyndyApiClient({
apiUrl: 'https://www.myndyai.com',
credentials: {
email: 'user@example.com',
password: 'secure-password'
}
});
// Upload health data
const result = await apiClient.uploadData({
type: 'health',
data: {
heartRate: 72,
steps: 10000,
sleepHours: 7.5
}
});
For AI assistants:
# Path: clients/ai/myndy_client.py
# Include in your Python project
Usage example:
from myndy_client import MyndyAiClient
client = MyndyAiClient(
api_url='https://www.myndyai.com',
credentials={
'email': 'ai@example.com',
'password': 'secure-password'
}
)
# Get latest user data
user_data = client.get_latest_data(user_id='user-id')
# Process with AI model
result = client.process_data(user_data)