# net.atpix.gallery.createAlbum

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

✓ This is the authoritative definition for this NSID.

## Links

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

## Definitions

### `net.atpix.gallery.createAlbum`

**Type**: `procedure`

Create an album. When visibility is permissioned, provisions a HappyView space (type net.atpix.gallery.albumSpace) and links spaceUri.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes |  |
| `spaceKey` | `string` | No |  |
| `visibility` | `ref` → `net.atpix.gallery.defs#visibility` | Yes |  |
| `description` | `string` | No |  |
| `seedFromRules` | `boolean` | No | When true, evaluate linked collectionRuleUris and create initial albumItem records. |
| `collectionRuleUris` | `array` | No |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | Yes |  |
| `uri` | `string` (at-uri) | Yes |  |
| `spaceUri` | `string` | No |  |

## Raw Schema

```json
{
  "id": "net.atpix.gallery.createAlbum",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "name",
            "visibility"
          ],
          "properties": {
            "name": {
              "type": "string",
              "maxLength": 200
            },
            "spaceKey": {
              "type": "string",
              "maxLength": 64
            },
            "visibility": {
              "ref": "net.atpix.gallery.defs#visibility",
              "type": "ref"
            },
            "description": {
              "type": "string",
              "maxLength": 5000
            },
            "seedFromRules": {
              "type": "boolean",
              "default": false,
              "description": "When true, evaluate linked collectionRuleUris and create initial albumItem records."
            },
            "collectionRuleUris": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "at-uri"
              },
              "maxLength": 20
            }
          }
        },
        "encoding": "application/json"
      },
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "uri",
            "cid"
          ],
          "properties": {
            "cid": {
              "type": "string",
              "format": "cid"
            },
            "uri": {
              "type": "string",
              "format": "at-uri"
            },
            "spaceUri": {
              "type": "string",
              "maxLength": 512
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Create an album. When visibility is permissioned, provisions a HappyView space (type net.atpix.gallery.albumSpace) and links spaceUri."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
