# addMemoryNote

Memory: add a note to a shelf the key owner may open, as a person stated it, pinned. PERSON with no `subjectId` is the owner's own, TEAM the organization's (its admins only), otherwise the EMPLOYEE or CONTACT id (listMemorySubjects). `kind` is RULE, PREFERENCE, DECISION, PROCEDURE, FACT or PROGRESS. The same words again return the existing note, re-pinned. In a chat, REMEMBER writes the person's own shelf, and TEAM for an org admin; this reaches the others.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "addMemoryNote", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `shelf`: `SpacesMemoryShelf!` (required, one of `PERSON`, `TEAM`, `EMPLOYEE`, `CONTACT`, `PROJECT`). A shelf of the Library's Memory page (Memory v2): where a note lives. PERSON is a person's own shelf ("You"); TEAM is the organization's. PROJECT is the dev fleet's, and opens only to Goliath admins. A teammate's PERSON shelf opens to everyone, written only by them and Goliath admins.
- `subjectId`: `ID`
- `kind`: `SpacesMemoryNoteKind!` (required, one of `RULE`, `PREFERENCE`, `DECISION`, `PROCEDURE`, `FACT`, `ENTITY`, `PROGRESS`, `TRUST`, `SUMMARY`, `OBSERVATION`). What kind of thing a note is.
- `text`: `String!` (required)

## Response (data, an example)

```json
{
  "spacesMutation": {
    "memoryAddNote": {
      "id": "<ID>",
      "kind": "RULE",
      "text": "…",
      "origin": "STATED",
      "pinned": true
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "addMemoryNote",
    "variables": {
      "shelf": "PERSON",
      "kind": "RULE",
      "text": "<String>"
    }
  }'
```
