Delete a document
This endpoint allows you to delete a specific document attached to an application, identified by its unique application ID ({id}) and document ID ({documentID}). Once deleted, the document will no longer be associated with the application.
Request
Details
| environment | HTTP method | endpoint |
|---|---|---|
| Sandbox testing | DELETE | https://api-sandbox.flex-charge.com/v1/onboarding/application/{id}/documents/{documentID} |
| Production environment | DELETE | https://api.flex-charge.com/v1/onboarding/application/{id}/documents/{documentID} |
Required keys
| Parameter | Description |
|---|---|
{id} | The unique application identifier returned during application creation or listing endpoints. |
{documentID} | The unique identifier of the document, returned during document upload. |
Body
This API does not require body parameters.
Response
Field Definitions
| Field Name | Type | Description |
|---|---|---|
| HTTP Status Code | Integer | Returns 200 for successful deletion. |
status | String | Status of the API request (SUCCESS, FAILED). |
success | Boolean | Indicates if the document deletion was successful. |
result | String | A confirmation message for the deletion (e.g., "Document deleted successfully."). |
errors | Array of Strings | Any errors encountered during the deletion process. |
Notes
- Deleted documents cannot be recovered. Use this endpoint with caution.
- Ensure secure handling of document deletions, especially for sensitive or regulated data.
Payload Examples
Request
cURL Request Example
curl --request DELETE \
--url https://api-sandbox.flexfactor.com/v1/onboarding/application/{application_id}/documents/{document_id} \
--header 'Authorization: bearer {the token returned by /oauth2}' \
--header 'accept: application/json'Response
JSON Example for a Successful Deletion
{
"status": "SUCCESS",
"success": true,
"result": "Document deleted successfully.",
"errors": []
}JSON Example for a Failed Deletion
{
"status": "FAILED",
"success": false,
"result": null,
"errors": [
"Document not found.",
"Document deletion not allowed for submitted applications."
]
}Example for Handling Errors
- If the document ID or application ID is invalid, the API will return an error.
- If the bearer token is unauthorized, the API will respond with an Unauthorized error.
HTTP/1.1 404 Not Found
Content-Type: application/json
{
"errors": [
"Document not found."
]
}HTTP/1.1 401 Unauthorized
Content-Type: application/json
{
"errors": [
"Authentication failed. Invalid bearer token."
]
}Updated 5 months ago
