# pub.chive.metrics.recordView

> Published by [chive.pub](https://lexicon.garden/identity/did:plc:7natp5xae72bddaqlkef2t4e)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.metrics.recordView)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.metrics.recordView/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.metrics.recordView/examples)

## Definitions

### `pub.chive.metrics.recordView`

**Type**: `procedure`

Record a view event for an eprint

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes | AT-URI of the eprint being viewed |
| `viewerDid` | `string` (did) | No | DID of the viewer (optional for anonymous views) |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `success` | `boolean` | Yes | Whether the view was recorded |

#### Errors

- **InvalidRequest**
- **NotFound**

## Raw Schema

```json
{
  "id": "pub.chive.metrics.recordView",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "uri"
          ],
          "properties": {
            "uri": {
              "type": "string",
              "format": "at-uri",
              "description": "AT-URI of the eprint being viewed"
            },
            "viewerDid": {
              "type": "string",
              "format": "did",
              "description": "DID of the viewer (optional for anonymous views)"
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "InvalidRequest"
        },
        {
          "name": "NotFound"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "success"
          ],
          "properties": {
            "success": {
              "type": "boolean",
              "description": "Whether the view was recorded"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Record a view event for an eprint"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
