---
title: "Upload a file attachment to an item"
method: POST
path: "/projects/{projectId}/items/{itemId}/attachments"
tags: ["Items"]
---

# Upload a file attachment to an item

`POST /projects/{projectId}/items/{itemId}/attachments`

## Request

- Base URL: `https://app.ketryx.com/api/v1`
- URL: `https://app.ketryx.com/api/v1/projects/{projectId}/items/{itemId}/attachments`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/ketryx/apis/ketryx-api/docs/projects/:projectId/items/:itemId/attachments/post.ts> (a function with typed inputs; its response is checked against the schema)

Uploads a file to an existing item, creating a new versioned item record with the attachment. The item can be identified by its Ketryx ID or sourceId. Maximum file size is 500 MB by default (configurable). The file stays on later records until removed with DELETE. Approvals follow the project's invalidation settings.

## Request body `multipart/form-data`

- object
  - `file` string, binary

## Response `200`

Attachment uploaded successfully

- object
  - `id` string, required: Ketryx ID of the uploaded file
  - `attachmentId` string, required: Ketryx ID of the attachment, as listed and removed by the other attachment operations
  - `filename` string, required: Original filename of the uploaded file
  - `contentType` string, required: MIME type of the uploaded file
  - `sizeBytes` integer, required: File size in bytes
  - `url` string, required: URL to download the uploaded file
  - `itemRecordId` string, required: Ketryx ID of the newly created item record

## Other responses

- `400`: The request is not valid.
- `401`: The requester is not authenticated.
- `403`: The requester is unauthorized.
- `404`: The resource was not found.
- `409`: Another request addressing the item by its Ketryx ID is writing it, or the item changed while the file was being attached; the upload is not kept, so send it again
- `413`: File too large

---

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