Skip to main content

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

ParameterTypeRequiredDescription
submissionIdstringYesThe unique identifier of the submission containing the documents

Query Parameters

ParameterTypeRequiredDescription
idsarray of stringsYesList 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

FieldDescription
resultA 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 CodeDescriptionSolution
400Invalid document IDsCheck that the document IDs are correctly formatted
400No document IDs providedEnsure at least one document ID is specified in the request
401UnauthorizedVerify your authentication token
403ForbiddenCheck that your account has permission to delete documents
404Submission not foundVerify that the submission ID exists
404One or more documents not foundVerify that all document IDs exist
500Internal server errorContact support with the error details

Important Notes

  1. This operation is irreversible - once documents are deleted, they cannot be recovered.
  2. The API will attempt to delete all documents specified in the request, even if some fail.
  3. The response indicates the total number of documents that were successfully deleted.
  4. Document deletions are typically logged for audit purposes.