# Remove file from agent

This endpoint removes a file previously attached to the agent.

Source: https://zild.ai/en-US/docs/api-reference/delete-api-Agent-file

DELETE `/Agent/file`

This endpoint removes a file previously attached to the agent.

## Authentication

**Authentication required.** Send your user API key in the X-API-Key header.

## Parameters

This operation has no path, query, or header parameters.

## Request body

**Content type:** `application/json` · **Schema:** `AgentDeleteFileRequestDto`



<table class="api-params"><thead><tr><th>Property</th><th>Type</th><th>Required</th><th>Description</th><th>Constraints</th></tr></thead><tbody><tr><td><code>fileId</code></td><td><code>string</code></td><td>No</td><td>—</td><td>nullable</td></tr><tr><td><code>agentId</code></td><td><code>integer · int32</code></td><td>No</td><td>—</td><td>—</td></tr></tbody></table>



## Example request



```
curl --request DELETE \
  --url 'https://api.zild.ai/Agent/file' \
  --header 'X-API-Key: YOUR_USER_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "fileId": "string",
  "agentId": 0
}'
```



## Responses



<table class="api-params"><thead><tr><th>Status</th><th>Description</th><th>Response body</th></tr></thead><tbody><tr><td><code>204</code></td><td>File removed successfully</td><td>No response body is defined.</td></tr></tbody></table>



## Data models

`AgentDeleteFileRequestDto`

<table class="api-params"><thead><tr><th>Property</th><th>Type</th><th>Required</th><th>Description</th><th>Constraints</th></tr></thead><tbody><tr><td><code>fileId</code></td><td><code>string</code></td><td>No</td><td>—</td><td>nullable</td></tr><tr><td><code>agentId</code></td><td><code>integer · int32</code></td><td>No</td><td>—</td><td>—</td></tr></tbody></table>
