Endpoint Overview
HTTP Method
DELETE
Endpoint URL
Authentication
This endpoint requires authentication using an API token. You must include your API token as a Bearer token in the Authorization header.Learn how to create and manage API tokens in the API Tokens guide.
Request Format
Headers
Request Body
The request must be sent as JSON with the following field:
You can obtain
file_id from List sources or from Get build status after an ingestion completes.
Important Considerations
Permanent Deletion
Permanent Deletion
Warning: This operation is irreversible
- All document content and metadata will be permanently removed
- Associated partition nodes and embeddings will be deleted
- No backup or recovery options are available
Using file_id
Using file_id
Identifier required
- Use the source’s unique
file_id(returned by list sources or build status) - Use List sources to see all sources and their
file_ids
Request Example
Response Format
Success Response (200 OK)
Response Fields
Code Examples
JavaScript/Node.js
Python
cURL
Error Responses
Common Error Codes
Error Response Format
Error Examples
File Not Found (404)
File Not Found (404)
- Verify the exact
file_id(obtain it from List sources or Get build status) - Use the List Sources endpoint to check available sources
- Ensure the source wasn’t already deleted
Invalid API Token (401)
Invalid API Token (401)
- Check your API token format (should start with “grlm_”)
- Verify the token hasn’t been revoked in the dashboard
- Ensure correct Authorization header format
Access Denied (403)
Access Denied (403)
- Verify you’re using the correct API token for this project
- Check that you have delete permissions
- Contact your project administrator
Invalid Request (400)
Invalid Request (400)
file_id in request bodySolutions:- Include
file_idin the JSON body (required) - Get
file_idfrom List sources or Get build status
Best Practices
Pre-Deletion Verification
Always verify before deletion
Always verify before deletion
Check for active processing
Check for active processing
Before deleting documents that are currently processing:
- Wait for processing to complete when possible
- Processing documents may be in an inconsistent state
- Consider the impact on any dependent workflows
- Monitor processing status using the List Sources endpoint
Review downstream dependencies
Review downstream dependencies
Before deletion, consider:
- Which systems depend on this document
- Impact on downstream processing
- Whether alternative documents can serve the same purpose
- Whether you need to re-ingest or reprocess replacement sources
Safety Measures
- Implement confirmation prompts in interactive applications
- Log all deletion operations for audit trails
- Use descriptive variable names to avoid accidental deletions
- Test with non-production data when implementing deletion features
- Consider soft deletion patterns for critical applications
Error Handling
- Implement retry logic for transient network errors (not for 404/403 errors)
- Validate
file_idbefore making deletion requests - Handle batch operations carefully to avoid partial failures
- Provide clear error messages to end users
Integration Examples
Batch Deletion with Safety Checks
Project Cleanup Tool
File Lifecycle Management
Troubleshooting
Source not found errors
Source not found errors
Causes: Source doesn’t exist, wrong file_id, or already deletedSolutions:
- Use List sources to get valid
file_ids - Verify you’re using the correct project/API token
- The source may have been deleted by another process
Authentication failures
Authentication failures
Causes: Invalid token, token revoked, or wrong project accessSolutions:
- Verify API token format (should start with “grlm_”)
- Check token status in the Graphor dashboard
- Ensure token has delete permissions for the project
- Try regenerating the API token if needed
Deletion timeouts
Deletion timeouts
Causes: Large files, complex cleanup operations, or server loadSolutions:
- Increase request timeout (60+ seconds recommended)
- Retry the operation after a short delay
- Contact support for persistent timeout issues
- Consider deleting files during off-peak hours
Network connectivity
Network connectivity
Causes: DNS issues, firewall restrictions, or network timeoutsSolutions:
- Test connectivity to sources.graphorlm.com
- Check firewall allows outbound HTTPS traffic
- Verify DNS resolution is working
- Try from a different network if issues persist
Next Steps
After successfully deleting your documents:List sources
Verify the deletion and view remaining sources (with their file_ids)
Upload & ingest
Ingest new files, URLs, GitHub, or YouTube (async)
Reprocess source
Re-process remaining sources with a different partition method (async)
Get build status
Poll status for async ingestion or reprocess

