Miara/ Developers

Your family’s log, from your own code.

The Miara API lets you read and add to your family’s log from your own scripts, devices and bridges. What you send shows up in the app for everyone in your household, marked with the connection that sent it.

Install the Miara bridge skill. If you’re in Claude Code, run `claude plugin marketplace add noahpresler/miara-bridge`, then `claude plugin install miara-bridge@miara`. If you’re in another agent, run `npx skills add noahpresler/miara-bridge --skill miara-bridge` and select your agent. Use one installation method. You can read the skill directly at https://github.com/noahpresler/miara-bridge/blob/main/skills/miara-bridge/SKILL.md (raw: https://raw.githubusercontent.com/noahpresler/miara-bridge/main/skills/miara-bridge/SKILL.md). Then use the Miara bridge skill to help me send my device’s data to Miara.

For any coding agent
Base address
https://getmiara.com/api/v1
Reference
openapi.json, OpenAPI 3.1
For agents
llms.txt, this page as plain text
Try it first
The sandbox, a public token for a made-up family
On this page 12 sections
  1. What you can do
  2. Get a token
  3. Try the sandbox
  4. Writes and retries
  5. Errors and limits
  6. Readings and metrics
  7. Overlapping sleeps
  8. Keeping a bridge current
  9. Plans in Up next
  10. Baby monitors and live video
  11. Endpoints
  12. For agents and tools

What you can do

A connection is a token you make in the app for one job: a script that adds last night’s sleep from your baby monitor, a button by the changing table, a log of pumping sessions from a smart pump. You choose what each one may do.

Read the log
Entries, readings, insight cards and what’s due next, for the children you pick.
read
Add entries
Sleeps, bottles, nursing, diapers and pumps, up to 500 at a time.
write:events
Add readings
Room temperature, heart rate, sleep stages, or a metric of your own.
write:observations
Send plans
A feeding plan, a medicine schedule or a one-off step, shown as what’s next on Today. How plans work.
write:plans
Baby monitor
Register a camera, upload fresh snapshots and stream live video over WebRTC, WHEP or HLS. How live video works.
write:monitors

Bridges run on your machine

A bridge is a small program you run yourself, on your computer or a home server. It signs in to a device’s own service with your login, picks up what’s new, and sends it to Miara. Your device logins stay with you: Miara never asks for them and never stores them. To start one, use the miara-bridge template, or paste the agent prompt into your coding agent and it will write one with you.

Get a token

  1. Open the Miara appGo to Profile → Siri, assistants and connections → New connection. Parents and caregivers can make one.
  2. Name it after what will use itLike “Nursery monitor”. Everything it writes shows “via Nursery monitor” in the log.
  3. Pick the children and what it may doRead the logreadAdd entrieswrite:eventsAdd readingswrite:observationsSend planswrite:plansBaby monitorwrite:monitors
  4. Copy the tokenIt starts with miara_pat_ and is shown once. It lasts 90 days unless you pick another length.
Who’s told
When someone makes a token that can write, the other caregivers are told.
Turning it off
Any time, from the same screen. The token stops working straight away.
Undoing it
One tap in the app removes everything a connection wrote. The removed entries stay in your household’s history.

Try the sandbox

Build and test against a made-up family before you touch your own. Every night it goes back to 15 days of made-up sleeps, feeds, diapers and readings, and the dates move with it. Anyone can use this token, so never send anything real to it.

Sandbox family (synthetic)Resets 09:41 UTC
miara_pat_5a4d0b0c5a4d0b0c5a4d0b0c5a4d0b0c5a4d0b0c
Children
Juniper (sample), about 5 months, and Basil (sample), about 2. Their ids are in GET /children.
Limits
30 requests a minute shared by everyone, 10 from any one address. 500 entries and 5,000 readings a day.
Can do
read, write:events and write:observations. It has no insight cards, and its next feed and nap follow a fixed rule.

Put it in your shell once, and every example below works as written:

shell
export MIARA_TOKEN=miara_pat_5a4d0b0c5a4d0b0c5a4d0b0c5a4d0b0c5a4d0b0c

Writes and retries

Send the token as Authorization: Bearer. Bodies and answers are JSON, and times are ISO 8601 with an offset, like 2026-11-17T06:05:00Z.

Every POST needs an Idempotency-Key header: 1 to 255 visible characters, new for each change. If the connection drops, send the same request with the same key: within 24 hours you get the first answer back, marked Idempotent-Replayed: true, and nothing is saved twice. The same key with a different body is refused.

Entries also carry your own source_event_id. Send an entry again with the same one, tomorrow or next month, and it updates that entry instead of adding another.

Errors and limits

A refusal always has the same shape: a code for your program to act on, and a message to show a person.

Response
HTTP/1.1 429
retry-after: 12
{
  "error": {
    "code": "rate_limit",
    "message": "Too many requests this minute. Wait and send it again."
  }
}
invalid
400
The request didn’t check out. The message says what to change.
token
401
The token is missing, wrong, expired or turned off.
scope, child
403
The token can’t do this, or isn’t for that child.
too_large
413
Over 4 MB. Send fewer rows at once.
not_found
404
No such endpoint, or no entry with that id for this token.
already_ended
409
The sleep already ended. The message says when; nothing was changed.
deleted
410
Someone deleted the sleep in Miara; nothing was changed.
idempotency
422
This key was used for a different request.
rate_limit
429
Over a minute’s limit. Wait Retry-After seconds, then send it again with the same key.
daily_limit
429
Over a day’s limit. Retry-After points to midnight UTC.
server_error
500
Nothing was changed. Retrying with the same key is safe.

