# social.grain.unspecced.getPrivateGallery

> Assemble a gallery that lives in a permissioned space. Read from the repos that hold it at request time — space records never reach a firehose, so none of this is in the index.

- Kind: query
- Authority: unspecced.grain.social
- Lexicon: 1
- Published by [grain.social](https://lexicon.garden/identity/did:plc:e7rftrdyz5e2rw4y6ocszew2), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.unspecced.getPrivateGallery)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.unspecced.getPrivateGallery/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.unspecced.getPrivateGallery/analytics)

## Query (`social.grain.unspecced.getPrivateGallery`)

Type: query · GET

### Parameters (query string)

- `space` (string, required): Space URI: at://<authority>/space/social.grain.privateGallery/<skey>

### Output (application/json)

- `authority` (string · did, required)
- `gallery` (ref)
  - Reference: `#privateGallery`
- `items` (array, required)
  - `items` (ref)
    - Reference: `#privateItem`
- `space` (string, required)
- `viewerIsAuthor` (boolean)

### Errors

- `NotAuthorized`: The viewer is not a member of this space.

## #privateGallery (`social.grain.unspecced.getPrivateGallery#privateGallery`)

Type: object

### Properties

- `createdAt` (string · datetime)
- `description` (string)
- `title` (string, required)
- `uri` (string · at-uri, required)

## #privateItem (`social.grain.unspecced.getPrivateGallery#privateItem`)

Type: object

### Properties

- `alt` (string)
- `aspectRatio` (ref)
  - Reference: `social.grain.defs#aspectRatio`
- `cid` (string · cid, required): Blob CID. Fetch through the space, never the CDN.
- `did` (string · did, required): Repo holding the photo, and its blob.
- `position` (integer, required)
- `uri` (string, required): Space URI of the photo record.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Assemble a gallery that lives in a permissioned space. Read from the repos that hold it at request time — space records never reach a firehose, so none of this is in the index.",
      "errors": [
        {
          "description": "The viewer is not a member of this space.",
          "name": "NotAuthorized"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "authority": {
              "format": "did",
              "type": "string"
            },
            "gallery": {
              "ref": "#privateGallery",
              "type": "ref"
            },
            "items": {
              "items": {
                "ref": "#privateItem",
                "type": "ref"
              },
              "type": "array"
            },
            "space": {
              "type": "string"
            },
            "viewerIsAuthor": {
              "type": "boolean"
            }
          },
          "required": [
            "space",
            "authority",
            "items"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "space": {
            "description": "Space URI: at://<authority>/space/social.grain.privateGallery/<skey>",
            "type": "string"
          }
        },
        "required": [
          "space"
        ],
        "type": "params"
      },
      "type": "query"
    },
    "privateGallery": {
      "properties": {
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "title"
      ],
      "type": "object"
    },
    "privateItem": {
      "properties": {
        "alt": {
          "type": "string"
        },
        "aspectRatio": {
          "ref": "social.grain.defs#aspectRatio",
          "type": "ref"
        },
        "cid": {
          "description": "Blob CID. Fetch through the space, never the CDN.",
          "format": "cid",
          "type": "string"
        },
        "did": {
          "description": "Repo holding the photo, and its blob.",
          "format": "did",
          "type": "string"
        },
        "position": {
          "type": "integer"
        },
        "uri": {
          "description": "Space URI of the photo record.",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "did",
        "cid",
        "position"
      ],
      "type": "object"
    }
  },
  "id": "social.grain.unspecced.getPrivateGallery",
  "lexicon": 1
}
```
