# org.tangled.repo.listRecordVersions

> Published by [tangled.org](https://lexicon.garden/identity/did:plc:wshs7t2adsemcrrd4snkeqli)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:wshs7t2adsemcrrd4snkeqli/org.tangled.repo.listRecordVersions)
- [Documentation](https://lexicon.garden/lexicon/did:plc:wshs7t2adsemcrrd4snkeqli/org.tangled.repo.listRecordVersions/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:wshs7t2adsemcrrd4snkeqli/org.tangled.repo.listRecordVersions/examples)

## Definitions

### `org.tangled.repo.listRecordVersions`

**Type**: `query`

Every version of a record this knot hosts, oldest first unless order says otherwise. A version's bytes are fetched by content id through com.atproto.sync.getBlocks.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cursor` | `string` | No | Pagination cursor |
| `limit` | `integer` | No |  |
| `order` | `string` | No | asc lists the oldest version first, desc the newest. |
| `uri` | `string` (at-uri) | Yes | Record in a repo this knot hosts |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cursor` | `string` | No | Cursor for the next page, left out when the page already reaches the newest version |
| `uri` | `string` (at-uri) | Yes |  |
| `versions` | `array` | Yes |  |

#### Errors

- **InvalidRequest**: The uri isn't an at-uri, or the collection isn't versioned
- **NotFound**: No such record on this knot
- **ProjectionWarming**: The record's change history is still being folded; retry shortly

### `org.tangled.repo.listRecordVersions#version`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `changeId` | `string` | Yes | Object ID of the git change that produced this version |
| `cid` | `string` (cid) | No | Content id of this version. Missing when the version was removed or the change is a deletion. |
| `createdAt` | `string` (datetime) | Yes | When this knot wrote the commit this version rides in. Not the record's own `createdAt`. |
| `editor` | `string` (did) | Yes | The account that authored the change |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Every version of a record this knot hosts, oldest first unless order says otherwise. A version's bytes are fetched by content id through com.atproto.sync.getBlocks.",
      "errors": [
        {
          "description": "The uri isn't an at-uri, or the collection isn't versioned",
          "name": "InvalidRequest"
        },
        {
          "description": "No such record on this knot",
          "name": "NotFound"
        },
        {
          "description": "The record's change history is still being folded; retry shortly",
          "name": "ProjectionWarming"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cursor": {
              "description": "Cursor for the next page, left out when the page already reaches the newest version",
              "type": "string"
            },
            "uri": {
              "format": "at-uri",
              "type": "string"
            },
            "versions": {
              "items": {
                "ref": "#version",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "uri",
            "versions"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "cursor": {
            "description": "Pagination cursor",
            "type": "string"
          },
          "limit": {
            "default": 100,
            "maximum": 500,
            "minimum": 1,
            "type": "integer"
          },
          "order": {
            "default": "asc",
            "description": "asc lists the oldest version first, desc the newest.",
            "knownValues": [
              "asc",
              "desc"
            ],
            "type": "string"
          },
          "uri": {
            "description": "Record in a repo this knot hosts",
            "format": "at-uri",
            "type": "string"
          }
        },
        "required": [
          "uri"
        ],
        "type": "params"
      },
      "type": "query"
    },
    "version": {
      "properties": {
        "changeId": {
          "description": "Object ID of the git change that produced this version",
          "type": "string"
        },
        "cid": {
          "description": "Content id of this version. Missing when the version was removed or the change is a deletion.",
          "format": "cid",
          "type": "string"
        },
        "createdAt": {
          "description": "When this knot wrote the commit this version rides in. Not the record's own `createdAt`.",
          "format": "datetime",
          "type": "string"
        },
        "editor": {
          "description": "The account that authored the change",
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "changeId",
        "editor",
        "createdAt"
      ],
      "type": "object"
    }
  },
  "id": "org.tangled.repo.listRecordVersions",
  "lexicon": 1
}
```
