# social.grain.unspecced.createPoolGallery

> Add a gallery to a group's pool: one permissioned space (social.grain.group) anchored on the group, holding every member's galleries. The gallery, its photos and its items are the author's own records in their own repo, written inside that space — so only the group's members can read them, and they leave with the author.

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

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

Type: procedure · POST

### Input (application/json)

- `description` (string)
  - Constraints: maxLength: 1000
- `group` (string · did, required): The group whose pool this goes into.
- `photos` (array)
  - Constraints: maxLength: 100
  - `items` (ref)
    - Reference: `#photoInput`
- `rkey` (string, required): Record key for the gallery, in the author's repo.
  - Constraints: maxLength: 64
- `title` (string, required)
  - Constraints: maxLength: 100

### Output (application/json)

- `space` (string, required): The pool space it was written into.
- `uri` (string · at-uri, required)

### Errors

- `SpacesUnsupported`: The author's PDS does not serve permissioned spaces.
- `NotAuthorized`: The viewer is not a member of this group's pool.

## #photoInput (`social.grain.unspecced.createPoolGallery#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": "Add a gallery to a group's pool: one permissioned space (social.grain.group) anchored on the group, holding every member's galleries. The gallery, its photos and its items are the author's own records in their own repo, written inside that space — so only the group's members can read them, and they leave with the author.",
      "errors": [
        {
          "description": "The author's PDS does not serve permissioned spaces.",
          "name": "SpacesUnsupported"
        },
        {
          "description": "The viewer is not a member of this group's pool.",
          "name": "NotAuthorized"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "description": {
              "maxLength": 1000,
              "type": "string"
            },
            "group": {
              "description": "The group whose pool this goes into.",
              "format": "did",
              "type": "string"
            },
            "photos": {
              "items": {
                "ref": "#photoInput",
                "type": "ref"
              },
              "maxLength": 100,
              "type": "array"
            },
            "rkey": {
              "description": "Record key for the gallery, in the author's repo.",
              "maxLength": 64,
              "type": "string"
            },
            "title": {
              "maxLength": 100,
              "type": "string"
            }
          },
          "required": [
            "group",
            "rkey",
            "title"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "space": {
              "description": "The pool space it was written into.",
              "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.createPoolGallery",
  "lexicon": 1
}
```