Limits

Requests
120 a minute for each token, 300 for each family.
Waits
GET /wait has its own: 20 a minute for each token, one open at a time.
Size
Up to 500 rows and 4 MB a request.
Price
Free.

Readings and metrics

A reading is one number or choice at one minute: the room at 20.5 °C at 4:00 AM. Each uses a metric, either one of the core set or one you declare.

Core
sleep_stage, heart_rate, spo2, breathing_rate, room_temp_c, humidity, sound_db. Each has its unit and range in GET /metrics.
Your own
Named x.<source>.<name>, like x.nursery.score, and declared with POST /metrics before you send it. A metric Miara doesn’t know is refused.
Vitals
Heart rate, oxygen and breathing rate are kept as records and charted, and never interpreted. Miara doesn’t use them in insights or say what they mean.

Overlapping sleeps

When a sleep you send overlaps one someone logged in the app, Miara doesn’t keep both. The person’s entry stays, and yours comes back suggested: they’re asked whether to take your times. Once they answer, or if they delete it, sending it again comes back skipped, so a bridge never brings it back.

10 PM12 AM2 AM4 AM6 AM8 AMLogged in Miara by Sam · 11:30 PM–6:10 AMSent by Nursery monitor · 11:40 PM–6:05 AM → suggested10 PM12 AM2 AM4 AM6 AM8 AMSam, in Miara · 11:30 PM–6:10 AMNursery monitor · 11:40 PM–6:05 AMsuggested

One night, two records. Sam keeps 11:30 PM–6:10 AM or takes the monitor’s times.

Keeping a bridge current

Three habits keep what a bridge sends close to what happened, without sending the same thing over and over.

Sync when someone opens the app

A bridge that keeps running can wait on GET /wait between syncs instead of sleeping. When a parent or caregiver opens Miara or taps a monitor, it answers woken: true with a reason (app_opened, monitor_watch, monitor_stop or monitor_snapshot) within a second, and the bridge acts while they’re looking. Otherwise it answers woken: false after up to 25 seconds, and the bridge waits again or syncs on its own schedule.

shell
while true; do
  ./sync.sh   # your bridge: fetch from the device, send what changed
  curl -s -G https://getmiara.com/api/v1/wait -H "Authorization: Bearer $MIARA_TOKEN" -d timeout=25 > /dev/null
done

Send a sleep while it’s going on

Send a sleep without ended_at as soon as it starts, so the app shows the baby asleep. When it ends, send it again with the same source_event_id and its ended_at: the entry is updated, not added twice.

It runs as the family’s timer until your ended_at arrives or someone ends it in the app, whichever comes first. If someone is already timing a sleep when yours starts, yours joins their timer instead of waiting as a suggestion, and the result says joined. Your ended_at ends their timer; their start and wakes stay.

End a sleep someone else started

A nap timed on a phone can end from your device too. Find the running sleep in GET /events (a sleep with no ended_at) and send its id and ended_at to POST /events:end. The app shows it ended, from your connection’s name. A sleep that already ended comes back already_ended, so two people ending the same nap never end it twice.

What people change stays

Once someone changes an entry’s start, end or wakes in the app, later sends don’t move that part back. A sleep they ended isn’t reopened, and an end they set stands. The result lists what Miara kept in kept, with the entry’s times as they are now, so a bridge can stop treating that sleep as open.

JSON, then again when it ends
{ "source_event_id": "nap-2026-11-17-1305", "child_id": "5a4d0b0c-0000-4000-8000-000000000011", "kind": "sleep",
  "started_at": "2026-11-17T18:05:00Z" }

{ "source_event_id": "nap-2026-11-17-1305", "child_id": "5a4d0b0c-0000-4000-8000-000000000011", "kind": "sleep",
  "started_at": "2026-11-17T18:05:00Z", "ended_at": "2026-11-17T19:20:00Z" }

Read back a window, send what changed

On every run, fetch the last few hours from the device rather than only what’s new since the last run, and compare with what you sent before. Send only the entries that are new or different. A sleep that ended, or one the device corrected later, is picked up on the next run, and nothing unchanged is sent again.

Plans in Up next

A plan is a routine a family has been given: a feeding plan from a lactation visit, a medicine schedule, a one-off step before an appointment. Send it once. Miara works out what’s next from the family’s own log and shows that step on Today, so whoever has the baby sees it without opening another app.

Miara’s forecast keeps the top of the card. The plan’s next step follows, in the words you sent, marked with your connection’s name. Logging the bottle ticks it off and the pump comes next.

Send a plan

Send the whole plan as one document to POST /plans. It needs the write:plans permission on the token. Sending the same key again for the same child replaces it, so keep the key stable and send the plan whenever it changes.

