---
title: "Upload Consent Attachment"
method: POST
path: "/rest/api/preferences/v1/attachments"
tags: ["Consent Attachments"]
---

# Upload Consent Attachment

`POST /rest/api/preferences/v1/attachments`

Use this API to upload and store files which contain written consent of data subjects' transactions.

> 🗒 Things to Know
> 
> - The size of uploaded files must be less than 4MB.
> 
> - The following file formats are allowed: .pdf, .jpeg, .jpg, and .png.
> 
> - The `RefID` parameter returned within the response body can be used to attach file references to incoming data subject consents using the [Create Consent Receipts](https://developer.onetrust.com/onetrust/reference/createconsentreceiptusingpost) API.
> 
> - File references can be attached to a given data subject or data subject purpose by using the `attachments` or `PurposeAttachments` parameters in the [Create Consent Receipts](https://developer.onetrust.com/onetrust/reference/createconsentreceiptusingpost) API respectively.

## Response `200`

File uploaded successfully.

- DSPreferneceCacheUploadDataDto
  - `refId` string, uuid — Reference ID for the uploaded file.
  - `filename` string — Original name of the uploaded file.
  - `fileSize` integer — Size of the uploaded file in bytes.
  - `contentType` string — MIME type of the uploaded file.
  - `qualifiedName` string — Fully qualified name/path of the uploaded file in storage.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `429` — Too Many Requests. For more information, see [API Rate Limits](https://developer.onetrust.com/onetrust/reference/rate-limits-overview).
- `500` — Internal Server Error

---

[API](https://skmtc.net/onetrust/apis/platform-access-management.md) · [All operations](https://skmtc.net/onetrust/apis/platform-access-management/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/onetrust/platform-access-management/versions/21de3aa0b170/schema)
