## GET /v1/memories/{id}/versions

List the versions of a memory, newest first. Every create, update, and delete leaves one, holding the content after the change.

Required permissions: read:memories.
API key: Supported.
CLI user token: Supported.
Session token: Requires the ellipsis:api scope, and the session's permissions.ellipsis rules must allow the operation.
Higher permission levels include lower levels: read < write < delete.

### Response

```text
{
  "has_more": bool,
  "next_cursor": str,
  "versions": [
    {
      "content": str,
      "content_sha256": str,
      "created_at": str,
      "created_by": { # MemoryUserWriter | MemorySessionWriter |
      # MemoryApiKeyWriter | MemoryGithubWriter
        "type": "user",
        "user": {
          "avatar_url": str,
          "id": str,
          "name": str
        }
      },
      "id": str,
      "memory_id": str,
      "operation": str
    }
  ]
}
```

### Python

```python
import os

from ellipsis import Ellipsis

client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])

for item in client.memories.versions("..."):
    print(item)
```

### TypeScript

```typescript
import { Ellipsis } from '@ellipsis-dev/sdk';

const client = new Ellipsis({
  apiKey: process.env.ELLIPSIS_API_TOKEN!,
});

for await (const item of await client.memories.versions('...')) {
  console.log(item);
}
```

### cURL

```bash
curl "https://api.ellipsis.dev/v1/memories/{id}/versions" \
  -H "Authorization: Bearer $ELLIPSIS_API_TOKEN"
```

### Response schema

```json
{
  "properties": {
    "has_more": {
      "default": false,
      "type": "boolean"
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "versions": {
      "items": {
        "properties": {
          "content": {
            "type": "string"
          },
          "content_sha256": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "oneOf": [
              {
                "properties": {
                  "session_id": {
                    "type": "string"
                  },
                  "type": {
                    "const": "session",
                    "default": "session",
                    "type": "string"
                  }
                },
                "required": [
                  "session_id"
                ],
                "type": "object"
              },
              {
                "properties": {
                  "type": {
                    "const": "user",
                    "default": "user",
                    "type": "string"
                  },
                  "user": {
                    "properties": {
                      "avatar_url": {
                        "type": "object"
                      },
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "object"
                      }
                    },
                    "required": [
                      "avatar_url",
                      "id",
                      "name"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "user"
                ],
                "type": "object"
              },
              {
                "properties": {
                  "api_key_id": {
                    "type": "string"
                  },
                  "type": {
                    "const": "api_key",
                    "default": "api_key",
                    "type": "string"
                  }
                },
                "required": [
                  "api_key_id"
                ],
                "type": "object"
              },
              {
                "properties": {
                  "type": {
                    "const": "github",
                    "default": "github",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            ]
          },
          "id": {
            "type": "string"
          },
          "memory_id": {
            "type": "string"
          },
          "operation": {
            "enum": [
              "create",
              "update",
              "delete"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "memory_id",
          "operation",
          "content",
          "content_sha256",
          "created_by",
          "created_at"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "versions"
  ],
  "type": "object"
}
```