curl
curl -X POST https://getmiara.com/api/v1/plans \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -H "Idempotency-Key: plan-triple-feeding-1" \
  -H "Content-Type: application/json" \
  -d '{
  "version": 1,
  "key": "triple-feeding",
  "child": "5a4d0b0c-0000-4000-8000-000000000011",
  "title": "Feeding plan",
  "ends": "2026-12-14",
  "rules": [{
    "id": "round",
    "repeat": { "every": "3h", "from": { "last": "feed", "edge": "start" },
                "night": { "between": ["23:00", "05:00"], "every": "4h" } },
    "steps": [
      { "id": "nurse", "kind": "nurse", "note": "Both sides" },
      { "id": "top", "kind": "bottle", "label": "Top up",
        "amount": { "value": 30, "unit": "ml" }, "within": "10m" },
      { "id": "pump", "kind": "pump", "duration": "15m", "within": "20m",
        "skip": { "between": ["23:00", "05:00"] } }
    ]
  }],
  "items": [
    { "id": "weigh", "kind": "custom", "label": "Weigh at home", "by": "2026-12-01T14:00:00-05:00" }
  ]
  }'
Response
{ "id": "7c1d…", "child_id": "5a4d0b0c-0000-4000-8000-000000000011", "key": "triple-feeding",
  "status": "created", "plan_status": "active" }

How a plan runs

Rounds
A round comes every so long after the last entry of a kind ("from": { "last": "feed", "edge": "start" }), or at clock times like ["08:00", "20:00"] in the child’s time zone. night sets a different gap overnight.
Steps
The first step opens when the round is due; each one after opens when the one before it is logged. within is how long a step has, 30 minutes unless you say. skip leaves a step out between two times.
Ticked off
A step is done when someone logs that kind in its window, in the app, by voice or through another connection. The amount doesn’t have to match: the step is a reminder, not a check.
Late
A step nobody logged stays the next step and says when it was due. When the next round starts, it’s marked not logged in the plan’s history. No countdowns, no red.
One-off steps
items are steps with a by time and no repeat, like a weigh-in before a visit. A custom step is ticked off by hand.
Step kinds
nurse, bottle, pump, sleep, diaper, dose, tummy_time, skin_to_skin, solids, activity, custom. A dose names a medicine the family already has in Miara, and an activity one of their own activities.

Read it back

GET /plans returns each plan with where it stands: its next step, today’s rounds with every step done, next, missed or skipped, and a today count per step, enough to say “6 of 8 pumps today”. GET /wait wakes you when a plan changes.

The family stays in charge

Their words
Miara shows a plan as written and never changes an amount, adds a step or gives advice. Only send what the family or their clinician gave them.
Pause and end
Any parent or caregiver can pause a plan or end it in the app.
Yours to change
Only the connection that sent a plan can replace or end it over the API. Everyone in the household sees which connection it came from.
Built to grow
Plans carry a version. An app that meets a step kind it doesn’t know shows your label and lets the family tick it off, so a plan still works on an older phone.

Baby monitors and live video

A bridge with write:monitors can show a child’s nursery camera in Miara — on Today and inside the active sleep card — alongside the latest snapshot and recent room readings (room_temp_c, humidity and sound_db from the last 30 minutes). Tapping Play starts live video muted by default, with optional nursery audio and full-screen zoom.

Register the camera

Call POST /monitors once per child when your bridge starts, and again whenever camera status (online, offline, camera_off or busy), night vision or capabilities change. The public sandbox token doesn’t include write:monitors, so test entries and readings on the sandbox first and connect live video against your own family.

curl
curl -X POST https://getmiara.com/api/v1/monitors \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -H "Idempotency-Key: monitor-nursery-1" \
  -H "Content-Type: application/json" \
  -d '{
  "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
  "label": "Nursery camera",
  "capabilities": ["video", "audio", "snapshot"],
  "transport": "webrtc_signaled",
  "status": "online",
  "night_vision": true
  }'
Response
{ "monitor_id": "2c8d…", "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
  "label": "Nursery camera", "status": "online" }

Pick a transport

webrtc_signaled
Best for a bridge running at home behind NAT with no open ports. Miara relays the SDP offer and answer over HTTPS and provides ephemeral TURN credentials alongside STUN when needed.
whep
For a reachable WHEP endpoint such as go2rtc or MediaMTX. The app sends POST stream_url with Content-Type: application/sdp and Accept: application/sdp (plus Authorization from stream_auth), and sends DELETE to the returned Location URL when video closes.
hls
For a camera or proxy serving a reachable HLS .m3u8 playlist. Played natively on iOS and Android with an optional Authorization header from stream_auth.
snapshot_only
Shows the latest still image uploaded with POST /monitors:snapshot, without live streaming.

How signaled WebRTC works

Wait for a viewer
Keep a persistent GET /wait loop running under LaunchAgent or systemd rather than cron. When a parent or caregiver taps Play, GET /wait wakes within a second with reason: "monitor_watch". Call GET /monitors:sessions right away — the app times out if video doesn’t connect within 20 seconds.
Answer with send-only media
Each requested session carries offer_sdp (Unified Plan, recvonly video plus recvonly audio when audio is in capabilities, with ICE candidates already gathered) and ice_servers. Create a peer connection using those ice_servers, attach send-only video (H.264 or VP8; H.264 uses hardware decode on phones) and optional Opus audio, wait for ICE gathering to finish (non-trickle — there is no trickle ICE endpoint), and post answer_sdp with state: "answered" to POST /monitors:answer. Send active once connected, or busy, offline or failed with error_code (stream_limit, camera_off, offline or failed) if the camera can’t stream.
Stop when nobody’s watching
The app heartbeats every 15 seconds while watching, and wakes GET /wait with reason: "monitor_stop" when video closes. Call GET /monitors:sessions on monitor_stop and periodically while streaming — sessions with no heartbeat for 45 seconds are closed automatically. Once a session disappears from the list, close its peer connection and stop pulling video from the camera.
Snapshots
Upload a fresh JPEG, PNG or WebP (at most 1.5 MB decoded) to POST /monitors:snapshot so Today shows a recent still before Play is tapped, and refresh it when GET /wait wakes with reason: "monitor_snapshot".

