# Nessa for AI assistants: full reference

**For:** developers and AI assistants connecting to a teacher's Nessa classroom
**Updated:** 4 Nov 2026. Everything here is live.
**Short version:** https://nessaglobal.com/assistant.md?v=2026-11-04b has the setup steps and working rules. This page is the complete reference behind it.

It covers connecting to a teacher's account, every action, and how the assistant should behave so that what it does matches the Nessa app and website.

---

## Contents

1. [What Nessa is, in one minute](#1-what-nessa-is-in-one-minute)
2. [Before you start](#2-before-you-start)
3. [Connecting a teacher's account](#3-connecting-a-teachers-account)
4. [Calling the API](#4-calling-the-api)
5. [Actions](#5-actions)
6. [How the assistant should behave](#6-how-the-assistant-should-behave)
7. [Errors](#7-errors)
8. [Allowed params per action (cheat sheet)](#8-allowed-params-per-action-cheat-sheet)
9. [How to test](#9-how-to-test)

---

## 1. What Nessa is, in one minute

Nessa is a classroom app for Montessori teachers: an iPhone and Android app, plus a website at app.nessaglobal.com. Everything is the same account and the same data, synced live.

| Thing | What it is |
|---|---|
| **Children** (`students`) | Her class list. Children who have left go to Past students (archived). |
| **Observations** | Short notes about one child: what they worked on, at what level, in which subject. The heart of the app. |
| **Subjects** | Montessori areas: Practical Life, Sensorial, Mathematics, Language, Cultural, Geography, Science, and so on, plus **General** for notes that aren't about a subject. Her list can differ; `settings.get` returns it. |
| **Levels** | `introduced` (first presentation), `practising`, `mastered`. |
| **Pinned for conference** | An observation the teacher wants to raise at the parent conference (`conference_relevant`). Pinned ones lead the child's conference sheet. |
| **Conference sheets** | A one-page sheet per child for the parent-teacher conference, written from that child's observations in her saved style. |
| **Newsletter highlights** (`classroom_notes`) | Class-level moments, dates and reminders for the next family newsletter ("We hatched butterflies", "Farm visit Fri 9 Oct, 1 to 4pm"). Not about one child. |
| **Newsletter** | Written only from highlights, in her saved style. A "cycle" is one newsletter's worth of highlights. |
| **Lesson plans** | Which lesson she plans to present to which children, by week. |

---

## 2. Before you start

**Your assistant must be able to:**
- make HTTPS POST requests with a JSON body and an `Authorization` header;
- keep one secret token per teacher between conversations, stored securely (like a password), and never show it in chat. If your platform can only store secrets the user types into a secure entry card, use **show-once mode** (section 3.1);
- run a short loop (every few seconds, for up to 15 minutes) while the teacher approves the connection.

A browser-only assistant can't use this API.

**Privacy rules (non-negotiable):**
- This is children's data. Use it only to help this teacher, in her own conversations.
- Never put real names, photos or class lists into shared prompts, memories, skills, templates or examples. Use made-up names like "Alex" in anything reusable.
- Never store photo links. Most expire within the hour; ask again when you need them.
- Never email or post anything to families yourself. The teacher sends newsletters herself.
- Treat the token like a password. If it may have leaked, call `disconnect` (section 3.4) and connect again.

---

## 3. Connecting a teacher's account

It works like signing in to a TV app: you start a request and show the teacher a link, she approves it on the Nessa website, and you collect your token.

**Connect endpoint:**
```
POST https://klfmjhxihocvkysqdady.supabase.co/functions/v1/bot-connect
Content-Type: application/json
```
Note: on this endpoint the params sit **at the top level** of the body, next to `action` (unlike the main API in section 4).

### 3.1 Start

Make a fresh random `poll_secret` (32 to 512 characters, e.g. 32 random bytes as hex). Keep it private; it's how you prove you started this request.

```json
{ "action": "start", "poll_secret": "6c1f...64 hex characters...", "client_name": "Muse", "expose_token": true }
```
```json
{ "code": "K7Q2-9XMA", "connect_url": "https://app.nessaglobal.com/connect?c=K7Q2-9XMA", "expires_at": "2026-10-19T21:15:00.000Z", "token_delivery": "shown_to_teacher" }
```

- `client_name` (optional, recommended): your assistant's name, 1 to 40 characters. The approval page then says "Connect Muse?", and the connection shows as "Nessa on Muse" in her Settings.
- `expose_token` (optional, default `false`): **show-once mode.** Use it if your platform can only store secrets the user types in. The approval page shows her the token once, with a copy button and a warning to paste it only into your secure settings, never into a chat. `status` then tells you she approved but **never returns the token** (3.3). `token_delivery` says which mode you're in: `poll` or `shown_to_teacher`.

Show the teacher the link: *"To connect me to your Nessa classroom, open this link and sign in: https://app.nessaglobal.com/connect?c=K7Q2-9XMA (it works for 15 minutes)."*

### 3.2 She approves

She opens the link, signs in to Nessa (or creates an account, with a short setup of classroom name and school year), and taps Connect. Nothing for you to do here.

### 3.3 Poll for the token

Every 3 to 5 seconds until `expires_at`:

```json
{ "action": "status", "code": "K7Q2-9XMA", "poll_secret": "6c1f..." }
```

| `status` | Meaning |
|---|---|
| `pending` | She hasn't approved yet. Keep polling. |
| `completed` | Done. The reply carries `token_delivery`, `teacher_first_name` and `email_masked`. In `poll` mode it also carries `bot_token` (starts with `nessa_bot_`). **The token is handed over exactly once**; store it now. In `shown_to_teacher` mode there's no `bot_token`: she has the key on screen, so give her your secure entry card now and ask her to paste it there. |
| `cancelled` | She declined. Stop. |
| `expired` | The 15 minutes ran out, or the token was already collected. Start again if needed. |

A wrong code or wrong `poll_secret` returns 404 `not_found`.

**Show-once mode, step by step:**
1. `start` with `expose_token: true` and `client_name`.
2. Give her the link. She signs in and taps Connect.
3. The page shows her the key once, with a Copy button.
4. Your poll returns `completed` with `token_delivery: "shown_to_teacher"`. Show her your secure entry card: *"Paste the key from the Nessa page here."* Better still, have the card ready before you send the link: the key is shown only once, and if she closes the page first it's gone.
5. The key lands in your per-user vault. Use it for every call; never echo it back.
6. **If she pastes the key into the chat by mistake, don't use it.** Treat it as leaked: ask her to disconnect it in Settings > Connected chats, and connect again.
7. If she closed the page before copying, or the key is lost later, just connect again with the same `client_name`. Her approval page offers to replace the old connection (ticked by default), so she won't end up with two.

Then, straight away (in show-once mode, once she has pasted the key):
1. Call `whoami` and greet her with what it returns: *"Connected to <classroom name>. I can see <number> children."* If this first call returns 401 `not_connected` within seconds of the paste, your vault may still be saving the key: wait a few seconds and retry once before deciding the key is wrong.
2. If you didn't send `client_name`, name your connection so she can recognise it in Settings: `connection.set_name { "name": "Muse" }` (section 5.1).

### 3.4 Disconnecting

- She can disconnect you any time on the website: Settings > Connected chats > Disconnect. After that every call returns 401 `not_connected`; offer to connect again.
- If she asks you to disconnect, or you think the token leaked:
  ```
  POST bot-connect   Authorization: Bearer nessa_bot_...
  { "action": "disconnect" }
  ```

### 3.5 Rate limits on connecting

`start`: 20 per 10 minutes per IP address. `status`: 600 per 10 minutes. A 429 means wait and retry.

---

## 4. Calling the API

```
POST https://klfmjhxihocvkysqdady.supabase.co/functions/v1/bot-api
Authorization: Bearer nessa_bot_...
Content-Type: application/json

{ "action": "observations.add", "params": { "student_name": "Alex", "note": "..." } }
```

- Every call acts as **this teacher**, with the same access she has in the app. She only ever sees and changes her own classroom.
- **Strict params on writes:** a write that gets a param it doesn't take returns 400 `validation_error` and **saves nothing**. Reads answer and list `ignored_params`. Treat both as bugs to fix. Section 8 lists every action's params.
- **Children by name or id:** anything about one child takes `student_id` or `student_name`. A name that matches more than one child returns 409 `ambiguous` with `candidates`; ask her which, then use `student_id`.
- **Dates** come back as UTC timestamps. Show them in her time zone, in Nessa's style: **"Fri 16 Oct"**, "Today", "Yesterday".
- **Rate limits:** 120 calls a minute per connection, and 200 photo uploads an hour. A 429 carries `retry_after` (seconds); wait, then carry on quietly.
- Changes show up live on her phone and the website.

---

## 5. Actions

### 5.1 Account and setup

| Action | What it does |
|---|---|
| `whoami` | Her first name, classroom name, school year, number of children, `links` (newsletter, conferences) and `connection.name`. Call it first in a conversation if you need context. |
| `connection.set_name` `{ name }` | Names this connection in her Settings, e.g. `"Muse"` shows as "Nessa on Muse". 1 to 40 characters. |
| `classroom.get` / `classroom.update { classroom_name }` | Her classroom's name, e.g. "Room 5". |
| `settings.get` | Her name, her **subjects** (keys, labels, active) and **levels**. Use the keys when saving. |
| `settings.update { teacher_name }` | The name the children use, e.g. "Ms. Sonali". |
| `school_year.get_active` / `school_year.create { start_month }` | Her current school year. New accounts set this up when connecting, so you rarely need `create`. |

### 5.2 Children

| Action | Notes |
|---|---|
| `students.list { include_archived?, include_photo_urls? }` | Sorted by name, with observation counts and `has_photo`. |
| `students.get { student_id \| student_name, include_photo_url? }` | One child, with counts and a signed photo link. |
| `students.add { first_name, last_name?, last_initial?, birth_year? \| age?, gender?, note? }` | `gender` is `girl` or `boy` (it sets pronouns in conference sheets). An existing active name returns 409 `duplicate` with the existing child. |
| `students.add_batch { students: [...] }` | Up to 60 children in one call; each row is added, a duplicate, or invalid, on its own. Use it for class lists: read the list, have her confirm, send once, then report the counts. |
| `students.update { student_id \| student_name, first_name?, last_name?, birth_year? \| age?, gender? }` | |
| `students.archive { student_id \| student_name, reason? }` | Moves a child to Past students (keeps everything). `reason`: graduated, moved, transferred or other. |
| `students.restore { student_id \| student_name }` | Brings them back. |
| `students.delete { student_id \| student_name, confirm_token? }` | **Two calls.** Call 1 deletes nothing and returns `teacher_warning` and `confirm_token`. Show `teacher_warning` **word for word**, offer Past students as the safer choice, and only send call 2 (with `confirm_token`, within 10 minutes) after a clear yes to that exact question. |

### 5.3 Observations

**`observations.add`** `{ student_id | student_name, note, subject?, level?, activity?, conference_relevant?, date?, photo_upload_ids? }`

```json
{ "action": "observations.add", "params": {
  "student_name": "Alex", "note": "Built the pink tower twice, very careful with the smallest cube.",
  "subject": "sensorial", "level": "practising", "activity": "Pink Tower" } }
```

- `note` is **her words, exactly**. Don't rewrite, summarise or tidy them.
- `subject`: a key from `settings.get` (`general` for notes that aren't about a subject). Left out, Nessa uses the linked lesson's subject or `general`.
- `level`: `introduced`, `practising` or `mastered`. Map her words privately ("showed him", "first time" means introduced; "worked on", "practised", "again" means practising; "has it", "independently, confidently" means mastered), but keep her words in the note.
- `activity`: the material or lesson name. Nessa links it to its curriculum when the name clearly matches.
- `date`: `YYYY-MM-DD` or an ISO timestamp, for things that happened earlier. Defaults to now.
- `conference_relevant: true` pins it for conference (rules in 6.3). The reply then includes a `conference` block for that child (5.8).
- Returns `{ observation, linked_lesson, conference? }`.

**`observations.list`** `{ student_id | student_name, subject, level, from, to, conference_relevant, has_photos, limit, cursor, include_photo_urls }` (all optional). Newest first; `limit` 1 to 200 (default 50); page with `cursor` until `next_cursor` is null. Booleans must be real `true`/`false`.

**`observations.set_conference`** `{ observation_id, pinned }` pins or unpins one. Returns the observation and the child's `conference` block.

**`observations.attach_photo`** `{ observation_id, upload_id }` and **`observations.remove_photo`** `{ observation_id, photo_id }` (up to 4 photos per observation).

There is no edit or delete for observations from the API yet; she can do that in the app or on the website.

### 5.4 Photos

Three steps, for profile, observation and newsletter photos alike.

1. **`uploads.sign`** `{ purpose, content_type, byte_size? }`. `purpose`: `student_photo`, `observation_photo` or `newsletter_photo`. `content_type`: `image/jpeg`, `image/png` or `image/webp` (convert HEIC to JPEG first). Up to 8 MB. Returns `upload_id` and `upload_url`.
2. **PUT the bytes** to `upload_url` with the `Content-Type` header. No Nessa token needed; the link works for 2 hours.
3. **Attach** with the `upload_id` within 24 hours:

| Where | Call |
|---|---|
| Profile photo | `students.set_photo { student_id \| student_name, upload_id, face_box? }` |
| New observation | `observations.add { ..., photo_upload_ids: [...] }` (up to 4) |
| Existing observation | `observations.attach_photo { observation_id, upload_id }` |
| New highlight | `classroom_notes.add { text, photo_upload_ids: [...] }` (up to 10) |
| Existing highlight | `newsletter.add_photo { note_id, upload_id }` |

- **`face_box`** (profile photos): where the child's face is in the photo, as fractions from the top left, e.g. `{ "x": 0.24, "y": 0.25, "width": 0.31, "height": 0.45 }`. Nessa crops a 512 x 512 head-and-shoulders square around it; without it, a centred square.
- Nessa turns every photo the right way up, shrinks it to 1600 px at most, and removes hidden details such as GPS location.
- One `upload_id` can be attached several times (each gets its own copy). Useful for one scanned sheet across several observations.
- Profile and observation photos are **private** (signed links, 1 hour). Newsletter photos are **public links on purpose**, because the newsletter is emailed. Never put a profile or observation photo in a newsletter.
- `students.remove_photo { student_id | student_name }` removes a profile photo.

### 5.5 Insights

**`insights.summary`** `{ student_id | student_name, from, to }` (all optional). A class or child snapshot counted from saved observations, with the same rules as the app's Insights tab: who needs attention (no observations, or none in 7 days), subject gaps (3+ observations but none in an active subject), best level per subject, and lessons introduced 21+ days ago and not revisited. No AI runs on the server. If `enough_data` is false, say so plainly instead of guessing. `rules` explains each list.

### 5.6 Lesson plans

| Action | Notes |
|---|---|
| `curriculum.search { query?, subject? }` | Finds lessons in her curriculum by name, topic or section: Nessa's lessons, minus any subject she hid, plus her own (`source`: `nessa`, `studio`, `custom`). Each result has `id`, `name`, `subject`, `section`, `source`, and `aim` when there is one; `more` counts what didn't fit. Search a section's name to list its lessons. With no `query` it lists the sections and how many lessons each has, to browse. Use it when she asks for something "from the curriculum" or you aren't sure of the exact name, and when a search finds nothing, browse before saying it isn't there. It is a word search, so "cutting vegetables" won't find Cucumber Preparation. |
| `plans.list { student_id \| student_name, week, status }` | `week`: `this`, `next`, `last` or any date in the week (`YYYY-MM-DD`). |
| `plans.add { lesson \| lesson_id, custom?, subject?, week?, notes?, student_ids \| student_names \| student_name }` | `lesson` is a name; Nessa matches it to her curriculum. A name that could be several lessons, or that is a section of the curriculum ("Pre-Math" is a section of five lessons), returns 409 `ambiguous_lesson` with `candidates`: ask which she means, then send `lesson_id`, or `custom: true` to save it as her own lesson under that name. A name nothing like a curriculum lesson is saved as her own lesson. `lesson_id` takes any `id` from `curriculum.search`. Whole class unless children are named. Already planned: returned with `already_planned`. |
| `plans.update_status { plan_id, status }` | `planned` or `presented`. |

### 5.7 Newsletter

**Highlights**

| Action | Notes |
|---|---|
| `classroom_notes.add { text, photo_upload_ids? }` | Save her words exactly. Dates and reminders are highlights too: keep the date as she says it ("Farm visit Oct 30th, 9 to 12"); don't reformat it or add a weekday. |
| `classroom_notes.list` | This newsletter's highlights with their photos. |
| `classroom_notes.update { note_id, text }` | Changes the text; photos stay. |
| `classroom_notes.delete { note_id }` | Deletes it **and its photos** (photos can't be brought back). Returns the deleted text, so it can be re-added. Confirm first (6.2). |
| `newsletter.add_photo { note_id, upload_id }` / `newsletter.remove_photo { photo_id }` | Up to 10 photos per highlight. |
| `newsletter.new_cycle { keep_note_ids? }` | Starts a fresh newsletter: this one's highlights, photos and draft are put away (kept in her account). `keep_note_ids` carries highlights over, e.g. one just added. Confirm first. |

**The `newsletter` status block.** Every highlight action above (add, list, update, delete, new_cycle) returns:

```json
"newsletter": {
  "highlight_count": 5, "since": "2026-10-05T14:02:11.000Z", "rhythm": "Every 2 weeks",
  "next_due": "2026-10-18T14:02:11.000Z", "due_now": false,
  "draft": { "exists": true, "updated_at": "2026-10-16T09:30:00.000Z" },
  "suggest_new_cycle": false, "new_cycle_reason": null, "earlier_highlights": 4,
  "link": "https://app.nessaglobal.com/newsletter"
}
```

`suggest_new_cycle` is true when the earlier highlights look like they belong to a newsletter she has already sent: `past_due` (past their due date), or `draft_written` (rhythm "when I send" and a draft written 3+ days ago). How to use it: 6.2.

**Writing the newsletter**

| Action | Notes |
|---|---|
| `newsletter.prepare` | Everything needed to write it exactly as the app does: `instructions` (system prompt), `message` (user message, her highlights with photo markers), `highlights`, `photos`, her style and cycle. |
| `newsletter.get_draft` / `newsletter.save_draft { text?, subject_lines? }` | One shared draft per account, the same one she sees on her phone and the website. `save_draft` removes any `[[LEFT_OUT]]` line and em dashes. |
| `newsletter.get_style` | Her saved style, a one-line `summary`, and the cycle (`since`, `next_due`). |
| `newsletter.update_style { rhythm?, format?, include?, greeting?, signoff?, voice?, voice_append? }` | Only fields you send change. `rhythm`: `weekly`, `biweekly`, `monthly`, `adhoc` ("when I send"). `format`: `subject` (default), `stories`, `letter`, `bullets`. `include`: any of `{ why, ahead, quote }`. `voice` replaces "In your own words"; `voice_append` adds one line (for "from now on..." requests). |

How to write it:
1. Call `newsletter.prepare`. If `highlight_count` is 0, ask her what happened in class (plus dates, reminders, birthdays), add them with `classroom_notes.add`, then prepare again.
2. Send `instructions` as the **system prompt** and `message` as the **user message**, unchanged. Don't add your own newsletter rules on top. Don't cache `instructions`; call `prepare` every time.
3. The reply may end with `[[LEFT_OUT: 2, 3]]`. Remove it, and tell her which highlights were left out and why (they read like a private note about one child), quoting them from `highlights`.
4. Keep `[[PHOTO:N]]` markers in the saved text; the app and website turn them into the photos.
5. Show her the draft; on her OK, `newsletter.save_draft { text }`.
6. Refining ("shorter", "warmer"): edit the draft she's looking at, keeping markers, headings, greeting and sign-off. If she asks for the same kind of change twice, or says "from now on", offer `update_style { voice_append }`.

The newsletter is written **only from highlights**, never from observations, plans or curriculum.

### 5.8 Conference sheets

| Action | Notes |
|---|---|
| `conference.list` | The whole class: the current conference (`key`, `label`, `date`, `covers_from`), ready count, and per child the observations and pins in this period, meeting length, sheet state (`none`, `draft`, `ready`) and `link`. |
| `conference.prepare { student_id \| student_name }` | `instructions` and `message` to write one child's sheet exactly as the website does. If `observation_count` is 0 they're null; offer to record observations first. |
| `conference.get { student_id \| student_name }` | The saved sheet (or null), `new_observations` since it was written, and `link`. |
| `conference.save { student_id \| student_name, text, status? }` | Creates or replaces this child's sheet. Nessa tidies it to the meeting length. `status`: `draft` or `ready`. |
| `conference.set_status { student_id \| student_name, status }` | `ready` when she says it's done. |
| `conference.delete { student_id \| student_name }` | Confirm first. Returns the sheet, so `save` can put it back. |
| `conference.get_style` / `conference.update_style { minutes?, format?, sections?, headings?, include?, voice?, dates?, student_id \| student_name? }` | Her sheet style. `minutes`: 10, 15, 20, 30 (with a child, that family's length only). `format`: `points`, `paragraphs`, `summary`. `sections`: `nessa` or `school` (needs `headings`, her school form's headings in order). `include`: `{ open, home, questions }`. `dates`: **replaces** her conference dates, `[{ "date": "2026-10-20", "label": "Fall conferences" }]`; to add one, `get_style` first and send the full list. |

**The `conference` block.** A pin (`observations.add` with `conference_relevant: true`, or `observations.set_conference`) returns:

```json
"conference": {
  "conference": { "key": "2026-11-05", "label": "Fall conferences", "date": "2026-11-05", "covers_from": "2026-09-01T00:00:00.000Z" },
  "pinned": 3, "observations": 41, "sheet": "draft", "sheet_new_observations": 4,
  "link": "https://app.nessaglobal.com/conferences/<student_id>"
}
```

How to write a sheet: `conference.prepare`, then your model with `instructions` and `message` unchanged, show her, then `conference.save` (as a draft). When she says it's done, `conference.set_status { status: "ready" }`. A sheet is the teacher's private prep, never something to send to families. Printing happens in the app or on the website.

### 5.9 Links

Replies carry links to share: `whoami.links`, the newsletter status `link`, `newsletter.get_draft.link`, `conference.list.link` and each child's `link`, `conference.get.link`, and the `conference` block's `link`.

- On a **phone with the Nessa app**, the link opens the app on that screen (the Newsletter tab, or that child's conference sheet).
- On a **phone without the app**, a short page offering the app.
- On a **computer**, the website.

So you don't need to know her device. Share links with a plain label ("Open your newsletter: ..."), use the link from the reply rather than building your own, and don't add one to every message: share it when she asks where something is, after writing or saving a draft or sheet, or once after a run of highlights.

---

## 6. How the assistant should behave

### 6.1 Recording

- Save her words exactly. Don't correct, expand or summarise them.
- Decide where it goes:
  - About **one child** ("Alex built the pink tower") → `observations.add`.
  - About the **whole class**, an event, a date, a reminder or a birthday → `classroom_notes.add` (a highlight).
  - Something **private about one child** said as if it were a highlight ("Leo cried all morning") → suggest saving it as Leo's observation instead.
  - Several children in one sentence ("Alex and Maya did the pink tower") → one observation each.
- Confirm in one short line: *"Saved for Alex: Sensorial, practising."*
- If a name could be two children, ask which (409 `ambiguous`).
- A scanned observation sheet or a long voice note: read it, show her what you'll save (child, subject, level, note), then save on her OK. One photo of the sheet can go on every row.

### 6.2 Newsletter highlights

- **After adding**, say where things stand in one line from the `newsletter` block: *"Added. That's 5 highlights for your next newsletter (since Mon 5 Oct), due Sun 18 Oct."* With "when I send": *"Added. That's 5 highlights so far."*
- **Offer a fresh start** when `suggest_new_cycle` is true, once, after confirming what she did:
  - `past_due`: *"Your last newsletter was due Fri 16 Oct. If it's gone out, want me to start a fresh one? I'll keep this new highlight for it."*
  - `draft_written`: *"You wrote a newsletter draft on Mon 12 Oct. If you've sent it, want me to start a fresh one? I'll keep this new highlight for it."*
  - On yes: `newsletter.new_cycle { keep_note_ids: [<the id you just added>] }`, then *"Done. Your new newsletter has 1 highlight so far."* On no, drop it for the rest of the conversation.
- **Deleting:** confirm first, quoting it. If it has photos, say they can't be brought back. If several could match, list them and ask. If a draft exists, mention the draft still includes it and offer to rewrite.
- **"I sent the newsletter, clear it":** confirm, then `newsletter.new_cycle` with no `keep_note_ids`.

### 6.3 Conference pins

| Situation | Do this |
|---|---|
| She says so: "bring this up at conferences", "for the parent meeting", "tell his parents", "flag this for conferences" | **Pin automatically** and say so: *"Saved, and pinned for Daniel's conference."* |
| A clear milestone or concern framed for the family: "first time she read a whole book on her own, her parents will love this" | **Pin automatically** and say so. |
| Notable but not framed for parents: real growth, a first, a persistent struggle, a change in behaviour, a social difficulty | **Save, then ask:** *"Want me to pin this for Daniel's conference?"* |
| Routine work: "practised pouring", "worked with the pink tower" | **Don't pin, don't ask.** |

- When you pin automatically, say so, so she can say "unpin that" (`observations.set_conference { pinned: false }`).
- Ask at most once per observation; if she declines, don't ask again for similar notes in that conversation. With many observations at once, pin the clear ones and ask once about the borderline ones together.
- After a pin, one line from the `conference` block: *"Pinned. Daniel has 3 for his conference."* If a sheet already exists: *"His conference sheet was written before this. Want me to rewrite it so it's included?"* (rewriting replaces her edits, so ask).

### 6.4 Always

- **Confirm before anything that can't be undone:** deleting a child, a highlight or a conference sheet, or starting a new newsletter cycle.
- **Montessori accuracy matters.** Only state what she recorded. Never invent activities, levels or progress, and never overstate a level.
- **Writing style:** warm, plain, like a real teacher. **Never use em dashes**, anywhere. Avoid "delve", "foster", "journey", "tapestry" and similar.
- **Names:** newsletters use first names only, and only for celebrations like birthdays. Never name other children in a child's conference sheet.
- **Errors:** never tell her something was saved unless the call succeeded. If a photo fails, save the text anyway and tell her the photo didn't attach.

---

## 7. Errors

| HTTP | `error` | What to do |
|---|---|---|
| 400 | `validation_error` | A bad or unknown param. `field` and `message` say which. **Nothing was saved.** |
| 401 | `not_connected` | Token missing, wrong, or she disconnected you. Offer to connect again (section 3). Right after a new key is saved, wait a few seconds and retry once first. |
| 403 | `forbidden` | This connection is read-only. |
| 404 | `not_found` | No such child, observation, highlight, sheet or upload. `message` says what to do. |
| 409 | `ambiguous` | Several children match the name; `candidates` lists them. Ask which, then use `student_id`. |
| 409 | `ambiguous_lesson` | The lesson name could be one of her lessons, or is a section with several; `candidates` lists up to 20 and `more` counts the rest. Ask which, then use `lesson_id`, or `custom: true` for her own lesson. |
| 409 | `duplicate` | A child with that name is already active; the existing child is returned. |
| 429 | `rate_limited` | Wait `retry_after` seconds (also in the `Retry-After` header). |
| 500 | `server_error` | Retry once, then tell her it didn't save. |

---

## 8. Allowed params per action (cheat sheet)

Anything else is refused on writes (400) and reported as `ignored_params` on reads.

```
whoami, classroom.get, settings.get, school_year.get_active,
classroom_notes.list, newsletter.get_draft, newsletter.get_style,
newsletter.prepare, conference.list, conference.get_style      (none)

connection.set_name       name
classroom.update          classroom_name
settings.update           teacher_name
school_year.create        start_month

students.list             include_archived, include_photo_urls
students.get              student_id, student_name, include_photo_url
students.add              first_name, last_name, last_initial, birth_year, age, gender, note
students.add_batch        students   (each: first_name, last_name, last_initial, birth_year, age, gender, note)
students.update           student_id, student_name, first_name, last_name, birth_year, age, gender
students.set_photo        student_id, student_name, upload_id, face_box
students.remove_photo     student_id, student_name
students.archive          student_id, student_name, reason
students.restore          student_id, student_name
students.delete           student_id, student_name, confirm_token

uploads.sign              purpose, content_type, byte_size

observations.add          student_id, student_name, note, subject, level, activity,
                          conference_relevant, date, photo_upload_ids
observations.list         student_id, student_name, subject, level, from, to,
                          conference_relevant, has_photos, limit, cursor, include_photo_urls
observations.set_conference  observation_id, pinned
observations.attach_photo observation_id, upload_id
observations.remove_photo observation_id, photo_id

insights.summary          student_id, student_name, from, to

curriculum.search         query, subject

plans.list                student_id, student_name, week, status
plans.add                 lesson, lesson_id, custom, subject, week, notes,
                          student_ids, student_names, student_name
plans.update_status       plan_id, status

classroom_notes.add       text, photo_upload_ids
classroom_notes.update    note_id, text
classroom_notes.delete    note_id
newsletter.new_cycle      keep_note_ids
newsletter.add_photo      note_id, upload_id
newsletter.remove_photo   photo_id
newsletter.save_draft     text, subject_lines
newsletter.update_style   rhythm, format, include, greeting, signoff, voice, voice_append

conference.prepare        student_id, student_name
conference.get            student_id, student_name
conference.save           student_id, student_name, text, status
conference.set_status     student_id, student_name, status
conference.delete         student_id, student_name
conference.update_style   minutes, format, sections, headings, include, voice, dates,
                          student_id, student_name
```

---

## 9. How to test

Use a test classroom, not a real one.

1. **Connect:** start (with `client_name` and, if you need it, `expose_token`), open the link, approve, and collect the token (by polling, or from her pasting it). The website's Settings > Connected chats shows "Nessa on Muse".
2. **Observation:** "Alex built the pink tower twice." Saved as Sensorial, practising, her words exact. It appears on the phone and website within seconds.
3. **Pins:** "Alex read a whole book on her own, her parents will love this." Saved **and pinned** without asking, with the pin count. "Alex had a hard time settling, third day in a row." Saved, then the assistant **asks** about pinning. "Alex practised pouring." Saved, no pin, no question.
4. **Highlights:** "Add a highlight: we hatched butterflies this week." The reply says how many highlights there are now. Edit it, then delete it (the assistant confirms first).
5. **Newsletter:** add two or three highlights, ask for the newsletter, and check it matches her style and appears as the draft on the website.
6. **Conference sheet:** "Prepare Alex for conferences." The sheet appears on the website's Conferences page as a draft. "It's ready" marks it Ready.
7. **Links:** "Where's Alex's conference sheet?" On a computer the link opens the website on Alex's sheet; on a phone with Nessa it opens the app there.
8. **Disconnect** on the website, then make any call: 401 `not_connected`, and the assistant offers to reconnect.
