# net.atpix.gallery.collectionRule

> Published by [lexicon.atpix.net](https://lexicon.garden/identity/did:plc:x4crpdfko2d7xrcd5eovpwex)

✓ This is the authoritative definition for this NSID.

## Description

Rule for sourcing photos from followed actors and/or hashtags into gallery feed or albums.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:x4crpdfko2d7xrcd5eovpwex/net.atpix.gallery.collectionRule)
- [Documentation](https://lexicon.garden/lexicon/did:plc:x4crpdfko2d7xrcd5eovpwex/net.atpix.gallery.collectionRule/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:x4crpdfko2d7xrcd5eovpwex/net.atpix.gallery.collectionRule/examples)

## Definitions

### `net.atpix.gallery.collectionRule`

**Type**: `record`

Declares social sources (follow graph, explicit DIDs, hashtags) for gallery feed or album population.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes | dc:title — human-readable rule name. |
| `active` | `boolean` | No | ATPix — inactive rules are ignored by listFeedPhotos. |
| `hashtags` | `array` | No | dc:subject — normalized hashtags (no #); matched against photo.keywords. |
| `createdAt` | `string` (datetime) | Yes | dc:date · schema:dateCreated — RFC 3339 UTC. |
| `modifiedAt` | `string` (datetime) | No | schema:dateModified — RFC 3339 UTC. |
| `description` | `string` | No | dc:description — optional explanation. |
| `targetScope` | `ref` → `net.atpix.gallery.defs#targetScope` | Yes | ATPix — gallery (social feed) or album (membership seeding). |
| `followedActors` | `array` | No | schema:follows (conceptual) — explicit DID allow-list; unioned with follow graph when useFollowGraph is true. |
| `targetAlbumUri` | `string` (at-uri) | No | ATPix — required when targetScope is album; target album AT URI. |
| `useFollowGraph` | `boolean` | No | ATPix — when true, resolve actors via app.bsky.graph.getFollows. |
| `includeOwnPhotos` | `boolean` | No | ATPix — include photos authored by the rule owner. |

## Raw Schema

```json
{
  "id": "net.atpix.gallery.collectionRule",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "name",
          "targetScope",
          "createdAt"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "dc:title — human-readable rule name."
          },
          "active": {
            "type": "boolean",
            "default": true,
            "description": "ATPix — inactive rules are ignored by listFeedPhotos."
          },
          "hashtags": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            },
            "maxLength": 50,
            "description": "dc:subject — normalized hashtags (no #); matched against photo.keywords."
          },
          "createdAt": {
            "type": "string",
            "format": "datetime",
            "description": "dc:date · schema:dateCreated — RFC 3339 UTC."
          },
          "modifiedAt": {
            "type": "string",
            "format": "datetime",
            "description": "schema:dateModified — RFC 3339 UTC."
          },
          "description": {
            "type": "string",
            "maxLength": 2000,
            "description": "dc:description — optional explanation."
          },
          "targetScope": {
            "ref": "net.atpix.gallery.defs#targetScope",
            "type": "ref",
            "description": "ATPix — gallery (social feed) or album (membership seeding)."
          },
          "followedActors": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "did"
            },
            "maxLength": 500,
            "description": "schema:follows (conceptual) — explicit DID allow-list; unioned with follow graph when useFollowGraph is true."
          },
          "targetAlbumUri": {
            "type": "string",
            "format": "at-uri",
            "description": "ATPix — required when targetScope is album; target album AT URI."
          },
          "useFollowGraph": {
            "type": "boolean",
            "default": false,
            "description": "ATPix — when true, resolve actors via app.bsky.graph.getFollows."
          },
          "includeOwnPhotos": {
            "type": "boolean",
            "default": true,
            "description": "ATPix — include photos authored by the rule owner."
          }
        }
      },
      "description": "Declares social sources (follow graph, explicit DIDs, hashtags) for gallery feed or album population."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "description": "Rule for sourcing photos from followed actors and/or hashtags into gallery feed or albums."
}
```
