# pub.chive.sync.checkStaleness

> 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.sync.checkStaleness)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.sync.checkStaleness/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.sync.checkStaleness/examples)

## Definitions

### `pub.chive.sync.checkStaleness`

**Type**: `query`

Check if indexed data is stale compared to PDS

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes | AT-URI of the record to check |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes |  |
| `pdsCid` | `string` (cid) | No | Current CID on PDS |
| `pdsUrl` | `string` | No | Source PDS URL |
| `isStale` | `boolean` | Yes | Whether indexed data is stale |
| `indexedAt` | `string` (datetime) | No | When the record was indexed |
| `indexedCid` | `string` (cid) | No | CID in our index |

#### Errors

- **NotFound**

## Raw Schema

```json
{
  "id": "pub.chive.sync.checkStaleness",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "NotFound"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "uri",
            "isStale"
          ],
          "properties": {
            "uri": {
              "type": "string",
              "format": "at-uri"
            },
            "pdsCid": {
              "type": "string",
              "format": "cid",
              "description": "Current CID on PDS"
            },
            "pdsUrl": {
              "type": "string",
              "description": "Source PDS URL"
            },
            "isStale": {
              "type": "boolean",
              "description": "Whether indexed data is stale"
            },
            "indexedAt": {
              "type": "string",
              "format": "datetime",
              "description": "When the record was indexed"
            },
            "indexedCid": {
              "type": "string",
              "format": "cid",
              "description": "CID in our index"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "uri"
        ],
        "properties": {
          "uri": {
            "type": "string",
            "format": "at-uri",
            "description": "AT-URI of the record to check"
          }
        }
      },
      "description": "Check if indexed data is stale compared to PDS"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
