--- tags: - service - josiedot - josie-health domain: api.josie.health status: active stack: - Crystal - Kemal - Redis auth: basic+bearer --- # Health API (api.josie.health) REST API for substance logging, metrics, drug information, and reminders. ## URLs - https://api.josie.health - Swagger UI: /v1/openapi.yaml ## Stack - Crystal 1.9.2 with Kemal web framework - Redis (data backend) - Shared libs: josie-health-lut, josie-health-utils ## Auth Basic Auth + Bearer Token (API keys with `jhapi_` prefix). ## Key Endpoints - `POST /v1/logs/substances` -- log a dose - `GET /v1/substances/{name}/info` -- drug info - `GET /v1/interactions/{sub1}/{sub2}` -- interaction check - `GET /v1/metrics/users/{id}/{endpoint}` -- user metrics - `POST/GET/DELETE /v1/aliases` -- command aliases - `POST/GET/DELETE /v1/reminders` -- webhook-based reminders - `GET/PUT /v1/timezone` -- user timezone - `GET /v1/datasets` -- public substance datasets ## Key Features - Rate limiting (configurable leaky bucket) - CSV dose format: `timestamp,user,substance,amount,route,annotation` - Webhook delivery for reminders - OpenAPI 3.0.3 spec ## Deployment - BuildConfig: `simple-logs-api`, port 3001 - Build: `oc start-build simple-logs-api --from-dir=. --follow` - Rollout: `oc rollout restart deployment/logs-api` - Multi-stage Alpine build, static binary `josie-health-core` ## Related - [[health-web]] - [[health-discord-bot]] - [[health-irc-bot]] - [[heartbeat]] - [[health-wrapped]] - [[health-cli]]