REST API β base URL: https://greendial.org Β· All endpoints return JSON unless noted.
Runs the live integration suite against this server: signup β login β chat β profile β settings β suggestions β activities β auth enforcement β cleanup. Creates a throwaway test account and deletes it at the end. Takes ~30β60 seconds (real LLM calls).
GreenDial is a personal health platform powered by Doc, a primary AI coordinator, and a team of specialist health agents. Doc guides conversations, builds the user's health profile, and routes domain-specific questions to the right agent. When a message matches two or more agent domains, Cross AI synthesizes perspectives from multiple specialists in parallel.
Agents also run on a server-side cron schedule (08:00 UTC daily), generating personalized check-in notifications for subscribed users. Each agent has its own dedicated chat tab in the UI, with a profile-building onboarding interview on first activation.
Authentication is username + passphrase for the app; HTTP Basic Auth for third-party integrations.
| ID | Name | Domain |
|---|---|---|
| diet | π₯ Diet | Nutrition, eating habits, weight management, hydration |
| exercise | πͺ Exercise | Fitness, movement, workouts, injury prevention |
| protect | π‘οΈ Protect AI | Immune resilience + disease prevention, screenings, risk factors |
| sleep | π΄ Sleep | Sleep quality, insomnia, circadian rhythm, sleep hygiene |
| mental_health | π§ Mind | Stress, anxiety, depression, mindfulness, resilience |
| relationships | π Relationships | Social connection, communication, loneliness, caregiving |
| environment | π Environment | Air quality, ergonomics, home/workplace health, nature |
| custom | βοΈ Custom | User-defined system prompt β any health topic |
| cross_ai | π Cross AI | Multi-domain synthesis β activated when 2+ domains match |
1. Via Doc (chat-triggered) β Doc checks keyword lists and emits **CALL_AGENT**. Single-domain β specialist. Two or more domains β Cross AI runs matched agents in parallel threads and synthesizes.
2. Via agent direct chat β Users open an agent's tab; the server routes to POST /chat/agent/{agent_id}. Each agent maintains its own transcript separate from Doc.
3. Via crontab (scheduled) β agent_runner.py at 08:00 UTC daily. Per-user, per-agent, 20-hour debounce. Results land in the notification bell.
| Field | Type | Description |
|---|---|---|
| username | string | Required |
| password | string | Required (passphrase) |
| create_new | bool | Set true to register |
| hipaa_waiver_accepted | bool | Required when registering |
| profile | object | Optional initial profile on signup |
user_id to persist profile updates.
| Field | Type | Description |
|---|---|---|
| text | string | User's message |
| user_id | string | Optional β links to saved profile |
| session_id | string | Optional β pass back to continue session |
X-Session-Token. Empty messages means nothing to say (no LLM cost when gated). Delivery is Doc chat only β not the notification bell.
| Field | Type | Description |
|---|---|---|
| user_id | query string | Required β must match the session token |
| force | query string | Admin only (1) β bypass time gates for testing |
"init": true (or empty text) to trigger the agent's welcome message and begin onboarding.
| Field | Type | Description |
|---|---|---|
| text | string | User's message. Empty or omitted β triggers intro. |
| user_id | string | Optional β for profile persistence |
| session_id | string | Optional session token |
| init | bool | Set true to request welcome message without saving a user turn |
X-Session-Token header from /auth.X-Session-Token. Allowed top-level keys: username, settings, profile, first_name, last_name, email, wallets. Nested objects are merged.
X-Session-Token.| Field | Description |
|---|---|
| primary_concern | Main health focus |
| health_conditions | Diagnoses, chronic conditions |
| medications | Current medications and supplements |
| allergies | Drug or food allergies |
| age | Age |
| weight | Weight |
| height | Height |
| location | City / region |
| diet_type | Diet style (e.g. keto, vegan, Mediterranean) |
| exercise_frequency | How often they exercise |
| exercise_type | Type of exercise |
| sleep_hours | Average nightly sleep |
| sleep_quality | Self-rated sleep quality |
| stress_level | Self-rated stress level |
| goals | Health goals |
| avatar | Emoji string or base64 data URL for profile picture |
| notes | Free-form notes |
Written by agents during onboarding and chat. Merged into the same profile object.
| Field | Agent |
|---|---|
| diet_type, dietary_restrictions, nutrition_goals, food_allergies | π₯ Diet |
| fitness_goals, fitness_level, exercise_limitations, preferred_workout_time | πͺ Exercise |
| immune_concerns, supplements, autoimmune_conditions, family_history, smoking_status, last_checkup, screenings_due | π‘οΈ Protect AI |
| sleep_issues, bedtime, wake_time, sleep_aids, sleep_disorders | π΄ Sleep |
| mental_health_concerns, therapy_status, coping_strategies, mindfulness_practice | π§ Mind |
| relationship_status, social_support, loneliness_level, relationship_goals | π Relationships |
| living_environment, environmental_concerns, workplace_setup, climate_region | π Environment |
| Field | Values | Description |
|---|---|---|
| doc_style | questioning Β· professional Β· friendly | Doc's conversational tone |
| notifications_enabled | true Β· false | All notifications on/off, including daily agent check-ins (see Agents below) |
| agent_prefs | object | Per-agent onboarding/preference state, e.g. {"sleep": {"onboarded": true}} |
| custom_agent_prompt | string (max 2000) | System prompt for the βοΈ Custom agent chat tab |
There's no subscription API to manage β every user gets daily check-ins from all specialist agents automatically once notifications are enabled (see notifications_enabled under Settings above). Doc still routes conversations to the right specialist (or several, via Cross AI) behind the scenes; specialists also each have a dedicated chat tab. First activation of a tab triggers a 3-turn onboarding interview that fills domain-specific profile fields.
agent_runner.py β 08:00 UTC daily, 20-hour debounce per user per agent (weekly for protect and cross_ai, via each agent's CRON_CADENCE_HOURS).
Logs to /var/log/greendial_agents.log. Manual run:python3 agent_runner.py --agent protect --user user_alice --dry-run
Each day GreenDial generates up to 3 personalized Suggestions per user (exercise, diet, social) β separate from the notification bell. A Suggestion becomes an Activity when accepted. UB-backed suggestions (see below) are surfaced first, ahead of LLM-generated ones. See About & FAQ for the plain-language explanation of Universal Bounty.
status: "active"."completed": sets completed_at, snapshots the user's linked wallet address into wallet_snapshot, and β if the activity has a price β sets payment_pending: true. On "abandoned": only valid from "active"; sets abandoned_at.
Anyone can sponsor a Universal Bounty β friends and family (signed-in session on /sponsor), or insurers, employers, and government programs with X-API-Key: <DEMAND_API_KEY>. A UB targets an explicit list of user_ids; matching users see it as a priced Suggestion. Supports recurrence: once | weekly | monthly.
Demand-side buyers can pay members per verified fitness action instead of (or in addition to) a one-shot fixed price. Set pricing_model: "cpaa" with a per-action rate. When a member logs GPS miles in a stake league that matches the action type, GreenDial credits their ledger and flags admin settlement.
action_type values: run_1mi, run_3mi, bike_3mi, bike_10mi, walk_1mi, walk_3mi, steps_5k, steps_10k, workout_30min, any_fitness.
Members join fitness groups with a stake. Scoring is consistency (days the distance goal is hit). Top half of the leaderboard get their stake refunded at settle. CPAA payouts stack on top so active players can earn more than they wager once demand partners are live.
X-Session-Token (or the Sponsor UI). No demand API key required./generate for previews.GET /bounty/directory.POST /bounty/autocomplete (public) returns chips, activity text, and suggested price. Default: βTake a walk sometime in the next dayβ.A minimal integration for a new demand-side sponsor β or use /sponsor in the browser.
Don't have a key yet? See the FAQ for how to request one. Remember: UB is honor-system payment, not on-chain escrow β see the note below.
X-API-Key or session + sponsor_user_id.
bounty_discoverable enabled. Query ?q= optional. No secrets returned.description for autocomplete-style drafts, or health_area for profile-aware institutional suggestions. Does not create the UB.
payment_pending on completion β settling payment to the user is the sponsor's responsibility, off-platform.Use Authorization: Basic <base64(username:passphrase)> for machine-to-machine profile sync.
Machine-readable specs for tooling, code generation, and AI agents that interact with this API.
| File | URL | Format |
|---|---|---|
| OpenAPI 3.1 | /spec/openapi.yaml | Full endpoint schemas, request/response models |
| Arazzo 1.0 | /spec/arazzo.yaml | Workflow descriptions: chat dispatch, cron notifications, onboarding, profile updates |
Doc is the primary coordinator. Its prompt is assembled dynamically each turn from profile state, conversation stage, and optional agent context.
**PROFILE_UPDATE** {"field": "value"} β persists health data**CALL_AGENT** {"agent": "sleep"} β triggers a specialist sub-call
All agents (Doc and specialists) detect message length and tone from each user turn and inject a style-matching instruction. Very short messages get terse replies; detailed messages get thorough ones. Casual phrasing gets casual responses.
GreenDial is open source. Questions? mickey@theservicesexchange.com