API
The iOS app talks to one HTTP API. It is written in Go, runs as a single AWS Lambda function behind API Gateway, and stores everything in DynamoDB.
Open the reference →: every endpoint with its request, response and errors,
and every model. It is drawn from the contract,
shared/openapi/openapi.yaml,
each time this site is built, so it always matches the code that was merged.
To see how a request travels through the code, read How a request works.
Base URLs
| Stage | URL | Deployed by |
|---|---|---|
| Prod | https://api.caretosher.com | every merge to main |
| Dev | https://api-dev.caretosher.com | every push to an open pull request |
The API also still answers on api-v2.caretosher.com and api-v2-dev.caretosher.com, the names
it used while the original app owned api and api-dev. App builds released before the switch call
those names; they will be removed once no supported build does.
Every app endpoint lives under /v1, for example GET https://api.caretosher.com/v1/me.
/health and /flags sit outside it. (The contract's own servers list still holds placeholder
hosts; the app reads its base URL from ios/Config/{Dev,Prod}.xcconfig.)
Versions
There is one version, /v1. It replaced an earlier unversioned API, which was deleted in November
2026 (ADR 0013). A breaking change would
mean a /v2 path beside it.
Signing in
Every /v1 endpoint needs a signed-in caregiver, except POST /v1/feedback, where signing in is
optional.
- The app signs in with Amazon Cognito and sends the ID token (not the access token) as
Authorization: Bearer <token>. The API reads the caregiver's email and name from it. - API Gateway checks the token before the Lambda runs, and rejects a missing or bad one with
401. - The first request from a new caregiver creates their user record. There is no separate sign-up call.
What a caregiver may touch
Everything belongs to a care team. A caregiver can read or change a record only when they are a
member of that record's team, and some changes need the team's admin. The API works out the team
from the record itself, never from anything in the request. A caregiver who is not on the team gets
403.
Errors
Every error has the same shape:
{ "message": "not found" }
| Status | Meaning |
|---|---|
400 | The request body or a parameter is invalid (usually invalid body). |
401 | Not signed in, the token is bad, or the account is closed. |
403 | Signed in, but not on this record's care team, or not its admin. |
404 | The record does not exist, or it is archived, or its care team is closed. |
409 | The change conflicts with the record's state, such as editing an archived one. |
500 | Something failed on the server. The details are logged, never sent to the app. |
Groups
The reference groups endpoints like this:
| Group | What it covers |
|---|---|
| Account | The signed-in caregiver: who they are, changing their email, closing the account, feedback. |
| Care teams | Teams the caregiver belongs to, their members and roles. |
| Invitations | Inviting someone to a care team, and joining one with an invitation or a code. |
| Care receivers | The people a team looks after, their care instructions and emergency contacts. |
| Trackers | What a team tracks for a care receiver, and the templates to start from. |
| Schedules | When a tracker expects entries. |
| Entries | Logging, skipping and changing entries. |
| Home | What Home reads: what needs attention, what is coming up, the timeline, notes. |
| Coverage | Who is on duty, through assignments and coverage schedules. |
| Service | /health and /flags. |
Feature flags
GET /flags returns the flags from AWS AppConfig
(ADR 0005), set in
infra/lib/appconfig-content.ts.
Today there are two: v1_api, which is on in every stage and stays on so older TestFlight builds
keep working, and flags_demo, which does nothing.