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

# Create Agent File

`POST /me/agents/{agent_id}/files`

Create a new file reference for an agent

## Path parameters

- `agent_id` string, uuid, required

## Request body

- AgentFileCreateRequest — Request model for creating a new agent file
  - `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

## Response `201`

Successfully created 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

- `400` — Invalid request or file limit exceeded
- `403` — Not authorized to access this agent
- `404` — Agent 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)
