Delete file
DELETE
https://app.sulus.ai/api/v1/agents/{agent_id}/files/{file_id}
Delete a knowledge file
Authentication
Send a bearer token created on your dashboard's Developer page:
Authorization: Bearer <YOUR_API_KEY>
Path parameters
agent_id
string
Required
The agent id (UUID).
Validation:
uuid (route-constrained)Stored in
ai_projects.uidfile_id
integer
Required
The file id from the list response.
Validation:
integer (route-constrained)Stored in
ai_project_files.idErrors
| Status | Meaning | Body |
|---|---|---|
404 |
Agent not found, or you do not have access to it | |
404 |
File not found in this agent | |
401 |
Missing or invalid bearer token | |
403 |
Feature ai_chat not enabled for the account |
Notes
- Requires edit access.
curl --request DELETE \
--url https://app.sulus.ai/api/v1/agents/{agent_id}/files/{file_id} \
--header 'Authorization: Bearer <YOUR_API_KEY>'
import requests
url = "https://app.sulus.ai/api/v1/agents/{agent_id}/files/{file_id}"
headers = {"Authorization": "Bearer <YOUR_API_KEY>"}
response = requests.delete(url, headers=headers)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://app.sulus.ai/api/v1/agents/{agent_id}/files/{file_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <YOUR_API_KEY>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Response
200
{
"object": "file.deleted",
"id": 51,
"deleted": true
}
Response — DELETE
/agents/{agent_id}/files/{file_id}
200
{
"object": "file.deleted",
"id": 51,
"deleted": true
}