> For the complete documentation index, see [llms.txt](https://memoet.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://memoet.gitbook.io/docs/reference-guides/restful-api/api.md).

# Note API

## Get all notes in a deck

<mark style="color:blue;">`GET`</mark> `https://memoet.com/api/decks/:deck:id/notes`

This endpoint allows you to get all notes in a deck.

#### Path Parameters

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| deck:id<mark style="color:red;">\*</mark> | string | ID of the deck. |

#### Query Parameters

| Name   | Type   | Description                    |
| ------ | ------ | ------------------------------ |
| limit  | string | Number of notes per page.      |
| before | string | Before cursor of current page. |
| after  | string | After cursor of current page.  |

#### Headers

| Name                                             | Type   | Description           |
| ------------------------------------------------ | ------ | --------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Authentication token. |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "id": "6f397ed6-e5d0-43af-9265-d2b14b8a9a7c",
            "title": "Which city is the capital of the United States of America? Which city is the capital of the United States of America? "
        }
    ],
    "metadata": {
        "after": null,
        "before": null,
        "limit": 1,
        "total_count": 3
    }
}
```

{% endtab %}
{% endtabs %}

## Create new notes

<mark style="color:green;">`POST`</mark> `https://memoet.com/api/decks/:deck:id/notes`

This endpoint allows you to create new notes for a deck.

#### Path Parameters

| Name                                      | Type   | Description                     |
| ----------------------------------------- | ------ | ------------------------------- |
| deck:id<mark style="color:red;">\*</mark> | string | ID of the deck to add notes to. |

#### Headers

| Name                                             | Type   | Description           |
| ------------------------------------------------ | ------ | --------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Authentication token. |

#### Request Body

| Name | Type   | Description        |
| ---- | ------ | ------------------ |
| note | object | See example below. |

{% tabs %}
{% tab title="200 " %}

```
{}
```

{% endtab %}

{% tab title="404 " %}

```
{}
```

{% endtab %}
{% endtabs %}

Body content example:

```
{
  "note": {
    "title": "Greenland is a part of which kingdom?",
    "content": "[Source](https://opentdb.com)",
    "type": "multiple_choice",
    "options": [
      {
        "content": "Sweden",
        "correct": false
      },
      {
        "content": "Denmark",
        "correct": true
      },
      {
        "content": "United Kingdom",
        "correct": false
      },
      {
        "content": "Norway",
        "correct": false
      }
    ]
  }
}
```

## Retrieve / Update / Delete a note in deck

<mark style="color:blue;">`GET`</mark> `https://memoet.com/api/decks/:deck:id/notes/:note:id`

Retrieve, update, delete a note by sending GET, PUT, DELETE request to endpoint above.

#### Path Parameters

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| note:id<mark style="color:red;">\*</mark> | string | ID of the note. |
| deck:id<mark style="color:red;">\*</mark> | string | ID of the deck. |

#### Headers

| Name                                             | Type   | Description           |
| ------------------------------------------------ | ------ | --------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Authentication token. |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}