Privacy and family controls

Parents and caregivers only
Viewers in a household never see the monitor or its snapshots.
Live camera toggle
A parent or the connection’s maker can turn Live camera off per connection in Miara’s connection settings without stopping sleep entries or room readings. Turning it off ends active sessions immediately and wakes the bridge with monitor_stop.
Nothing recorded
Live video and audio travel directly between your bridge and the phone (or via an ephemeral TURN relay). Miara never records video or audio, never opens the phone’s microphone, and keeps only the single latest snapshot in private storage — deleted on POST /monitors:remove or when the connection is removed.

Endpoints

All under https://getmiara.com/api/v1. The OpenAPI document has every field.

GET/children

The children this token is for, oldest first.

Use their ids as child_id everywhere else. A child kept for history can be read but not written for. A token that only writes can call this too, so a bridge doesn’t need read to find its child.

Any live token.

curl
curl https://getmiara.com/api/v1/children \
  -H "Authorization: Bearer $MIARA_TOKEN"
Response
HTTP/1.1 200
{
  "children": [
    {
      "id": "5a4d0b0c-0000-4000-8000-000000000012",
      "name": "Basil (sample)",
      "birth_date": "2024-09-08",
      "time_zone": "America/New_York",
      "history_only": false
    },
    {
      "id": "5a4d0b0c-0000-4000-8000-000000000011",
      "name": "Juniper (sample)",
      "birth_date": "2026-06-10",
      "time_zone": "America/New_York",
      "history_only": false
    }
  ]
}

GET/events

A child’s entries, newest first, from everyone in the family.

Deleted entries are left out. An entry this token wrote carries the source_event_id it was sent with.

Needs read.

child_idrequired
A child’s id from /children.
since, until
Only what started in this range. ISO 8601 with an offset.
kind
Comma-separated: sleep,bottle. Up to 20.
limit
1 to 500. 100 if left out.
cursor
The next_cursor from the last page, as it came. It’s null on the last page.
curl
curl -G https://getmiara.com/api/v1/events \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -d child_id=5a4d0b0c-0000-4000-8000-000000000011 \
  -d kind=sleep \
  -d limit=1
Response
HTTP/1.1 200
{
  "events": [
    {
      "id": "0b9e6a52-3c1d-4f7a-9b2e-6d1a8c4e7f30",
      "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
      "kind": "sleep",
      "started_at": "2026-11-16T00:10:00Z",
      "ended_at": "2026-11-16T10:05:00Z",
      "time_zone": "America/New_York",
      "details": {},
      "source": "app",
      "created_at": "2026-11-16T10:07:00Z"
    }
  ],
  "next_cursor": "eyJ0IjoiMjAyNi0xMS0xN1QwNDoxMDowMFoifQ"
}

POST/events:batch

Saves up to 500 sleeps, bottles, nursing sessions, diapers and pumps.

Each entry stands alone: a bad one comes back rejected with its reason and the rest are saved. Send the same source_event_id again to change an entry.

Needs write:events and an Idempotency-Key.

source_event_idrequired
Your own id for the entry, up to 128 letters, digits and ._:-.
child_id, kindrequired
Kind is sleep, bottle, nursing, diaper or pump.
started_atrequired
No more than 5 minutes ahead or 3 years back. ended_at is for sleeps.
details
What the kind needs: a bottle’s volume_ml and contents, a diaper’s diaper. See the OpenAPI document.
note
What a person typed about the entry in the device’s app, up to 2,000 characters. Shown on the entry. Leave it out and the entry keeps the note it has.
raw
What your device sent, kept as it came. Up to 16 KB.
curl
curl -X POST https://getmiara.com/api/v1/events:batch \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -H "Idempotency-Key: nursery-2026-11-16-0515" \
  -H "Content-Type: application/json" \
  -d '{
  "entries": [
    {
      "source_event_id": "night-2026-11-15",
      "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
      "kind": "sleep",
      "started_at": "2026-11-16T00:30:00Z",
      "ended_at": "2026-11-16T10:00:00Z"
    },
    {
      "source_event_id": "bottle-2026-11-16-0515",
      "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
      "kind": "bottle",
      "started_at": "2026-11-16T10:15:00Z",
      "details": {
        "volume_ml": 120,
        "contents": "formula"
      }
    },
    {
      "source_event_id": "diaper-2026-11-16-0520",
      "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
      "kind": "diaper",
      "started_at": "2026-11-16T10:20:00Z",
      "details": { "diaper": "wet" }
    }
  ]
  }'
Response
HTTP/1.1 200
{
  "results": [
    {
      "source_event_id": "night-2026-11-15",
      "status": "suggested"
    },
    {
      "source_event_id": "bottle-2026-11-16-0515",
      "status": "saved",
      "id": "6f2d81c4-95a7-4e0b-8c3f-1b7e2a9d4c60"
    },
    {
      "source_event_id": "diaper-2026-11-16-0520",
      "status": "saved",
      "id": "b3e07a19-4c62-4d8f-a5b1-7e9c20d6f415"
    }
  ]
}
saved, updated, unchanged
New, changed, or the same as last time.
suggested
It overlaps a sleep someone logged, and waits for them. See overlapping sleeps.
skipped
Someone deleted it in Miara or answered its suggestion, so it isn’t brought back.
rejected
Not saved. error says why.

