Delete source
DELETE/v2/agents/{agentId}/sources/{sourceId}
Remove a source from an agent so its content no longer shapes answers after the next training run, and check what remains.
Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.
Deletes a source from an agent. Call it to remove outdated pages, retired policies or files you uploaded by mistake.
The content leaves the agent's answers after the next training run. To make the change apply sooner, retrain from the dashboard under Build > Sources, or enable auto retrain with Toggle auto retrain.
Request
DELETE /v2/agents/{agentId}/sources/{sourceId}
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
agentId |
string | Yes | The ID of the agent, starting with agt_. |
sourceId |
string | Yes | The ID of the source to delete, starting with src_. |
The call has no query parameters and no body. If you may need the content again, save it first. The restore endpoint is deprecated, so the reliable way back is to add the content again with Create source.
Example request
curl -X DELETE https://api.askocto.co/v2/agents/agt_8f3k2m/sources/src_4n7c2w \
-H "Authorization: Bearer $OCTO_API_KEY"
const response = await fetch(
"https://api.askocto.co/v2/agents/agt_8f3k2m/sources/src_4n7c2w",
{
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.OCTO_API_KEY}` },
},
)
const result = await response.json()
console.log(result.deleted)
Example response
A successful call returns 200 OK.
{
"id": "src_4n7c2w",
"deleted": true
}
Response fields
| Name | Type | Description |
|---|---|---|
id |
string | The ID of the source that was deleted. |
deleted |
boolean | Always true on success. |
Use List sources to confirm what remains, or Get sources summary for the new totals.
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized |
The API key is missing, malformed or deleted. |
| 404 | not_found |
The agent or the source does not exist in your workspace, or the source was already deleted. |
| 409 | conflict |
The source is in the status training. Wait until it is ready or failed, then delete it. |
| 429 | rate_limited |
Too many requests. Wait for the number of seconds in the Retry-After header. |