Skip to main content

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​

StageURLDeployed by
Prodhttps://api.caretosher.comevery merge to main
Devhttps://api-dev.caretosher.comevery 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" }
StatusMeaning
400The request body or a parameter is invalid (usually invalid body).
401Not signed in, the token is bad, or the account is closed.
403Signed in, but not on this record's care team, or not its admin.
404The record does not exist, or it is archived, or its care team is closed.
409The change conflicts with the record's state, such as editing an archived one.
500Something failed on the server. The details are logged, never sent to the app.

Groups​

The reference groups endpoints like this:

GroupWhat it covers
AccountThe signed-in caregiver: who they are, changing their email, closing the account, feedback.
Care teamsTeams the caregiver belongs to, their members and roles.
InvitationsInviting someone to a care team, and joining one with an invitation or a code.
Care receiversThe people a team looks after, their care instructions and emergency contacts.
TrackersWhat a team tracks for a care receiver, and the templates to start from.
SchedulesWhen a tracker expects entries.
EntriesLogging, skipping and changing entries.
HomeWhat Home reads: what needs attention, what is coming up, the timeline, notes.
CoverageWho 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.