Delete an uploaded file
DELETE /api/v1/files/{asset_id} permanently deletes a file you uploaded and the data derived from it: the stored bytes, extracted text, pages and units, embeddings, search entries and the cached read. Free.
Last updated
/api/v1/files/{asset_id}https://api.webcite.coWhat it deletes
Send the asset_id that upload or upload from a URL returned. The call deletes the stored bytes, the file's source versions, extracted text, pages and units, embeddings, search index entries and the cached read of the file.
Verification results and document reviews that used the file stay until you delete them: see delete a verification result, delete results in bulk and delete document reviews. When another file in your account shares the same stored object, the bytes stay for that file.
Retry after a 503
Webcite removes the search index entries, cached reads and stored bytes first, retrying each step, and then removes the file's database records in one transaction. If an outside step still fails, the call returns 503 and no record is removed, so repeating the request finds the same file and finishes the deletion.
Response example
Built from the response schema in the OpenAPI file; identifiers are placeholders.
{
"asset_id": "00000000-0000-4000-8000-000000000019",
"deleted": true
}Request
Free. Deleting a file costs 0 credits.
Examples run on your server. Set WEBCITE_API_KEY first. Python examples use the requests package.
curl --fail-with-body -X DELETE 'https://api.webcite.co/api/v1/files/YOUR_ASSET_ID' \
-H "x-api-key: $WEBCITE_API_KEY"Path and query parameters
asset_id (path)stringrequiredThe asset_id returned by POST /upload
No request body is required.
Response
HTTP 200 returns asset_id, the id you sent, and deleted: true. The file is gone at that point: a second call with the same asset_id returns 404.
200 response
application/json
asset_idstringrequireddeletedbooleanrequiredErrors
400: asset_id is not a UUID (Invalid asset id); nothing is deleted. 401: missing or invalid key. 403: app keys cannot use this endpoint. 404: no file with this asset_id in your account (File not found), which includes a file another account uploaded and one you already deleted. 503: part of the deletion failed after retries; repeat the same request to finish it.
404- No file with this asset_id in your account
503- Part of the deletion failed after retries; repeat the request to finish it