# social.grain.unspecced.createPrivateGallery

> Create a gallery that lives in a permissioned space (proposal 0016) rather than in the public repo. The gallery, its photos and its items are written to the author's space repo, and only the accounts named in members can read them.

- Kind: procedure
- 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.createPrivateGallery)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.unspecced.createPrivateGallery/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.unspecced.createPrivateGallery/analytics)

## Procedure (`social.grain.unspecced.createPrivateGallery`)

Type: procedure · POST

### Input (application/json)

- `description` (string)
  - Constraints: maxLength: 1000
- `members` (array): Handles or DIDs allowed to read the gallery. The author always can.
  - Constraints: maxLength: 100
  - `items` (string)
- `photos` (array)
  - Constraints: maxLength: 100
  - `items` (ref)
    - Reference: `#photoInput`
- `rkey` (string, required): Record key for the gallery. Doubles as the space's skey, so one gallery is one space.
  - Constraints: maxLength: 64
- `title` (string, required)
  - Constraints: maxLength: 100

### Output (application/json)

- `space` (string, required): The space URI the gallery lives in.
- `uri` (string · at-uri, required)

### Errors

- `SpacesUnsupported`: The author's PDS does not serve permissioned spaces.
- `ActorNotFound`: One of the named members could not be resolved.

## #photoInput (`social.grain.unspecced.createPrivateGallery#photoInput`)

Type: object

### Properties

- `alt` (string)
- `aspectRatio` (ref, required)
  - Reference: `social.grain.defs#aspectRatio`
- `photo` (blob, required)
  - Constraints: maxSize: 1000000, accept: image/*

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Create a gallery that lives in a permissioned space (proposal 0016) rather than in the public repo. The gallery, its photos and its items are written to the author's space repo, and only the accounts named in members can read them.",
      "errors": [
        {
          "description": "The author's PDS does not serve permissioned spaces.",
          "name": "SpacesUnsupported"
        },
        {
          "description": "One of the named members could not be resolved.",
          "name": "ActorNotFound"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "description": {
              "maxLength": 1000,
              "type": "string"
            },
            "members": {
              "description": "Handles or DIDs allowed to read the gallery. The author always can.",
              "items": {
                "type": "string"
              },
              "maxLength": 100,
              "type": "array"
            },
            "photos": {
              "items": {
                "ref": "#photoInput",
                "type": "ref"
              },
              "maxLength": 100,
              "type": "array"
            },
            "rkey": {
              "description": "Record key for the gallery. Doubles as the space's skey, so one gallery is one space.",
              "maxLength": 64,
              "type": "string"
            },
            "title": {
              "maxLength": 100,
              "type": "string"
            }
          },
          "required": [
            "rkey",
            "title"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "space": {
              "description": "The space URI the gallery lives in.",
              "type": "string"
            },
            "uri": {
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "space",
            "uri"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    },
    "photoInput": {
      "properties": {
        "alt": {
          "type": "string"
        },
        "aspectRatio": {
          "ref": "social.grain.defs#aspectRatio",
          "type": "ref"
        },
        "photo": {
          "accept": [
            "image/*"
          ],
          "maxSize": 1000000,
          "type": "blob"
        }
      },
      "required": [
        "photo",
        "aspectRatio"
      ],
      "type": "object"
    }
  },
  "id": "social.grain.unspecced.createPrivateGallery",
  "lexicon": 1
}
```
