···43434444## API
45454646-Asterism implements three endpoints from the [microcosm links XRPC namespace](https://constellation.microcosm.blue/):
4646+Asterism implements all five current endpoints from the [microcosm links XRPC namespace](https://constellation.microcosm.blue/) (the older `/links/*` REST endpoints are deprecated upstream in favor of these and aren't implemented here):
47474848### `GET /xrpc/blue.microcosm.links.getBacklinksCount`
4949···87878888Records identify the linking record by DID, collection, and rkey. Clients must hydrate display data separately (via AppView, PDS, etc.).
89899090+### `GET /xrpc/blue.microcosm.links.getManyToMany`
9191+9292+Join records linking to a subject with a second field path on those same records — a one-hop join in a single query. For example, `app.bsky.graph.listitem` records have both a `list` field and a `subject` field; joining them resolves list membership directly instead of requiring a `getBacklinks` call followed by N individual record lookups.
9393+9494+| Parameter | Description |
9595+|---|---|
9696+| `subject` | Target AT-URI, DID, or URL (required) |
9797+| `source` | Collection and field path (required) |
9898+| `pathToOther` | Second field path on the same source record (required) |
9999+| `linkDid` | Filter to specific linking-record DIDs (repeatable) |
100100+| `otherSubject` | Filter to specific secondary link targets (repeatable) |
101101+| `limit` | Page size, 1–1000 (default 100) |
102102+| `cursor` | Pagination cursor from previous response |
103103+104104+Response: `{"total": 42, "items": [{"linkRecord": {"did": "...", "collection": "...", "rkey": "..."}, "otherSubject": "..."}], "cursor": "..."}`
105105+106106+### `GET /xrpc/blue.microcosm.links.getManyToManyCounts`
107107+108108+Like `getManyToMany`, but grouped: counts of linking records per distinct secondary target instead of the individual records themselves. Useful when you only need aggregate counts, e.g. "how many people on each of these lists also follow me" without paginating every membership record.
109109+110110+| Parameter | Description |
111111+|---|---|
112112+| `subject` | Target AT-URI, DID, or URL (required) |
113113+| `source` | Collection and field path (required) |
114114+| `pathToOther` | Second field path on the same source record (required) |
115115+| `did` | Filter to specific linking-record DIDs (repeatable) |
116116+| `otherSubject` | Filter to specific secondary link targets (repeatable) |
117117+| `limit` | Page size, 1–1000 (default 100) |
118118+| `cursor` | Pagination cursor from previous response |
119119+120120+Response: `{"counts_by_other_subject": [{"subject": "...", "total": 42, "distinct": 12}], "cursor": "..."}`
121121+122122+Note the DID filter parameter is `did` here, not `linkDid` like `getManyToMany` — a real inconsistency in the upstream Constellation API (their own source flags it as a known TODO), preserved here for compatibility rather than "fixed."
123123+90124## Roadmap
9112592126**Near term**
931279494-- [ ] `blue.microcosm.links.getManyToMany` endpoint (Constellation parity)
128128+- [x] Full Constellation API parity (`getBacklinksCount`, `getBacklinkDids`, `getBacklinks`, `getManyToMany`, `getManyToManyCounts`)
95129- [ ] Configurable listen address, database path, and relay URL
96130- [ ] Account deletion and deactivation handling
97131- [x] Graceful shutdown and Firehose reconnect