# pub.chive.backlink.create

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

## Definitions

### `pub.chive.backlink.create`

**Type**: `procedure`

Create a backlink record. Internal/plugin use only. Requires authentication.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `context` | `string` | No | Optional context about the backlink |
| `sourceUri` | `string` (at-uri) | Yes | AT-URI of the source record |
| `targetUri` | `string` (at-uri) | Yes | AT-URI of the target eprint |
| `sourceType` | `string` | Yes | Type of the source record |

#### Output

**Encoding**: `application/json`

#### Errors

- **AuthenticationRequired**
- **InvalidRequest**

### `pub.chive.backlink.create#backlink`

**Type**: `object`

Backlink record

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `integer` | Yes | Backlink ID |
| `context` | `string` | No | Optional context about the backlink |
| `deleted` | `boolean` | Yes | Whether the backlink has been deleted |
| `indexedAt` | `string` (datetime) | Yes | Timestamp when the backlink was indexed |
| `sourceUri` | `string` (at-uri) | Yes | AT-URI of the source record |
| `targetUri` | `string` (at-uri) | Yes | AT-URI of the target eprint |
| `sourceType` | `string` | Yes | Type of the source record |

## Raw Schema

```json
{
  "id": "pub.chive.backlink.create",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "sourceUri",
            "sourceType",
            "targetUri"
          ],
          "properties": {
            "context": {
              "type": "string",
              "maxLength": 500,
              "description": "Optional context about the backlink"
            },
            "sourceUri": {
              "type": "string",
              "format": "at-uri",
              "description": "AT-URI of the source record"
            },
            "targetUri": {
              "type": "string",
              "format": "at-uri",
              "description": "AT-URI of the target eprint"
            },
            "sourceType": {
              "type": "string",
              "description": "Type of the source record",
              "knownValues": [
                "cosmik.collection",
                "leaflet.list",
                "whitewind.blog",
                "bluesky.post",
                "bluesky.embed",
                "other"
              ]
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "InvalidRequest"
        }
      ],
      "output": {
        "schema": {
          "ref": "#backlink",
          "type": "ref"
        },
        "encoding": "application/json"
      },
      "description": "Create a backlink record. Internal/plugin use only. Requires authentication."
    },
    "backlink": {
      "type": "object",
      "required": [
        "id",
        "sourceUri",
        "sourceType",
        "targetUri",
        "indexedAt",
        "deleted"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "Backlink ID"
        },
        "context": {
          "type": "string",
          "maxLength": 500,
          "description": "Optional context about the backlink"
        },
        "deleted": {
          "type": "boolean",
          "description": "Whether the backlink has been deleted"
        },
        "indexedAt": {
          "type": "string",
          "format": "datetime",
          "description": "Timestamp when the backlink was indexed"
        },
        "sourceUri": {
          "type": "string",
          "format": "at-uri",
          "description": "AT-URI of the source record"
        },
        "targetUri": {
          "type": "string",
          "format": "at-uri",
          "description": "AT-URI of the target eprint"
        },
        "sourceType": {
          "type": "string",
          "description": "Type of the source record",
          "knownValues": [
            "cosmik.collection",
            "leaflet.list",
            "whitewind.blog",
            "bluesky.post",
            "bluesky.embed",
            "other"
          ]
        }
      },
      "description": "Backlink record"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
