---
title: "Update a document"
method: PATCH
path: "/api/v1/documents/{id4n}/{organizationId}/{fileName}/metadata"
tags: ["Storage"]
---

# Update a document

`PATCH /api/v1/documents/{id4n}/{organizationId}/{fileName}/metadata`

## Path parameters

- `organizationId` string, required
- `id4n` string, required
- `fileName` string, required

## Request body

- DocumentUpdate
  - `filename` string — File Name
  - `mimeType` string — Mime Type
  - `visibility` VisibilityUpdate
    - `public` boolean — Document is publicly readable (if ID4N is owned by the same organization)
    - `sharedWithOrganizationIds` string[] — Document is readable by these organizations (independend of ID4N ownership)

## Response `200`

OK

- Document
  - `filename` string — File Name
  - `mimeType` string — Mime Type
  - `ownerOrganizationId` string — The organization's namespace which owns the document
  - `visibility` Visibility
    - `public` boolean — Document is publicly readable (if ID4N is owned by the same organization)
    - `sharedOrganizationIds` string[] — Document is readable by these organizations (independend of ID4N ownership)

## Other responses

- `204` — No Content
- `401` — Unauthorized
- `403` — Forbidden

---

[API](https://skmtc.dev/id4i/apis/id4i-api.md) · [All operations](https://skmtc.dev/id4i/apis/id4i-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/id4i/id4i-api/revisions/b5f585ff1a29/schema)
