# app.zeens.getCollectionsContaining

> Published by [zeens.app](https://lexicon.garden/identity/did:plc:pwpuqwge6g7xrjmfbw73uycw)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:pwpuqwge6g7xrjmfbw73uycw/app.zeens.getCollectionsContaining)
- [Documentation](https://lexicon.garden/lexicon/did:plc:pwpuqwge6g7xrjmfbw73uycw/app.zeens.getCollectionsContaining/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:pwpuqwge6g7xrjmfbw73uycw/app.zeens.getCollectionsContaining/examples)

## Definitions

### `app.zeens.getCollectionsContaining`

**Type**: `query`

For a viewer, list which of their own collections (private + public) currently contain a given subject URI. Each match includes the parent collection's name, rkey, and visibility. Used by the 'Add to collection' modal to show which boxes are already checked, and by the post-detail page to render a 'part of collection' pill (public collections only).

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `subject` | `string` (at-uri) | Yes | AT-URI of the post or article. |
| `viewer` | `string` (did) | Yes | DID of the requester (collections owner). |

#### Output

**Encoding**: `application/json`

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "For a viewer, list which of their own collections (private + public) currently contain a given subject URI. Each match includes the parent collection's name, rkey, and visibility. Used by the 'Add to collection' modal to show which boxes are already checked, and by the post-detail page to render a 'part of collection' pill (public collections only).",
      "output": {
        "encoding": "application/json"
      },
      "parameters": {
        "properties": {
          "subject": {
            "description": "AT-URI of the post or article.",
            "format": "at-uri",
            "type": "string"
          },
          "viewer": {
            "description": "DID of the requester (collections owner).",
            "format": "did",
            "type": "string"
          }
        },
        "required": [
          "viewer",
          "subject"
        ],
        "type": "params"
      },
      "target_collection": "app.zeens.collectionItem",
      "type": "query"
    }
  },
  "id": "app.zeens.getCollectionsContaining",
  "lexicon": 1
}
```
