---
title: "Update Agent File"
method: PATCH
path: "/me/agents/{agent_id}/files/{file_id}"
tags: ["User API"]
---

# Update Agent File

`PATCH /me/agents/{agent_id}/files/{file_id}`

Update an agent file (partial update)

## Path parameters

- `agent_id` string, uuid, required
- `file_id` string, uuid, required

## Request body

- AgentFileUpdateRequest — Request model for updating an agent file (all fields optional)
  - `filename` string, nullable
  - `mime_type` string, nullable
  - `storage_url` string, uri, nullable
  - `enabled` boolean, nullable
  - `position` integer, nullable
  - `auth` object, nullable

## Response `200`

Successfully updated agent file

- AgentFileResponse — API response wrapper for a single file
  - `data` AgentFileModel, required — Full model with database fields (ORM model)
    - `filename` string, required — Original filename
    - `mime_type` string, required — MIME type of the file
    - `storage_url` string, uri, required — External URL where the file is hosted
    - `enabled` boolean — Whether the file is active
    - `position` integer — Order position for deterministic injection
    - `auth` object, nullable — Authentication configuration for accessing the file
    - `id` string, uuid, required
    - `agent_id` string, uuid, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, nullable

## Other responses

- `403` — Not authorized to access this file
- `404` — File not found
- `422` — Validation Error

---

[API](https://skmtc.net/toolhouse/apis/toolhouse-api.md) · [All operations](https://skmtc.net/toolhouse/apis/toolhouse-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/toolhouse/toolhouse-api/versions/b29810cc692d/schema)
