Delete document
How deletion works: This endpoint performs a soft delete - the document is marked as deleted but not permanently removed from the database. This preserves data integrity and allows for audit trails.
What happens:
- Document is marked with deletedAt timestamp
- Document no longer appears in list queries (GET /projects//documents)
- Document details cannot be retrieved (returns 404)
- Historical data is preserved for compliance and auditing
Validation:
- Document must exist and belong to the specified project
- Document must belong to the current workspace
- Requires permission to manage documents
Use cases:
- Remove documents that are no longer needed
- Clean up draft documents
- Archive outdated versions
- Maintain data retention policies
Note: This is a permanent operation. There is no undo functionality. If you need to restore a deleted document, contact support.
DELETE
/projects/{projectId}/documents/{id}Authorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
projectIdstringrequiredProject ID
idstringrequiredDocument ID
Responses
204Document deleted successfully
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
404Document not found
Request
curl -X DELETE "https://leadtime.app/api/public/projects/string/documents/string" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"const response = await fetch("https://leadtime.app/api/public/projects/string/documents/string", {
method: "DELETE",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
});import requests
response = requests.delete(
"https://leadtime.app/api/public/projects/string/documents/string",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
},
)Response
Document deleted successfully
Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions
Document not found