POST/events:end

Ends the sleep that’s running for a child, whoever started it.

For a nap timed on a phone at the crib and ended from somewhere else, like a display in the kitchen. Name the sleep by the id from GET /events: a sleep with no ended_at. The app shows it ended and by which connection (“Ended from Kitchen display”), and anyone can change the end or set the sleep going again. If the baby is awake in a paused sleep, it ends when that wake began, as in the app; the answer has the end it set. A sleep that already ended is a 409 with already_ended, one deleted in Miara a 410 with deleted, and nothing changes.

Needs write:events and an Idempotency-Key.

idrequired
The running sleep’s id, from GET /events.
ended_atrequired
When the baby woke. Not before the sleep started, and no more than 5 minutes ahead.
curl
curl -X POST https://getmiara.com/api/v1/events:end \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -H "Idempotency-Key: kitchen-end-2026-11-16-1042" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "0b9e6a52-3c1d-4f7a-9b2e-6d1a8c4e7f30",
  "ended_at": "2026-11-16T15:42:00Z"
  }'
Response
HTTP/1.1 200
{
  "id": "0b9e6a52-3c1d-4f7a-9b2e-6d1a8c4e7f30",
  "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
  "status": "ended",
  "started_at": "2026-11-16T14:20:00Z",
  "ended_at": "2026-11-16T15:42:00Z"
}

GET/observations

A child’s readings from every connection in the family, newest first.

Needs read.

child_idrequired
A child’s id from /children.
metric
Comma-separated: room_temp_c,humidity. Up to 20.
since, until, limit, cursor
As for /events. Up to 500 a page, 500 if left out.
curl
curl -G https://getmiara.com/api/v1/observations \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -d child_id=5a4d0b0c-0000-4000-8000-000000000011 \
  -d metric=room_temp_c,humidity \
  -d limit=2
Response
HTTP/1.1 200
{
  "readings": [
    {
      "id": "a41c0e77-2b9f-4d35-8e6a-3f50c1d27b98",
      "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
      "metric": "room_temp_c",
      "started_at": "2026-11-16T09:00:00Z",
      "value": 20.5,
      "unit": "°C",
      "connection": "Sandbox token"
    },
    {
      "id": "c7d93f12-6e48-4a0b-b1d5-92e8a4f6c013",
      "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
      "metric": "humidity",
      "started_at": "2026-11-16T09:00:00Z",
      "value": 46,
      "unit": "%",
      "connection": "Sandbox token"
    }
  ],
  "next_cursor": "eyJ0IjoiMjAyNi0xMS0xN1QwOTowMDowMFoifQ"
}

POST/observations:batch

Saves up to 500 readings, all or nothing.

If one reading is refused, none are saved. One reading a minute per child and metric: sending the same minute again replaces it.

Needs write:observations and an Idempotency-Key.

child_id, metric, valuerequired
A core metric or one you declared. A number in its range, or one of its choices.
started_atrequired
To the minute.
ended_at
For metrics that last, like sleep_stage. Up to 24 hours after started_at.
curl
curl -X POST https://getmiara.com/api/v1/observations:batch \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -H "Idempotency-Key: nursery-readings-2026-11-16-0400" \
  -H "Content-Type: application/json" \
  -d '{
  "readings": [
    {
      "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
      "metric": "room_temp_c",
      "started_at": "2026-11-16T09:00:00Z",
      "value": 21.5
    },
    {
      "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
      "metric": "x.nursery.score",
      "started_at": "2026-11-16T09:00:00Z",
      "value": 82
    }
  ]
  }'
Response
HTTP/1.1 200
{ "saved": 2, "received": 2 }

GET/metrics

The metrics a reading can use: the core set and the ones this family’s connections declared.

Any live token.

curl
curl https://getmiara.com/api/v1/metrics \
  -H "Authorization: Bearer $MIARA_TOKEN"
Response
HTTP/1.1 200
{
  "core": [
    {
      "metric": "heart_rate",
      "label": "Heart rate",
      "unit": "bpm",
      "min": 20,
      "max": 300,
      "needs_end": false,
      "vital": true
    },
    … 6 more
  ],
  "family": [
    {
      "metric": "x.nursery.score",
      "label": "Sleep score",
      "unit": "points",
      "min": 0,
      "max": 100,
      "needs_end": false,
      "connection": "Sandbox token"
    }
  ]
}

POST/metrics

Declares a metric of your own, or changes one you declared.

Named x.<source>.<name>: a number range (min, max, unit) or 2 to 12 one-word choices. Only the connection that declared it can change it.

Needs write:observations and an Idempotency-Key.

curl
curl -X POST https://getmiara.com/api/v1/metrics \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -H "Idempotency-Key: declare-nursery-score-1" \
  -H "Content-Type: application/json" \
  -d '{
  "metric": "x.nursery.score",
  "label": "Sleep score",
  "unit": "points",
  "min": 0,
  "max": 100
  }'
Response
HTTP/1.1 200
{ "metric": "x.nursery.score", "saved": true }

GET/insights

A child’s insight cards, newest first, as the app shows them.

A sleep card is written for one parent, so a token sees it only if that parent made the token. The sandbox has no cards, so there the list is empty.

