---
title: "Patch an existing attachment"
method: PATCH
path: "/api/workspaces/{workspaceId}/attachments/{itemAttachmentId}"
tags: ["CRUD", "ItemAttachments"]
---

# Patch an existing attachment

`PATCH /api/workspaces/{workspaceId}/attachments/{itemAttachmentId}`

## Request

- Base URL: `https://app.airfocus.com`
- URL: `https://app.airfocus.com/api/workspaces/{workspaceId}/attachments/{itemAttachmentId}`
- Auth: HTTP bearer

Returns the whole updated attachment with its sanitised data.<br/>Requirements:<br/>- auth-client scopes: "workspace"<br/>- user permission: "write" or higher

## Path parameters

- `workspaceId` string, uuid, required
- `itemAttachmentId` string, uuid, required

## Query parameters

- `actAsAdmin` boolean

## Request body

- JsonPatchOperation[]: A JSON Patch document. See https://jsonpatch.com/ for more information.
  - union
    - JsonPatchAdd
      - `op` 'add', required
      - `path` string, required
      - `value` unknown, required
    - JsonPatchCopy
      - `from` string, required
      - `op` 'copy', required
      - `path` string, required
    - JsonPatchMove
      - `from` string, required
      - `op` 'move', required
      - `path` string, required
    - JsonPatchRemove
      - `old` unknown
      - `op` 'remove', required
      - `path` string, required
    - JsonPatchReplace
      - `old` unknown
      - `op` 'replace', required
      - `path` string, required
      - `value` unknown, required
    - JsonPatchTest
      - `op` 'test', required
      - `path` string, required
      - `value` unknown, required

## Response `200`

- ItemAttachmentWithEmbed: A connection link between an item and an uploaded attachment.
  - `_embedded` object, required
  - `contentType` string, required: Type of updated content.
  - `createdAt` string, date-time, required: When this attachment link has been created.
  - `id` string, uuid, required: ID of an item-attachment link.
  - `itemId` string, uuid, required: ID of the item to which the attachment is linked.
  - `lastUpdatedAt` string, date-time, required: When this attachment link has been updated for the last time.
  - `name` string, required: Name of the attachment, e.g. its file name (to be displayed in UI).
  - `uri` string, required: URI of the attachment contents. It can be any URI, but conventionally it's a relative URI like 'attachment:1ecb9ecd-8a97-403a-a74a-741eb4b8fb69' with UUID of a file uploaded to airfocus file-storage. Such URI is then resolved by clients into a full HTTPS URL.

## Other responses

- `400`: If path parameters are invalid or payload is invalid or resource does not exist.
- `401`: If missing authentication token.
- `403`: If user does not have the required permission, or authenticated client does not have the required access scopes.
- `default`: If any other error happens.

---

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