Delete documents
Request description
Endpoint: /v1/delete-document
Method: DELETE
Remember: you can see the URL to consume this API in the Introduction section.
Header
{
"Content-Type": "application/json",
"Authorization": "Bearer <accessToken>"
}
Authorization: We'll pass the token obtained during the authentication process. You can reuse the generated tokens, as they have a 2-hour lifespan. Review this page: Credentials
To set the API version on a specific request, you can add a specific header named X-Invox-Medical-Api-Version with the value of the version you are targeting:
X-Invox-Medical-Api-Version: 2026-10-01
Payload example
{
"documentId": "mock-document-id"
}
documentId is provided in the response when generating the signed URL for document upload. Make sure to use the correct documentId corresponding to the document you wish to delete.Payload structure
interface DeleteDocumentRequest {
documentId: string;
}
Responses
Correct response
Successful request
Describe the characteristics of a satisfactory response
200
Response structure:
{
"message": "Document deleted successfully",
"documentId": "mock-document-id"
}
Response structure
type DeleteDocumentResponseType = {
message: string;
documentId: string;
};
Wrong responses
Unauthorized request
Describes the response when the request is not authorized
401
Response body
{
message: string;
}
Forbidden request
Describes the response when the API Key is not allowed to consume this service
403
Response body
{
message: string; // "The credential does not have permission to perform this operation"
errorType: string; // "invalidPermission"
}
GENERATE-REPORTGranting or removing a permission can take up to 2 hours to take effect, because access tokens already issued keep the permissions they had when they were created.Bad request
Describe the characteristics of a bad request
400
Response body
type DeleteDocumentResponseType = {
message: string
errorType: DELETE_DOCUMENT_ERROR_TYPE
}
enum DELETE_DOCUMENT_ERROR_TYPE {
INCONSISTENT_INPUT= 'inconsistentInput'
INVALID_REQUEST_BODY = 'invalidRequestBody'
INVALID_API_VERSION_FOR_ENDPOINT ='invalidApiVersionForEndpoint'
}
Not found
The document does not exist, or it was not created with the same API Key (or, for Suite sessions, by the same user). Both cases return the same response. Documents created with an API Key that has since been rotated can no longer be deleted.
404
Response body
type DeleteDocumentResponseType = {
message: string
errorType: DELETE_DOCUMENT_ERROR_TYPE
}
enum DELETE_DOCUMENT_ERROR_TYPE {
DOCUMENT_NOT_FOUND: 'documentNotFound'
}
Internal server error
Describe the characteristics of an internal server error
500
Response body
{
message: string;
}