# fyi.opensocial.getPageDraft

> Published by [lexicons.opensocial.fyi](https://lexicon.garden/identity/did:plc:2gqnilpksz2e7faj3bwvo6qc)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.getPageDraft)
- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.getPageDraft/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.getPageDraft/examples)

## Definitions

### `fyi.opensocial.getPageDraft#assistant`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes |  |
| `name` | `string` | Yes |  |
| `usedAt` | `string` (datetime) | Yes |  |

### `fyi.opensocial.getPageDraft#draft`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `by` | `string` | Yes | The assistant that made it. |
| `html` | `string` | Yes |  |
| `lexicons` | `array` | No | For a tab's page: lexicons of the group's own it brings, which publishing defines. |
| `network` | `array` | No | For a tab's page: the collections it reads from everyone on the network, which publishing it puts on the tab. |
| `reads` | `array` | No | For a tab's page: the kinds of record it reads from the group's spaces, which publishing puts on the tab. |
| `savedAt` | `string` (datetime) | Yes |  |
| `size` | `integer` | Yes |  |
| `spaces` | `array` | No | For a tab's page: kinds of space it keeps its records in, one of each made for its tab when it's published. |
| `title` | `string` | No | For a new page of their own: what the assistant called it. |
| `writes` | `array` | No | For a tab's page: the kinds of record it writes for the viewer, which publishing puts on the tab. |

### `fyi.opensocial.getPageDraft`

**Type**: `query`

The page the caller's assistant left for one of the site's tabs (which needs group.configure) or for one of the caller's own pages, if any, and the caller's assistants connected to the group. Only the caller's own: nobody sees another member's drafts.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `channel` | `string` | No | A tab's channel. |
| `group` | `string` (did) | Yes |  |
| `tab` | `string` | No | The tab. |
| `work` | `string` | No | Instead of a tab, one of the caller's own pages, by its key: profile, one of theirs, or new. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `assistants` | `array` | Yes |  |
| `draft` | `ref` → `#draft` | No |  |

#### Errors

- **Forbidden**
- **NotFound**

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "assistant": {
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "usedAt": {
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "usedAt"
      ],
      "type": "object"
    },
    "draft": {
      "properties": {
        "by": {
          "description": "The assistant that made it.",
          "type": "string"
        },
        "html": {
          "type": "string"
        },
        "lexicons": {
          "description": "For a tab's page: lexicons of the group's own it brings, which publishing defines.",
          "items": {
            "type": "unknown"
          },
          "type": "array"
        },
        "network": {
          "description": "For a tab's page: the collections it reads from everyone on the network, which publishing it puts on the tab.",
          "items": {
            "format": "nsid",
            "type": "string"
          },
          "maxLength": 20,
          "type": "array"
        },
        "reads": {
          "description": "For a tab's page: the kinds of record it reads from the group's spaces, which publishing puts on the tab.",
          "items": {
            "format": "nsid",
            "type": "string"
          },
          "type": "array"
        },
        "savedAt": {
          "format": "datetime",
          "type": "string"
        },
        "size": {
          "type": "integer"
        },
        "spaces": {
          "description": "For a tab's page: kinds of space it keeps its records in, one of each made for its tab when it's published.",
          "items": {
            "format": "nsid",
            "type": "string"
          },
          "type": "array"
        },
        "title": {
          "description": "For a new page of their own: what the assistant called it.",
          "type": "string"
        },
        "writes": {
          "description": "For a tab's page: the kinds of record it writes for the viewer, which publishing puts on the tab.",
          "items": {
            "format": "nsid",
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "html",
        "savedAt",
        "by",
        "size"
      ],
      "type": "object"
    },
    "main": {
      "description": "The page the caller's assistant left for one of the site's tabs (which needs group.configure) or for one of the caller's own pages, if any, and the caller's assistants connected to the group. Only the caller's own: nobody sees another member's drafts.",
      "errors": [
        {
          "name": "Forbidden"
        },
        {
          "name": "NotFound"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "assistants": {
              "items": {
                "ref": "#assistant",
                "type": "ref"
              },
              "type": "array"
            },
            "draft": {
              "ref": "#draft",
              "type": "ref"
            }
          },
          "required": [
            "assistants"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "channel": {
            "description": "A tab's channel.",
            "type": "string"
          },
          "group": {
            "format": "did",
            "type": "string"
          },
          "tab": {
            "description": "The tab.",
            "type": "string"
          },
          "work": {
            "description": "Instead of a tab, one of the caller's own pages, by its key: profile, one of theirs, or new.",
            "type": "string"
          }
        },
        "required": [
          "group"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "fyi.opensocial.getPageDraft",
  "lexicon": 1
}
```
