# fyi.opensocial.getSiteDraft

> The caller's draft of the group's site, if they have one, and whether the site's last publish can be undone. Only for whoever may change the site.

- Kind: query
- Authority: opensocial.fyi
- Lexicon: 1
- Published by [lexicons.opensocial.fyi](https://lexicon.garden/identity/did:plc:2gqnilpksz2e7faj3bwvo6qc), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.getSiteDraft)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.getSiteDraft/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.getSiteDraft/analytics)

## Query (`fyi.opensocial.getSiteDraft`)

Type: query · GET

### Parameters (query string)

- `group` (string · did, required)

### Output (application/json)

- `draft` (ref)
  - Reference: `#draft`
- `making` (boolean): Whether the host is making the caller a draft now: a new group's front page.
- `undo` (ref)
  - Reference: `#undo`

### Errors

- `Forbidden`: No description in schema.

## #change (`fyi.opensocial.getSiteDraft#change`)

Type: object

One thing a draft changes, as a member would name it, and where it is.

### Properties

- `channel` (string): The channel it's in, by its address.
- `how` (string): Added or removed; otherwise changed.
  - Constraints: knownValues: added | removed
- `name` (string, required): As a member would say it: the tab's name, "the colours and fonts".
- `path` (string): A public page's path.
- `tab` (string): The tab, by its address.
- `what` (string, required): A tab (its page or settings), a tab's public page, a channel, the site design around the public pages, the colours and fonts, the public menu, or the group's own: its name, about, rules, pictures.
  - Constraints: knownValues: tab | public | channel | design | look | menu | group

## #draft (`fyi.opensocial.getSiteDraft#draft`)

Type: object

### Properties

- `avatar` (string · uri): The group's picture, as the draft changes it.
- `banner` (string · uri): Its banner, as the draft changes it.
- `by` (string, required): Who made the last change to it: an AI app's name.
- `changed` (array): What it changes from the live site, each thing once.
  - `items` (ref)
    - Reference: `#change`
- `createdAt` (string · datetime)
- `description` (string): What the group says about itself, as the draft changes it.
- `joinPolicy` (string): How people join, as the draft changes it.
- `name` (string): The group's name, as the draft changes it.
- `note` (string): What the AI app that made it says it does, in its own words.
  - Constraints: maxLength: 3000, maxGraphemes: 300
- `rules` (array): The group's rules, as the draft has them.
  - `items` (ref)
    - Reference: `#rule`
- `updatedAt` (string · datetime, required)
- `uri` (string · at-uri, required): The draft's site record, in the members space.

## #rule (`fyi.opensocial.getSiteDraft#rule`)

Type: object

### Properties

- `text` (string)
- `title` (string, required)

## #undo (`fyi.opensocial.getSiteDraft#undo`)

Type: object

### Properties

- `mine` (boolean, required)
- `publishedAt` (string · datetime, required)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "change": {
      "description": "One thing a draft changes, as a member would name it, and where it is.",
      "properties": {
        "channel": {
          "description": "The channel it's in, by its address.",
          "type": "string"
        },
        "how": {
          "description": "Added or removed; otherwise changed.",
          "knownValues": [
            "added",
            "removed"
          ],
          "type": "string"
        },
        "name": {
          "description": "As a member would say it: the tab's name, \"the colours and fonts\".",
          "type": "string"
        },
        "path": {
          "description": "A public page's path.",
          "type": "string"
        },
        "tab": {
          "description": "The tab, by its address.",
          "type": "string"
        },
        "what": {
          "description": "A tab (its page or settings), a tab's public page, a channel, the site design around the public pages, the colours and fonts, the public menu, or the group's own: its name, about, rules, pictures.",
          "knownValues": [
            "tab",
            "public",
            "channel",
            "design",
            "look",
            "menu",
            "group"
          ],
          "type": "string"
        }
      },
      "required": [
        "what",
        "name"
      ],
      "type": "object"
    },
    "draft": {
      "properties": {
        "avatar": {
          "description": "The group's picture, as the draft changes it.",
          "format": "uri",
          "type": "string"
        },
        "banner": {
          "description": "Its banner, as the draft changes it.",
          "format": "uri",
          "type": "string"
        },
        "by": {
          "description": "Who made the last change to it: an AI app's name.",
          "type": "string"
        },
        "changed": {
          "description": "What it changes from the live site, each thing once.",
          "items": {
            "ref": "#change",
            "type": "ref"
          },
          "type": "array"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "description": {
          "description": "What the group says about itself, as the draft changes it.",
          "type": "string"
        },
        "joinPolicy": {
          "description": "How people join, as the draft changes it.",
          "type": "string"
        },
        "name": {
          "description": "The group's name, as the draft changes it.",
          "type": "string"
        },
        "note": {
          "description": "What the AI app that made it says it does, in its own words.",
          "maxGraphemes": 300,
          "maxLength": 3000,
          "type": "string"
        },
        "rules": {
          "description": "The group's rules, as the draft has them.",
          "items": {
            "ref": "#rule",
            "type": "ref"
          },
          "type": "array"
        },
        "updatedAt": {
          "format": "datetime",
          "type": "string"
        },
        "uri": {
          "description": "The draft's site record, in the members space.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "by",
        "updatedAt",
        "uri"
      ],
      "type": "object"
    },
    "main": {
      "description": "The caller's draft of the group's site, if they have one, and whether the site's last publish can be undone. Only for whoever may change the site.",
      "errors": [
        {
          "name": "Forbidden"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "draft": {
              "ref": "#draft",
              "type": "ref"
            },
            "making": {
              "description": "Whether the host is making the caller a draft now: a new group's front page.",
              "type": "boolean"
            },
            "undo": {
              "ref": "#undo",
              "type": "ref"
            }
          },
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "group": {
            "format": "did",
            "type": "string"
          }
        },
        "required": [
          "group"
        ],
        "type": "params"
      },
      "type": "query"
    },
    "rule": {
      "properties": {
        "text": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "type": "object"
    },
    "undo": {
      "properties": {
        "mine": {
          "type": "boolean"
        },
        "publishedAt": {
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "publishedAt",
        "mine"
      ],
      "type": "object"
    }
  },
  "id": "fyi.opensocial.getSiteDraft",
  "lexicon": 1
}
```
