# town.delve.draft.createDraft

> Published by [delve.town](https://lexicon.garden/identity/did:plc:qzqct2rrq4u2gmy5g3mjxske)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:qzqct2rrq4u2gmy5g3mjxske/town.delve.draft.createDraft)
- [Documentation](https://lexicon.garden/lexicon/did:plc:qzqct2rrq4u2gmy5g3mjxske/town.delve.draft.createDraft/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:qzqct2rrq4u2gmy5g3mjxske/town.delve.draft.createDraft/examples)

## Definitions

### `town.delve.draft.createDraft`

**Type**: `procedure`

Inserts a draft using private storage (stash). An upper limit of drafts might be enforced. Requires authentication.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `draft` | `ref` → `town.delve.draft.defs#draft` | Yes |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` (tid) | Yes | The ID of the created draft. |

#### Errors

- **DraftLimitReached**: Trying to insert a new draft when the limit was already reached.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Inserts a draft using private storage (stash). An upper limit of drafts might be enforced. Requires authentication.",
      "errors": [
        {
          "description": "Trying to insert a new draft when the limit was already reached.",
          "name": "DraftLimitReached"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "draft": {
              "ref": "town.delve.draft.defs#draft",
              "type": "ref"
            }
          },
          "required": [
            "draft"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "id": {
              "description": "The ID of the created draft.",
              "format": "tid",
              "type": "string"
            }
          },
          "required": [
            "id"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "town.delve.draft.createDraft",
  "lexicon": 1
}
```
