Delete document
DELETE
/documents/{id}
const url = 'https://api.somebodyai.co/api/v1/documents/507f1f77bcf86cd799439011';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://api.somebodyai.co/api/v1/documents/507f1f77bcf86cd799439011 \ --header 'Authorization: Bearer <token>'Deletes the document and its stored file. Fails while any agent still uses it.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
MongoDB ObjectId
string
MongoDB ObjectId
Responses
Section titled “Responses”Deleted
Media typeapplication/json
object
success
required
boolean
Example
{ "success": true}Unauthorized - missing or invalid auth
Media typeapplication/json
object
error
required
string
details
Array<string>
Example
{ "error": "Resource not found", "details": [ "Field is required" ]}Resource not found
Media typeapplication/json
object
error
required
string
details
Array<string>
Example
{ "error": "Resource not found", "details": [ "Field is required" ]}Document is attached to one or more agents
Media typeapplication/json
object
error
required
string
details
Array<string>
agentIds
required
Array<string>
Example
{ "error": "Resource not found", "details": [ "Field is required" ]}