# blue.microcosm.repo.getRecordByUri

> Published by [microcosm.blue](https://lexicon.garden/identity/did:plc:lulmyldiq4sb2ikags5sfb25)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:lulmyldiq4sb2ikags5sfb25/blue.microcosm.repo.getRecordByUri)
- [Documentation](https://lexicon.garden/lexicon/did:plc:lulmyldiq4sb2ikags5sfb25/blue.microcosm.repo.getRecordByUri/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:lulmyldiq4sb2ikags5sfb25/blue.microcosm.repo.getRecordByUri/examples)

## Definitions

### `blue.microcosm.repo.getRecordByUri`

**Type**: `query`

Get a single record from a repository by at-uri

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | No | The CID of the version of the record. If not specified, then return the most recent version. If specified and a newer version of the record exists, returns 404 not found. |
| `at_uri` | `string` (at-uri) | Yes | The at-uri of the record. The identifier can be a DID or an atproto handle. The collection and rkey segments must be present. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | No |  |
| `uri` | `string` (at-uri) | Yes |  |
| `value` | `unknown` | Yes |  |

#### Errors

- **RecordNotFound**

## Raw Schema

```json
{
  "id": "blue.microcosm.repo.getRecordByUri",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "RecordNotFound"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "uri",
            "value"
          ],
          "properties": {
            "cid": {
              "type": "string",
              "format": "cid"
            },
            "uri": {
              "type": "string",
              "format": "at-uri"
            },
            "value": {
              "type": "unknown"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "at_uri"
        ],
        "properties": {
          "cid": {
            "type": "string",
            "format": "cid",
            "description": "The CID of the version of the record. If not specified, then return the most recent version. If specified and a newer version of the record exists, returns 404 not found."
          },
          "at_uri": {
            "type": "string",
            "format": "at-uri",
            "description": "The at-uri of the record. The identifier can be a DID or an atproto handle. The collection and rkey segments must be present."
          }
        }
      },
      "description": "Get a single record from a repository by at-uri"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
