Delete documents


Request description

Endpoint: /v1/delete-document
Method: DELETE

Available since API version: 2026-03-01

Remember: you can see the URL to consume this API in the Introduction section.

{
  "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-03-01

Payload example

{
  "documentId": "mock-document-id"
}
Important: The 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;
}


Bad request

Describe the characteristics of a bad request

400

Response body

type DeleteDocumentResponseType = {
    messsage: string
    errorType: GENERATE_PRESIGNURL_ERROR_TYPE
}

enum DELETE_DOCUMENT_ERROR_TYPE {
    INCONSISTENT_INPUT= 'inconsistentInput'
    INVALID_REQUEST_BODY = 'invalidRequestBody'
    INVALID_API_VERSION_FOR_ENDPOINT ='invalidApiVersionForEndpoint'
}


Not found

Describe the characteristics of a not found request

404

Response body

type DeleteDocumentResponseType = {
    messsage: 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;
}