Delete Documents
The Delete Documents API allows you to remove multiple documents from a specific submission. This endpoint is useful for cleanup operations or removing obsolete documents.
API Endpoint
DELETE {base_url}/ExtForm/submissions/{submissionId}/documents?ids={documentId1}&ids={documentId2}
Request Format
This endpoint accepts a DELETE request with document IDs provided as query parameters.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
submissionId | string | Yes | The unique identifier of the submission containing the documents |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | array of strings | Yes | List of unique identifiers of documents to delete |
Request URL Example
{base_url}/ExtForm/submissions/7ac9ab5e-4123-4456-b8c3-123456789012/documents?ids=id1&ids=id2&ids=id3
Request Headers
Authorization: Bearer {token}
Response Format
{
"statusCode": 200,
"messages": ["Processed successfully"],
"result": "Deleted 3 documents"
}
Response Fields
| Field | Description |
|---|---|
result | A message indicating the number of documents successfully deleted |
Example Usage
cURL Example
curl -X DELETE \
'{base_url}/ExtForm/submissions/7ac9ab5e-4123-4456-b8c3-123456789012/documents?ids=a1b2c3d4-5e6f-7g8h-9i0j-k1l2m3n4o5p6&ids=b2c3d4e5-6f7g-8h9i-0j1k-l2m3n4o5p6q7' \
-H 'Authorization: Bearer your_token_here'
Error Handling
| Status Code | Description | Solution |
|---|---|---|
| 400 | Invalid document IDs | Check that the document IDs are correctly formatted |
| 400 | No document IDs provided | Ensure at least one document ID is specified in the request |
| 401 | Unauthorized | Verify your authentication token |
| 403 | Forbidden | Check that your account has permission to delete documents |
| 404 | Submission not found | Verify that the submission ID exists |
| 404 | One or more documents not found | Verify that all document IDs exist |
| 500 | Internal server error | Contact support with the error details |
Important Notes
- This operation is irreversible - once documents are deleted, they cannot be recovered.
- The API will attempt to delete all documents specified in the request, even if some fail.
- The response indicates the total number of documents that were successfully deleted.
- Document deletions are typically logged for audit purposes.
Related Resources
- Upload Documents API - Uploading documents to a submission
- Download Document API - Downloading a specific document
- Document Types Reference - List of document types and their descriptions