# Deck API

## Get all decks

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

This endpoint allows you to get all your decks.

#### Query Parameters

| Name   | Type   | Description                           |
| ------ | ------ | ------------------------------------- |
| limit  | number | Number of decks return per page.      |
| before | string | Before cursor from response metadata. |
| after  | string | After cursor from response metadata.  |

#### Headers

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

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

```
{
    "data": [
        {
            "created_at": "2021-03-20T15:53:31",
            "id": "2253519f-6454-4dfb-aa95-b3704aee195e",
            "name": "50 geography quiz",
            "public": false,
            "source_id": null,
            "updated_at": "2021-03-21T13:45:37"
        },
        {
            "created_at": "2021-03-20T15:11:05",
            "id": "61d118ca-e969-467c-a1f8-7d26d79c8738",
            "name": "50 history quiz",
            "public": true,
            "source_id": "87b3a8de-4d6d-4d3e-b724-19cb21a8d0ba",
            "updated_at": "2021-03-20T15:19:36"
        },
        {
            "created_at": "2021-03-15T13:05:16",
            "id": "56e10c98-f30f-4eea-a9ef-02a8bd94f74b",
            "name": "50 math quiz",
            "public": false,
            "source_id": null,
            "updated_at": "2021-03-20T10:38:53"
        }
    ],
    "metadata": {
        "after": "g3QAAAABZAAKdXBkYXRlZF9hdHQAAAAJZAAKX19zdHJ1Y3RfX2QAFEVsaXhpci5OYWl2ZURhdGVUaW1lZAAIY2FsZW5kYXJkABNFbGl4aXIuQ2FsZW5kYXIuSVNPZAADZGF5YRBkAARob3VyYQ1kAAttaWNyb3NlY29uZGgCYQBhAGQABm1pbnV0ZWEhZAAFbW9udGhhA2QABnNlY29uZGE7ZAAEeWVhcmIAAAfl",
        "before": null,
        "limit": 3,
        "total_count": 10
    }
}
```

{% endtab %}
{% endtabs %}

## Creat new deck

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

This endpoint allows you to create a new deck.

#### Headers

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

#### Request Body

| Name | Type   | Description |
| ---- | ------ | ----------- |
| name | string | Deck name.  |

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

```
{
    "data": {
        "created_at": "2021-03-21T14:02:38",
        "id": "6def445e-2b8c-488b-a9f8-0c6248bcedf5",
        "name": "50 math quiz",
        "public": false,
        "source_id": null,
        "updated_at": "2021-03-21T14:02:38"
    }
}
```

{% endtab %}
{% endtabs %}

## Retrieve / Update / Delete a deck

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

Retrieve, update, delete a deck by sending GET / PUT / DELETE to above endpoint.

#### Path Parameters

| Name    | Type   | Description     |
| ------- | ------ | --------------- |
| deck:id | string | ID of the deck. |

#### Headers

| Name           | Type   | Description           |
| -------------- | ------ | --------------------- |
| Authentication | 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/deck-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.
