---
title: "Create Document Attachment From Upload"
method: POST
path: "/public/v1/documents/{id}/attachments?upload"
tags: ["Document Attachments"]
---

# Create Document Attachment From Upload

`POST /public/v1/documents/{id}/attachments?upload`

## Request

- Base URL: `https://api.pandadoc.com`
- URL: `https://api.pandadoc.com/public/v1/documents/{id}/attachments?upload`
- Auth: one of:
  - API key in header `Authorization`
  - OAuth 2
    - Authorization code: `https://app.pandadoc.com/oauth2/authorize`
    - Token URL: `https://api.pandadoc.com/oauth2/access_token`
- TypeScript: <https://skmtc.dev/pandadoc/apis/pandadoc-public-api/docs/public/v1/documents/:id/attachments%3Fupload/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates an attachment for a particular document

## Path parameters

- `id` string, required

## Request body `multipart/form-data`

- DocumentAttachmentCreateFromFile
  - `file` string, binary: Binary file to be attached to a document
  - `name` string: Optional name to set for uploaded file

## Response `200`

OK

- DocumentAttachmentResponse
  - `uuid` string
  - `date_created` string
  - `created_by` object
    - `id` string
    - `email` string
    - `first_name` string
    - `last_name` string
    - `avatar` string, nullable
  - `name` string, nullable

## Other responses

- `400`: Bad Request
- `401`: Authentication error
- `404`: Not found
- `423`: Document is locked for editing
- `429`: Too Many Requests

---

[API](https://skmtc.dev/pandadoc/apis/pandadoc-public-api.md) - [All operations](https://skmtc.dev/pandadoc/apis/pandadoc-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pandadoc/apis/pandadoc-public-api/revisions/b9a306b1a421?raw)
