# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://memoet.gitbook.io/docs/reference-guides/restful-api/api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