Needs read.

child_idrequired
A child’s id from /children.
since
Only cards from this local date on: 2026-11-01.
limit
1 to 200. 30 if left out.
curl
curl -G https://getmiara.com/api/v1/insights \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -d child_id=5a4d0b0c-0000-4000-8000-000000000011 \
  -d since=2026-11-01
Response, in the sandbox
HTTP/1.1 200
{ "insights": [] }

GET/status

What’s due for a child: the next feed, the next nap or bedtime, and the sleep running.

For a screen in the house, like a kitchen display. The same answer the assistant gets when it checks on the baby. next_feed is when the baby’s usual gap since the last feed is up, and next_nap the likely window for the next sleep, as the family’s phones last worked them out; based_on says whether that comes from the baby’s own days or the typical window for the age. Either is null when there’s no forecast that still stands, and next_nap is null while a sleep is running. Show them as “around” and “likely”, never as a schedule. due_date is the family’s due date, and corrected_age the age counted from it (weeks, months, days) for a baby born before 37 weeks and under 2, otherwise null; her age from birth is the one to say aloud. Times are UTC: show them in time_zone. In the sandbox the forecasts follow a fixed rule (a feed 3 hours after the last, a nap 1h 45m to 2h 15m after the last wake). Once a minute is plenty, and GET /wait says when someone opens the app.

Needs read.

child_idrequired
A child’s id from /children.
curl
curl -G https://getmiara.com/api/v1/status \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -d child_id=5a4d0b0c-0000-4000-8000-000000000011
Response, between naps
HTTP/1.1 200
{
  "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
  "time_zone": "America/New_York",
  "now": "2026-11-16T15:40:00Z",
  "due_date": null,
  "corrected_age": null,
  "next_feed": {
    "expected_at": "2026-11-16T16:25:00Z",
    "due": false,
    "bottle": true,
    "last_feed_at": "2026-11-16T13:25:00Z",
    "based_on": "own_history"
  },
  "next_nap": {
    "kind": "nap",
    "nap_number": 2,
    "opens_at": "2026-11-16T16:50:00Z",
    "closes_at": "2026-11-16T17:20:00Z",
    "woke_at": "2026-11-16T15:05:00Z",
    "state": "upcoming",
    "based_on": "own_history"
  },
  "sleep_running": null,
  "last_feed": { "event_id": "…", "kind": "bottle", "started_at": "2026-11-16T13:25:00Z", "minutes_ago": 135, "volume_ml": 120, "contents": "formula" },
  "last_diaper": { "event_id": "…", "started_at": "2026-11-16T14:55:00Z", "minutes_ago": 45, "diaper": "wet" },
  "last_sleep": { "event_id": "…", "started_at": "2026-11-16T13:50:00Z", "ended_at": "2026-11-16T15:05:00Z", "in_progress": false, "minutes_ago": 110, "minutes_asleep": 75 }
}

GET/wait

Holds the request until someone opens Miara or asks to watch a monitor, or until the timeout.

For a bridge that keeps running. Call it between syncs instead of sleeping: it answers woken: true with reason (app_opened, monitor_watch, monitor_stop or monitor_snapshot) within a second of someone opening the app or tapping a monitor, and woken: false when the time is up. Act on reason, then call it again. One open wait a token; a new call ends the older one. An older Miara answers 404, so treat that as “not supported” and sleep instead.

Any live token.

timeout
Seconds to wait, 1 to 25. 25 if left out.
curl
curl -G https://getmiara.com/api/v1/wait \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -d timeout=25
Response, when woken
HTTP/1.1 200
{ "woken": true, "reason": "app_opened" }

GET/plans

The family’s care plans: the document, where it stands today and who sent it.

Plans a family or a connected assistant saved, newest change first. Each has its document as it was sent, its status (active, paused or ended) and from, the name of the connection or assistant that sent it. Plans that ended are left out unless you ask for status=ended. An active plan also says where it stands today, from what the family logged, in the child’s time zone (time_zone): next is the step to do now (type next, with by, late and a text like “By 9:35 AM”), or when the next round is (waiting), or paused or ended. rounds are today’s rounds (and the one still open from yesterday), each with its due time and its steps, every step done (with logged_at and the event_id that counted), next, upcoming, missed or skipped. items are the one-off steps, the same way. today counts each step, so “6 of 8 pumps” is done of total. A step the family ticks off by hand in the app counts as done. A paused plan says who paused it (paused_by). While a timer of a step’s kind is running (a sleep, say), that step counts as started, and the step after it is next with then: true and no by, until the timer ends.A parent or caregiver pauses, resumes and ends a plan in Miara, so read this again when GET /wait wakes you.

Needs read.

