---
title: "Upload a file"
method: POST
path: "/api/attachments"
tags: ["Files"]
---

# Upload a file

`POST /api/attachments`

## Request

- Base URL: `https://sandbox-l.ppay.io`
- URL: `https://sandbox-l.ppay.io/api/attachments`
- Auth: HTTP bearer

Upload a file so that it can be attached to a payment link. Only PDFs smaller than 5 MB are supported.

For sample calls, see the [public Postman collection](https://www.postman.com/peachpayments/peach-payments-public-workspace/request/3s1ozx3/payment-links-public?action=share&creator=20323380&ctx=documentation&active-environment=13324425-10da86ae-9bc2-4124-8f55-f7255fa3ff55).

## Request body `multipart/form-data`

- object
  - `file` string, binary: File content to be uploaded.

## Response `200`

File uploaded successfully.

- object
  - `fileId` string, uuid: A file ID that should be used in the files property on a create link call.

## Other responses

- `400`: The request body failed validation.
- `401`: Request lacks valid authentication.
- `404`: The specified resource was not found.

---

[API](https://skmtc.dev/peachpayments/apis/payment-links.md) - [All operations](https://skmtc.dev/peachpayments/apis/payment-links/llms.txt) - [OpenAPI document](https://skmtc.dev/peachpayments/apis/payment-links/revisions/3a63dca6b297?raw)
