# pub.chive.admin.triggerBackfill

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

## Definitions

### `pub.chive.admin.triggerBackfill`

**Type**: `procedure`

Trigger a backfill operation by type

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | No | DID for didSync type |
| `uri` | `string` (at-uri) | No | Eprint URI for citationExtraction type |
| `type` | `string` | Yes | Backfill operation type to trigger |
| `pdsUrl` | `string` | No | PDS URL for pdsScan type |
| `batchSize` | `integer` | No | Batch size for fullReindex type |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `operation` | `ref` → `#backfillOperation` | Yes | The started backfill operation |

#### Errors

- **AuthenticationRequired**
- **AdminRequired**
- **InvalidBackfillType**

### `pub.chive.admin.triggerBackfill#backfillOperation`

**Type**: `object`

A backfill operation record

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | Operation ID |
| `type` | `string` | Yes | Backfill operation type |
| `status` | `string` | Yes | Operation status |
| `startedAt` | `string` (datetime) | Yes | Operation start time |
| `recordsProcessed` | `integer` | Yes | Number of records processed so far |

## Raw Schema

```json
{
  "id": "pub.chive.admin.triggerBackfill",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "did": {
              "type": "string",
              "format": "did",
              "description": "DID for didSync type"
            },
            "uri": {
              "type": "string",
              "format": "at-uri",
              "description": "Eprint URI for citationExtraction type"
            },
            "type": {
              "type": "string",
              "description": "Backfill operation type to trigger",
              "knownValues": [
                "pdsScan",
                "freshnessScan",
                "citationExtraction",
                "fullReindex",
                "governanceSync",
                "didSync"
              ]
            },
            "pdsUrl": {
              "type": "string",
              "description": "PDS URL for pdsScan type"
            },
            "batchSize": {
              "type": "integer",
              "description": "Batch size for fullReindex type"
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "AdminRequired"
        },
        {
          "name": "InvalidBackfillType"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "operation"
          ],
          "properties": {
            "operation": {
              "ref": "#backfillOperation",
              "type": "ref",
              "description": "The started backfill operation"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Trigger a backfill operation by type"
    },
    "backfillOperation": {
      "type": "object",
      "required": [
        "id",
        "type",
        "status",
        "startedAt",
        "recordsProcessed"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Operation ID"
        },
        "type": {
          "type": "string",
          "description": "Backfill operation type"
        },
        "status": {
          "type": "string",
          "description": "Operation status",
          "knownValues": [
            "running",
            "completed",
            "failed",
            "cancelled"
          ]
        },
        "startedAt": {
          "type": "string",
          "format": "datetime",
          "description": "Operation start time"
        },
        "recordsProcessed": {
          "type": "integer",
          "description": "Number of records processed so far"
        }
      },
      "description": "A backfill operation record"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