child_id
Only this child’s plans. Leave it out for every child the token can read.
status
active, paused or ended. Default: active and paused.
curl
curl -G https://getmiara.com/api/v1/plans \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -d child_id=5a4d0b0c-0000-4000-8000-000000000011
Response
HTTP/1.1 200
{
  "plans": [
    {
      "id": "3f1c2a70-5d0e-4f0b-9d6a-6e7c1a2b3c4d",
      "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
      "key": "triple-feeding",
      "status": "active",
      "from": "Feeding bridge",
      "source": "token",
      "document": { "version": 1, "key": "triple-feeding", "title": "Feeding plan", "rules": [ … ] },
      "paused_at": null,
      "paused_by": null,
      "ended_at": null,
      "created_at": "2026-11-30T14:02:11Z",
      "updated_at": "2026-11-30T14:02:11Z",
      "time_zone": "America/New_York",
      "next": {
        "type": "next", "rule": "round", "step": "pump", "label": "Pump", "kind": "pump",
        "round_due": "2026-12-01T14:00:00Z", "opens": "2026-12-01T14:15:00Z", "by": "2026-12-01T14:35:00Z",
        "late": false, "text": "By 9:35 AM"
      },
      "rounds": [
        {
          "rule": "round", "due": "2026-12-01T14:00:00Z", "started": "2026-12-01T14:00:00Z", "closed": false,
          "steps": [
            { "id": "nurse", "label": "Nurse", "kind": "nurse", "state": "done", "opens": "2026-12-01T14:00:00Z",
              "by": "2026-12-01T14:30:00Z", "logged_at": "2026-12-01T14:00:00Z", "event_id": "…", "text": "9:00 AM" },
            { "id": "pump", "label": "Pump", "kind": "pump", "state": "next", "opens": "2026-12-01T14:15:00Z",
              "by": "2026-12-01T14:35:00Z", "logged_at": null, "event_id": null, "text": "By 9:35 AM" }
          ]
        }
      ],
      "items": [],
      "today": [
        { "rule": "round", "step": "pump", "label": "Pump", "kind": "pump", "done": 2, "missed": 0, "upcoming": 2, "total": 4 }
      ]
    }
  ]
}

POST/plans

Saves a plan, or replaces the one with the same key.

For a plan the family or their clinician gave: send the whole document. The same key from the same connection for the same child replaces the plan that hasn’t ended, and one a parent paused stays paused. Only their words and numbers go in: never an amount, a time or a medicine you worked out. The document is checked against version 1, so a field or a step kind it doesn’t know is a 400 naming it. A child can have up to 10 plans that haven’t ended. The answer says created, replaced or unchanged.

Needs write:plans and an Idempotency-Key.

version, key, titlerequired
1; the plan’s key (lowercase letters, digits, - and _, up to 64); its title, up to 40 characters.
child
A child’s id. Leave it out when the family has one child.
note, starts, ends
A note up to 280 characters; dates or date-times in the child’s zone (ends is exclusive).
rules
Up to 5. Each has an id, a repeat (every with from, or at clock times) and 1 to 8 steps.
items
Up to 20 one-off steps, each with an optional by.
curl
curl -X POST https://getmiara.com/api/v1/plans \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -H "Idempotency-Key: plan-triple-feeding-1" \
  -H "Content-Type: application/json" \
  -d '{
  "version": 1,
  "key": "triple-feeding",
  "child": "5a4d0b0c-0000-4000-8000-000000000011",
  "title": "Feeding plan",
  "note": "From our lactation visit",
  "rules": [{
    "id": "round",
    "repeat": { "every": "3h", "from": { "last": "feed", "edge": "start" } },
    "steps": [
      { "id": "nurse", "kind": "nurse", "label": "Nurse" },
      { "id": "top", "kind": "bottle", "label": "Top up", "amount": { "value": 30, "unit": "ml" }, "after": "previous", "within": "10m" }
    ]
  }]
  }'
Response
HTTP/1.1 200
{
  "id": "3f1c2a70-5d0e-4f0b-9d6a-6e7c1a2b3c4d",
  "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
  "key": "triple-feeding",
  "status": "created",
  "plan_status": "active"
}

POST/plans:end

Ends a plan.

Ends a plan this connection sent, by its id from GET /plans or by its key. Only the sender can change a plan over the API: another source’s plan is a 404. It stays in the family’s history and the key can be used again. A plan that already ended is a 409 with already_ended, and nothing changes.

Needs write:plans and an Idempotency-Key.

idone of
The plan’s id, from GET /plans.
key, child_idone of
The key you saved it with, and the child when the family has more than one.
curl
curl -X POST https://getmiara.com/api/v1/plans:end \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -H "Idempotency-Key: plan-triple-feeding-end" \
  -H "Content-Type: application/json" \
  -d '{ "id": "3f1c2a70-5d0e-4f0b-9d6a-6e7c1a2b3c4d" }'
Response
HTTP/1.1 200
{
  "id": "3f1c2a70-5d0e-4f0b-9d6a-6e7c1a2b3c4d",
  "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
  "key": "triple-feeding",
  "status": "ended"
}

POST/monitors

Registers a baby monitor for a child, or updates its status and stream details.

Each connection can register one monitor per child. Send it when the bridge starts and whenever camera status, night vision or transport details change. Only parents and caregivers in the household see the monitor in Miara; viewers never do.

Needs write:monitors and an Idempotency-Key.

child_id, labelrequired
The child’s id from /children, and a short camera name (1 to 60 characters).
capabilitiesrequired
A list of video, audio and snapshot.
transportrequired
webrtc_signaled, whep, hls or snapshot_only.
stream_url, stream_auth
Optional http(s):// stream URL (up to 2,048 characters) and Authorization header value for whep or hls (Bearer is added unless it already starts with Bearer or Basic ).
status, night_vision
online, offline, camera_off or busy (default online), and whether night vision is on (true, false or null).
curl
curl -X POST https://getmiara.com/api/v1/monitors \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -H "Idempotency-Key: monitor-upsert-1" \
  -H "Content-Type: application/json" \
  -d '{
  "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
  "label": "Nursery camera",
  "capabilities": ["video", "audio", "snapshot"],
  "transport": "webrtc_signaled",
  "status": "online",
  "night_vision": true
  }'
