---
updatedAt: 2026-11-10T17:51:33.000Z
agentTools:
  projectIndex: https://docs.flexfactor.io/llms.txt
---

# Delete a document

> ❗️ This endpoint is not available
>
> `DELETE /v1/onboarding/application/{id}/documents/{documentID}` is not available on the FlexFactor API. This page is hidden and kept for reference only.

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.

***

<br />

* [Request](#request)
* [Response](#response)
* [Payload examples](#payload-examples)

<br />

***

<br />

# Request

## Details

| environment                | HTTP method | endpoint                                                                                  |
| :------------------------- | :---------- | :---------------------------------------------------------------------------------------- |
| **Sandbox testing**        | DELETE      | <https://api-sandbox.flexfactor.io/v1/onboarding/application/{id}/documents/{documentID}> |
| **Production environment** | DELETE      | <https://api.flexfactor.io/v1/onboarding/application/{id}/documents/{documentID}>         |

<br />

## 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.                      |

<br />

<br />

## Body

This API does not require body parameters.

<br />

***

<br />

# 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.                               |

<br />

<br />

> ❗️ Notes
>
> * Deleted documents cannot be recovered. Use this endpoint with caution.
> * Ensure secure handling of document deletions, especially for sensitive or regulated data.

<br />

<br />

***

<br />

# Payload Examples

## Request

#### cURL Request Example

```bash
curl --request DELETE \
     --url https://api-sandbox.flexfactor.io/v1/onboarding/application/{application_id}/documents/{document_id} \
     --header 'Authorization: Bearer {the token returned by /oauth2}' \
     --header 'accept: application/json'
```

***

<br />

## Response

#### JSON Example for a Successful Deletion

```json
{
   "status": "SUCCESS",
   "success": true,
   "result": "Document deleted successfully.",
   "errors": []
}
```

#### JSON Example for a Failed Deletion

```json
{
   "status": "FAILED",
   "success": false,
   "result": null,
   "errors": [
       "Document not found.",
       "Document deletion not allowed for submitted applications."
   ]
}
```

***

<br />

## 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
HTTP/1.1 404 Not Found
Content-Type: application/json

{
  "errors": [
    "Document not found."
  ]
}
```

```http
HTTP/1.1 401 Unauthorized
Content-Type: application/json

{
  "errors": [
    "Authentication failed. Invalid bearer token."
  ]
}
```