# app.thesocialwire.socialDraft.completeAttachmentUpload

> Authentication required. Never publishes to the PDS. Authenticates every encrypted temporary part and verifies the complete reserved SHA-256 and content type before committing the private attachment. Idempotent after completion.

- 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.completeAttachmentUpload)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:qy5pluw2bsuq2x6albsgkvx3/app.thesocialwire.socialDraft.completeAttachmentUpload/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:qy5pluw2bsuq2x6albsgkvx3/app.thesocialwire.socialDraft.completeAttachmentUpload/analytics)

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

Type: procedure · POST

### Input (application/json)

- `assetId` (string, required)
  - Constraints: maxLength: 36

### 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.
- `LengthRequired`: No description in schema.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Authentication required. Never publishes to the PDS. Authenticates every encrypted temporary part and verifies the complete reserved SHA-256 and content type before committing the private attachment. Idempotent after completion.",
      "errors": [
        {
          "name": "InvalidRequest"
        },
        {
          "name": "NotFound"
        },
        {
          "name": "Conflict"
        },
        {
          "name": "Quota"
        },
        {
          "name": "UploadPending"
        },
        {
          "name": "Unavailable"
        },
        {
          "name": "Unauthorized"
        },
        {
          "name": "LengthRequired"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "assetId": {
              "maxLength": 36,
              "type": "string"
            }
          },
          "required": [
            "assetId"
          ],
          "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.completeAttachmentUpload",
  "lexicon": 1
}
```