Response
HTTP/1.1 200
{
  "monitor_id": "2c8d9e10-4b5a-4f3c-9a1b-7d8e6f5a4b3c",
  "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
  "label": "Nursery camera",
  "status": "online"
}

POST/monitors:remove

Removes the baby monitor this connection registered for a child.

Deletes the monitor row for (connection, child_id) and cleans up its stored snapshot.

Needs write:monitors and an Idempotency-Key.

child_idrequired
The child’s id from /children.
curl
curl -X POST https://getmiara.com/api/v1/monitors:remove \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -H "Idempotency-Key: monitor-remove-1" \
  -H "Content-Type: application/json" \
  -d '{ "child_id": "5a4d0b0c-0000-4000-8000-000000000011" }'
Response
HTTP/1.1 200
{ "removed": true }

POST/monitors:snapshot

Uploads a fresh still frame for a registered baby monitor.

Accepts a base64-encoded JPEG, PNG or WebP image (at most 1.5 MB decoded; magic bytes must match content_type). Overwrites the previous snapshot in private storage and updates snapshot_at. Register the monitor with POST /monitors first, or this returns 404.

Needs write:monitors and an Idempotency-Key.

child_idrequired
The child’s id from /children.
content_typerequired
image/jpeg, image/png or image/webp.
data_base64required
Base64-encoded image bytes (<= 1.5 MB decoded).
curl
curl -X POST https://getmiara.com/api/v1/monitors:snapshot \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -H "Idempotency-Key: monitor-snap-2026-11-16-1540" \
  -H "Content-Type: application/json" \
  -d '{
  "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
  "content_type": "image/jpeg",
  "data_base64": "/9j/4AAQSkZJRgABAQAAAQABAAD/..."
  }'
Response
HTTP/1.1 200
{
  "monitor_id": "2c8d9e10-4b5a-4f3c-9a1b-7d8e6f5a4b3c",
  "snapshot_at": "2026-11-16T15:40:12Z"
}

GET/monitors:sessions

Lists open WebRTC watch sessions and ephemeral ICE servers for this bridge.

Closes any session whose viewer heartbeat is older than 45 seconds, then returns open sessions (requested, answered, active) for this connection along with ice_servers (Cloudflare TURN when configured, STUN fallback otherwise). Call this when GET /wait wakes with monitor_watch or monitor_stop, and periodically while streaming so you notice when a viewer leaves.

Needs write:monitors.

curl
curl https://getmiara.com/api/v1/monitors:sessions \
  -H "Authorization: Bearer $MIARA_TOKEN"
Response
HTTP/1.1 200
{
  "sessions": [
    {
      "id": "4c2a1b00-9f8e-4d7c-8b6a-5e4d3c2b1a00",
      "monitor_id": "2c8d9e10-4b5a-4f3c-9a1b-7d8e6f5a4b3c",
      "child_id": "5a4d0b0c-0000-4000-8000-000000000011",
      "state": "requested",
      "offer_sdp": "v=0\r\no=- ...",
      "created_at": "2026-11-16T15:40:15Z",
      "heartbeat_at": "2026-11-16T15:40:15Z"
    }
  ],
  "ice_servers": [
    { "urls": ["stun:stun.cloudflare.com:3478", "stun:stun.l.google.com:19302"] }
  ]
}

POST/monitors:answer

Answers a WebRTC watch offer or updates the session state.

Sends your bridge’s complete non-trickle SDP answer (state: "answered" with answer_sdp including gathered ICE candidates) so the app can finish connecting over WebRTC, or marks a session active, ended, busy, offline or failed (with an optional error_code).

Needs write:monitors and an Idempotency-Key.

session_idrequired
The session id from GET /monitors:sessions.
staterequired
answered, active, ended, busy, offline or failed.
answer_sdp
Required when state is answered. Up to 64 KB.
error_code
Optional when state is busy, offline or failed: stream_limit, camera_off, offline or failed.
curl
curl -X POST https://getmiara.com/api/v1/monitors:answer \
  -H "Authorization: Bearer $MIARA_TOKEN" \
  -H "Idempotency-Key: monitor-answer-4c2a1b00-1" \
  -H "Content-Type: application/json" \
  -d '{
  "session_id": "4c2a1b00-9f8e-4d7c-8b6a-5e4d3c2b1a00",
  "state": "answered",
  "answer_sdp": "v=0\r\no=- ..."
  }'
Response
HTTP/1.1 200
{
  "session_id": "4c2a1b00-9f8e-4d7c-8b6a-5e4d3c2b1a00",
  "monitor_id": "2c8d9e10-4b5a-4f3c-9a1b-7d8e6f5a4b3c",
  "state": "answered",
  "ended_at": null
}

GET/openapi.json

This API in OpenAPI 3.1: every endpoint, field and refusal.

Needs no token, and is cached for an hour. It’s made from the same list the server routes by, so what it says is what’s served.

curl
curl https://getmiara.com/api/v1/openapi.json
Response
HTTP/1.1 200
{
  "openapi": "3.1.0",
  "info": { "title": "Miara API", "version": "1.0.0", … },
  "paths": { "/children": { … }, "/events": { … }, … }
}

For agents and tools

Questions or a bug? Email noah@presler.me. What Miara keeps from a connection is in the privacy policy.