{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "backlink": {
      "description": "Backlink record",
      "properties": {
        "context": {
          "description": "Optional context about the backlink",
          "maxLength": 500,
          "type": "string"
        },
        "deleted": {
          "description": "Whether the backlink has been deleted",
          "type": "boolean"
        },
        "id": {
          "description": "Backlink ID",
          "type": "integer"
        },
        "indexedAt": {
          "description": "Timestamp when the backlink was indexed",
          "format": "datetime",
          "type": "string"
        },
        "sourceType": {
          "description": "Type of the source record",
          "knownValues": [
            "cosmik.collection",
            "leaflet.list",
            "bluesky.post",
            "bluesky.embed",
            "other"
          ],
          "type": "string"
        },
        "sourceUri": {
          "description": "AT-URI of the source record",
          "format": "at-uri",
          "type": "string"
        },
        "targetUri": {
          "description": "AT-URI of the target eprint",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "id",
        "sourceUri",
        "sourceType",
        "targetUri",
        "indexedAt",
        "deleted"
      ],
      "type": "object"
    },
    "main": {
      "description": "List backlinks to an eprint from ATProto ecosystem sources including Cosmik collections, Leaflet lists, Whitewind blogs, and Bluesky shares",
      "errors": [
        {
          "name": "NotFound"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "backlinks": {
              "description": "List of backlinks",
              "items": {
                "ref": "#backlink",
                "type": "ref"
              },
              "type": "array"
            },
            "cursor": {
              "description": "Pagination cursor for next page",
              "type": "string"
            },
            "hasMore": {
              "description": "Whether more results are available",
              "type": "boolean"
            }
          },
          "required": [
            "backlinks",
            "hasMore"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "cursor": {
            "description": "Pagination cursor",
            "type": "string"
          },
          "limit": {
            "default": 50,
            "description": "Maximum number of backlinks to return",
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "sourceType": {
            "description": "Filter by source type",
            "knownValues": [
              "cosmik.collection",
              "leaflet.list",
              "bluesky.post",
              "bluesky.embed",
              "other"
            ],
            "type": "string"
          },
          "targetUri": {
            "description": "AT-URI of the target eprint",
            "format": "at-uri",
            "type": "string"
          }
        },
        "required": [
          "targetUri"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "pub.chive.backlink.list",
  "lexicon": 1,
  "revision": 1
}
