# app.thesocialwire.socialDraft.reserveAttachment

> Owner-only private draft storage. Authentication required; disabled storage returns Unavailable. Never publishes attachments or exposes public URLs.

- Kind: procedure
- Authority: socialDraft.thesocialwire.app
- Lexicon: 1
- Published by [samclemente.me](https://lexicon.garden/identity/did:plc:qy5pluw2bsuq2x6albsgkvx3), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:qy5pluw2bsuq2x6albsgkvx3/app.thesocialwire.socialDraft.reserveAttachment)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:qy5pluw2bsuq2x6albsgkvx3/app.thesocialwire.socialDraft.reserveAttachment/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:qy5pluw2bsuq2x6albsgkvx3/app.thesocialwire.socialDraft.reserveAttachment/analytics)

## Procedure (`app.thesocialwire.socialDraft.reserveAttachment`)

Type: procedure · POST

### Input (application/json)

- `assetId` (string, required): Canonical lowercase UUID.
  - Constraints: minLength: 36, maxLength: 36
- `byteLength` (integer, required)
  - Constraints: minimum: 1, maximum: 104857600
- `contentType` (string, required)
  - Constraints: minLength: 1, maxLength: 256
- `kind` (string, required)
  - Constraints: minLength: 1, maxLength: 64, knownValues: photo | poster | gif | video | caption
- `name` (string, required)
  - Constraints: minLength: 1, maxLength: 1024
- `sha256` (string, required)
  - Constraints: minLength: 64, maxLength: 64

### Output (application/json)

- `attachment` (ref, required)
  - Reference: `app.thesocialwire.socialDraft.defs#asset`

### Errors

- `InvalidRequest`: No description in schema.
- `NotFound`: No description in schema.
- `Conflict`: No description in schema.
- `Quota`: No description in schema.
- `UploadPending`: No description in schema.
- `Unavailable`: No description in schema.
- `Unauthorized`: No description in schema.
- `AssetRetired`: This attachment identifier was retired. Reserve a fresh asset ID; do not treat ordinary Conflict as retirement.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Owner-only private draft storage. Authentication required; disabled storage returns Unavailable. Never publishes attachments or exposes public URLs.",
      "errors": [
        {
          "name": "InvalidRequest"
        },
        {
          "name": "NotFound"
        },
        {
          "name": "Conflict"
        },
        {
          "name": "Quota"
        },
        {
          "name": "UploadPending"
        },
        {
          "name": "Unavailable"
        },
        {
          "name": "Unauthorized"
        },
        {
          "description": "This attachment identifier was retired. Reserve a fresh asset ID; do not treat ordinary Conflict as retirement.",
          "name": "AssetRetired"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "assetId": {
              "description": "Canonical lowercase UUID.",
              "maxLength": 36,
              "minLength": 36,
              "type": "string"
            },
            "byteLength": {
              "maximum": 104857600,
              "minimum": 1,
              "type": "integer"
            },
            "contentType": {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            },
            "kind": {
              "knownValues": [
                "photo",
                "poster",
                "gif",
                "video",
                "caption"
              ],
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            },
            "name": {
              "maxLength": 1024,
              "minLength": 1,
              "type": "string"
            },
            "sha256": {
              "maxLength": 64,
              "minLength": 64,
              "type": "string"
            }
          },
          "required": [
            "assetId",
            "name",
            "contentType",
            "byteLength",
            "sha256",
            "kind"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "attachment": {
              "ref": "app.thesocialwire.socialDraft.defs#asset",
              "type": "ref"
            }
          },
          "required": [
            "attachment"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "app.thesocialwire.socialDraft.reserveAttachment",
  "lexicon": 1
}
```
