# blue.microcosm.links.getBacklinks

> Published by [microcosm.blue](https://lexicon.garden/identity/did:plc:lulmyldiq4sb2ikags5sfb25)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:lulmyldiq4sb2ikags5sfb25/blue.microcosm.links.getBacklinks)
- [Documentation](https://lexicon.garden/lexicon/did:plc:lulmyldiq4sb2ikags5sfb25/blue.microcosm.links.getBacklinks/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:lulmyldiq4sb2ikags5sfb25/blue.microcosm.links.getBacklinks/examples)

## Definitions

### `blue.microcosm.links.getBacklinks`

**Type**: `query`

a list of records linking to any record, identity, or uri

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `array` | No | filter links to those from specific users |
| `limit` | `integer` | No | number of results to return |
| `source` | `string` | Yes | collection and path specification (e.g., 'app.bsky.feed.like:subject.uri') |
| `subject` | `string` (uri) | Yes | the target being linked to (at-uri, did, or uri) |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `total` | `integer` | Yes | total number of matching links |
| `cursor` | `string` | No | pagination cursor |
| `records` | `array` | Yes |  |

### `blue.microcosm.links.getBacklinks#linkRecord`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | the DID of the linking record's repository |
| `rkey` | `string` (record-key) | Yes | the record key of the linking record |
| `collection` | `string` (nsid) | Yes | the collection of the linking record |

## Raw Schema

```json
{
  "id": "blue.microcosm.links.getBacklinks",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "total",
            "records"
          ],
          "properties": {
            "total": {
              "type": "integer",
              "description": "total number of matching links"
            },
            "cursor": {
              "type": "string",
              "description": "pagination cursor"
            },
            "records": {
              "type": "array",
              "items": {
                "ref": "#linkRecord",
                "type": "ref"
              }
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "subject",
          "source"
        ],
        "properties": {
          "did": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "did"
            },
            "description": "filter links to those from specific users"
          },
          "limit": {
            "type": "integer",
            "default": 16,
            "maximum": 100,
            "minimum": 1,
            "description": "number of results to return"
          },
          "source": {
            "type": "string",
            "description": "collection and path specification (e.g., 'app.bsky.feed.like:subject.uri')"
          },
          "subject": {
            "type": "string",
            "format": "uri",
            "description": "the target being linked to (at-uri, did, or uri)"
          }
        }
      },
      "description": "a list of records linking to any record, identity, or uri"
    },
    "linkRecord": {
      "type": "object",
      "required": [
        "did",
        "collection",
        "rkey"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "the DID of the linking record's repository"
        },
        "rkey": {
          "type": "string",
          "format": "record-key",
          "description": "the record key of the linking record"
        },
        "collection": {
          "type": "string",
          "format": "nsid",
          "description": "the collection of the linking record"
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
