# at.protocube.getDraft

> Read the caller's working draft for one record. Another user's draft is NotFound, never Forbidden.

- Kind: query
- Authority: protocube.at
- Lexicon: 1
- Published by [protocube.at](https://lexicon.garden/identity/did:plc:it2qbdcai2lchnnnt3caynqx), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:it2qbdcai2lchnnnt3caynqx/at.protocube.getDraft)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:it2qbdcai2lchnnnt3caynqx/at.protocube.getDraft/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:it2qbdcai2lchnnnt3caynqx/at.protocube.getDraft/analytics)

## Query (`at.protocube.getDraft`)

Type: query · GET

### Parameters (query string)

- `collection` (string · nsid, required)
- `rkey` (string · record-key, required)

### Output (application/json)

- `schema` (ref)
  - Reference: `#draftView`

### Errors

- `NotFound`: No description in schema.
- `InvalidRequest`: No description in schema.
- `Unauthorized`: No description in schema.

## #draftRecord (`at.protocube.getDraft#draftRecord`)

Type: object

### Properties

- `baseCid` (string · cid)
- `payload` (unknown, required)
- `updatedAt` (string · datetime, required)

## #draftView (`at.protocube.getDraft#draftView`)

Type: object

### Properties

- `draft` (ref, required)
  - Reference: `#draftRecord`

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "draftRecord": {
      "properties": {
        "baseCid": {
          "format": "cid",
          "type": "string"
        },
        "payload": {
          "type": "unknown"
        },
        "updatedAt": {
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "payload",
        "updatedAt"
      ],
      "type": "object"
    },
    "draftView": {
      "properties": {
        "draft": {
          "ref": "#draftRecord",
          "type": "ref"
        }
      },
      "required": [
        "draft"
      ],
      "type": "object"
    },
    "main": {
      "description": "Read the caller's working draft for one record. Another user's draft is NotFound, never Forbidden.",
      "errors": [
        {
          "name": "NotFound"
        },
        {
          "name": "InvalidRequest"
        },
        {
          "name": "Unauthorized"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "ref": "#draftView",
          "type": "ref"
        }
      },
      "parameters": {
        "properties": {
          "collection": {
            "format": "nsid",
            "type": "string"
          },
          "rkey": {
            "format": "record-key",
            "type": "string"
          }
        },
        "required": [
          "collection",
          "rkey"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "at.protocube.getDraft",
  "lexicon": 1
}
```
