# Memories

> Add notes, pages, conversations and files; list, read, correct and forget memories.

Add notes, pages, conversations and files; list, read, correct and forget memories. This page is generated from the API's own spec, so it says exactly what the API does.

## Add a note, a web page or a conversation

`POST /v1/memories`

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `X-Geniffy-Space` | header | string | One of your own users, for every call this client makes. (up to 128 characters) |

**Body** (application/json)

| Field | Type | | Description |
| --- | --- | --- | --- |
| `text` | string | optional | A note to remember (at least 1 character; up to 2,000,000 characters) |
| `url` | string | optional | Or a web page, read once (at least 4 characters; up to 2,000 characters) |
| `messages` | array of Message | optional | Or a conversation, as your framework already holds it: content as a string, blocks or parts. Only text is read; system and developer messages are skipped; who said what is kept, so the user's words become facts about the user. (up to 500 items) |
| `title` | string | optional | What to call it in the app (up to 300 characters) |
| `space` | string | optional | One of your own users. Leave it out for your own memory. (up to 128 characters) |

**Returns** `201`

| Field | Type | | Description |
| --- | --- | --- | --- |
| `source` | object | required |  |

## Memories, newest first

`GET /v1/memories`

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `kind` | query | `all`, `people`, `plan`, `pref`, `detail` |  |
| `limit` | query | integer |  (at least 1; at most 200; default `50`) |
| `cursor` | query | integer |  (at least 0; default `0`) |
| `space` | query | string | One of your own users. Leave it out for your own memory. (up to 128 characters) |
| `X-Geniffy-Space` | header | string | One of your own users, for every call this client makes. (up to 128 characters) |

**Returns** `200`

| Field | Type | | Description |
| --- | --- | --- | --- |
| `memories` | array of Memory | required |  |
| `counts` | object | required |  |
| `total` | integer | required |  |
| `next` | integer | optional |  |

## Add up to a hundred at once

`POST /v1/memories/batch`

One item failing does not take the rest down: each comes back with what happened to it, in the
order sent. A batch that only ever succeeded or failed as a whole would make the caller re-send
ninety-nine good items to retry one bad one.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `X-Geniffy-Space` | header | string | One of your own users, for every call this client makes. (up to 128 characters) |

**Body** (application/json)

| Field | Type | | Description |
| --- | --- | --- | --- |
| `items` | array of AddIn | required | Up to 100 at a time. Each may name its own space. (at least 1 item; up to 100 items) |
| `space` | string | optional | The space for any item that names none (up to 128 characters) |

**Returns** `202`

| Field | Type | | Description |
| --- | --- | --- | --- |
| `results` | array of BatchRow | required |  |
| `added` | integer | required |  |
| `failed` | integer | required |  |

## Add a PDF or Word file

`POST /v1/memories/file`

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `X-Geniffy-Space` | header | string | One of your own users, for every call this client makes. (up to 128 characters) |

**Body** (multipart/form-data)

| Field | Type | | Description |
| --- | --- | --- | --- |
| `file` | string | required |  |
| `title` | string | optional |  |
| `space` | string | optional |  |

**Returns** `201`

| Field | Type | | Description |
| --- | --- | --- | --- |
| `source` | object | required |  |

## One memory, the sentence it came from, and its history

`GET /v1/memories/{memory_id}`

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `memory_id` | path | integer |  |
| `space` | query | string | One of your own users. Leave it out for your own memory. (up to 128 characters) |
| `X-Geniffy-Space` | header | string | One of your own users, for every call this client makes. (up to 128 characters) |

## Say what we got wrong, and what is right

`PATCH /v1/memories/{memory_id}`

The wrong memory is marked and never used again, and what is right is learned as a new one,
with its own source. Nothing is quietly overwritten: a correction leaves a trail.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `memory_id` | path | integer |  |
| `X-Geniffy-Space` | header | string | One of your own users, for every call this client makes. (up to 128 characters) |

**Body** (application/json)

| Field | Type | | Description |
| --- | --- | --- | --- |
| `text` | string | required | What is right instead (at least 1 character; up to 2,000 characters) |
| `space` | string | optional | One of your own users. Leave it out for your own memory. (up to 128 characters) |

## Forget a memory for good

`DELETE /v1/memories/{memory_id}`

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `memory_id` | path | integer |  |
| `space` | query | string | One of your own users. Leave it out for your own memory. (up to 128 characters) |
| `X-Geniffy-Space` | header | string | One of your own users, for every call this client makes. (up to 128 characters) |

Source: https://docs.geniffy.com/api/memories
