# Mementos APIs

Mementos allow users to define collections of documents that can be accessed by applications. This document outlines the available Memento APIs.

## List Mementos

{% openapi src="/files/7T1Jx6BU3fZ2U5LsImW1" path="/mementos/" method="get" %}
[rememberizer\_openapi.yml](https://2952947711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyNqpTh7Mh66N0RnO0k24%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=cbad765b-1613-4222-b591-9ae17a3b7cfa)
{% endopenapi %}

### Example Requests

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

```bash
curl -X GET \
  https://api.rememberizer.ai/api/v1/mementos/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const fetchMementos = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/mementos/', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
  });
  
  const data = await response.json();
  console.log(data);
};

fetchMementos();
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests

def fetch_mementos():
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN"
    }
    
    response = requests.get(
        "https://api.rememberizer.ai/api/v1/mementos/",
        headers=headers
    )
    
    data = response.json()
    print(data)

fetch_mementos()
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token.
{% endhint %}
{% endtab %}
{% endtabs %}

## Create Memento

{% openapi src="/files/7T1Jx6BU3fZ2U5LsImW1" path="/mementos/" method="post" %}
[rememberizer\_openapi.yml](https://2952947711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyNqpTh7Mh66N0RnO0k24%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=cbad765b-1613-4222-b591-9ae17a3b7cfa)
{% endopenapi %}

### Example Requests

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

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/mementos/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Work Documents"}'
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const createMemento = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/mementos/', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Work Documents'
    })
  });
  
  const data = await response.json();
  console.log(data);
};

createMemento();
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def create_memento():
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN",
        "Content-Type": "application/json"
    }
    
    payload = {
        "name": "Work Documents"
    }
    
    response = requests.post(
        "https://api.rememberizer.ai/api/v1/mementos/",
        headers=headers,
        data=json.dumps(payload)
    )
    
    data = response.json()
    print(data)

create_memento()
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token.
{% endhint %}
{% endtab %}
{% endtabs %}

## Get Memento Details

{% openapi src="/files/7T1Jx6BU3fZ2U5LsImW1" path="/mementos/{id}/" method="get" %}
[rememberizer\_openapi.yml](https://2952947711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyNqpTh7Mh66N0RnO0k24%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=cbad765b-1613-4222-b591-9ae17a3b7cfa)
{% endopenapi %}

### Example Requests

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

```bash
curl -X GET \
  https://api.rememberizer.ai/api/v1/mementos/123/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token and `123` with an actual memento ID.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const getMementoDetails = async (mementoId) => {
  const response = await fetch(`https://api.rememberizer.ai/api/v1/mementos/${mementoId}/`, {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
  });
  
  const data = await response.json();
  console.log(data);
};

getMementoDetails(123);
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token and `123` with an actual memento ID.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests

def get_memento_details(memento_id):
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN"
    }
    
    response = requests.get(
        f"https://api.rememberizer.ai/api/v1/mementos/{memento_id}/",
        headers=headers
    )
    
    data = response.json()
    print(data)

get_memento_details(123)
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token and `123` with an actual memento ID.
{% endhint %}
{% endtab %}
{% endtabs %}

## Manage Memento Documents

{% openapi src="/files/7T1Jx6BU3fZ2U5LsImW1" path="/mementos/memento\_document/{memento\_id}/" method="post" %}
[rememberizer\_openapi.yml](https://2952947711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyNqpTh7Mh66N0RnO0k24%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=cbad765b-1613-4222-b591-9ae17a3b7cfa)
{% endopenapi %}

### Example Requests

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

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/mementos/memento_document/123/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "memento": "123",
    "add": ["document_id_1", "document_id_2"],
    "folder_add": ["folder_id_1"],
    "remove": ["document_id_3"]
  }'
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token and use actual document and folder IDs.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const manageMementoDocuments = async (mementoId) => {
  const response = await fetch(`https://api.rememberizer.ai/api/v1/mementos/memento_document/${mementoId}/`, {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      memento: mementoId,
      add: ["document_id_1", "document_id_2"],
      folder_add: ["folder_id_1"],
      remove: ["document_id_3"]
    })
  });
  
  const data = await response.json();
  console.log(data);
};

manageMementoDocuments(123);
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token and use actual document and folder IDs.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def manage_memento_documents(memento_id):
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN",
        "Content-Type": "application/json"
    }
    
    payload = {
        "memento": memento_id,
        "add": ["document_id_1", "document_id_2"],
        "folder_add": ["folder_id_1"],
        "remove": ["document_id_3"]
    }
    
    response = requests.post(
        f"https://api.rememberizer.ai/api/v1/mementos/memento_document/{memento_id}/",
        headers=headers,
        data=json.dumps(payload)
    )
    
    data = response.json()
    print(data)

manage_memento_documents(123)
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token and use actual document and folder IDs.
{% endhint %}
{% endtab %}
{% endtabs %}

## Delete Memento

{% openapi src="/files/7T1Jx6BU3fZ2U5LsImW1" path="/mementos/{id}/" method="delete" %}
[rememberizer\_openapi.yml](https://2952947711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyNqpTh7Mh66N0RnO0k24%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=cbad765b-1613-4222-b591-9ae17a3b7cfa)
{% endopenapi %}

### Example Requests

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

```bash
curl -X DELETE \
  https://api.rememberizer.ai/api/v1/mementos/123/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token and `123` with an actual memento ID.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const deleteMemento = async (mementoId) => {
  const response = await fetch(`https://api.rememberizer.ai/api/v1/mementos/${mementoId}/`, {
    method: 'DELETE',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
  });
  
  if (response.status === 204) {
    console.log("Memento deleted successfully");
  } else {
    console.error("Failed to delete memento");
  }
};

deleteMemento(123);
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token and `123` with an actual memento ID.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests

def delete_memento(memento_id):
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN"
    }
    
    response = requests.delete(
        f"https://api.rememberizer.ai/api/v1/mementos/{memento_id}/",
        headers=headers
    )
    
    if response.status_code == 204:
        print("Memento deleted successfully")
    else:
        print("Failed to delete memento")

delete_memento(123)
```

{% hint style="info" %}
To test this API call, replace `YOUR_JWT_TOKEN` with your actual JWT token and `123` with an actual memento ID.
{% endhint %}
{% 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://docs.rememberizer.ai/developer-resources/api-docs/mementos.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.
