Delete multiple files in a single request
curl --request POST \
--url https://paradigm.lighton.ai/api/v3/files/bulk-delete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
123,
124,
125
]
}
'import requests
url = "https://paradigm.lighton.ai/api/v3/files/bulk-delete"
payload = { "ids": [123, 124, 125] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: [123, 124, 125]})
};
fetch('https://paradigm.lighton.ai/api/v3/files/bulk-delete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": null,
"code": 400,
"error": "bad_request",
"detail": "Cannot manually delete documents from a workspace configured for synced documents. Documents in this workspace can only be managed through external datasources.",
"doc_url": "https://developers.lighton.ai/errors#bad_request"
}{
"id": null,
"code": 401,
"error": "unauthorized",
"detail": "Authentication credentials were not provided or are invalid.",
"doc_url": "https://developers.lighton.ai/errors#unauthorized"
}{
"id": null,
"code": 403,
"error": "insufficient_permissions",
"detail": "You do not have permission to perform this action.",
"doc_url": "https://developers.lighton.ai/errors#insufficient_permissions"
}{
"id": null,
"code": 404,
"error": "not_found",
"detail": "The requested resource was not found.",
"doc_url": "https://developers.lighton.ai/errors#not_found"
}{
"id": null,
"code": 422,
"error": "validation_error",
"detail": "One or more fields failed validation.",
"doc_url": "https://developers.lighton.ai/errors#validation_error",
"fields": {
"<field_name>": [
{
"error": "required",
"detail": "This field is required."
}
]
}
}{
"detail": "System is under maintenance.",
"error": "service_maintenance",
"mode": "full_shutdown",
"reason": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"endpoint_category_names": [
"<string>"
]
}Files
Delete multiple files in a single request
Permanently delete multiple files in a single request.
Authorization (applied to every file in the request):
- Visibility: file must be accessible to the user → 404 if any are not found
- Delete permission: user must have the right to delete each file → 403 if any are denied
- Workspace type: workspace must not be sync-managed → 400 if any are synced
Public datasets: instance admins (MANAGE_PUBLIC_DATASET) can bulk-delete public-dataset files. A workspace-scoped API key with read-only access to a public dataset can see the file (so it counts toward visibility) but gets 403 on the delete-permission check — public datasets are read-only for opted-in companies.
Returns 204 (No Content) on success.
POST
/
api
/
v3
/
files
/
bulk-delete
Delete multiple files in a single request
curl --request POST \
--url https://paradigm.lighton.ai/api/v3/files/bulk-delete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
123,
124,
125
]
}
'import requests
url = "https://paradigm.lighton.ai/api/v3/files/bulk-delete"
payload = { "ids": [123, 124, 125] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: [123, 124, 125]})
};
fetch('https://paradigm.lighton.ai/api/v3/files/bulk-delete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": null,
"code": 400,
"error": "bad_request",
"detail": "Cannot manually delete documents from a workspace configured for synced documents. Documents in this workspace can only be managed through external datasources.",
"doc_url": "https://developers.lighton.ai/errors#bad_request"
}{
"id": null,
"code": 401,
"error": "unauthorized",
"detail": "Authentication credentials were not provided or are invalid.",
"doc_url": "https://developers.lighton.ai/errors#unauthorized"
}{
"id": null,
"code": 403,
"error": "insufficient_permissions",
"detail": "You do not have permission to perform this action.",
"doc_url": "https://developers.lighton.ai/errors#insufficient_permissions"
}{
"id": null,
"code": 404,
"error": "not_found",
"detail": "The requested resource was not found.",
"doc_url": "https://developers.lighton.ai/errors#not_found"
}{
"id": null,
"code": 422,
"error": "validation_error",
"detail": "One or more fields failed validation.",
"doc_url": "https://developers.lighton.ai/errors#validation_error",
"fields": {
"<field_name>": [
{
"error": "required",
"detail": "This field is required."
}
]
}
}{
"detail": "System is under maintenance.",
"error": "service_maintenance",
"mode": "full_shutdown",
"reason": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"endpoint_category_names": [
"<string>"
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Request serializer for V3 bulk file deletion.
Required range:
x >= 1Response
Files deleted successfully (no content returned)