---
title: "Update files by entity"
method: PATCH
path: "/files/v1/files?entityType&entityId"
tags: ["filesService"]
---

# Update files by entity

`PATCH /files/v1/files?entityType&entityId`

Update the `entity_id` for a group of files determined by `entityType` and `entityId`

It's okay to specify the parameters in the request body instead of query.

At the moment this is used internally to bind earlier uploaded files to an entity

## Query parameters

- `entityType` 'comment' | 'post' | 'task'
- `entityId` integer, required

## Request body

- object
  - `entityId` integer

## Response `200`

Successful response

- object
  - `data` FileInfoDto[]
    - `id` integer
    - `entityType` 'comment' | 'post' | 'task'
    - `entityId` integer
    - `uploadId` string, uuid
    - `originalFilename` string
    - `lastModified` integer
    - `size` integer
    - `url` string

## Other responses

- `401` — Access token is missing or invalid

---

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