> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rolla.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Document

> Deletes an uploaded document by type. Use `relatedPersonId` to target a related person's document.

Deletes an uploaded document by type. Include `relatedPersonId` to target a document attached to a specific related person.

## Example Request

```bash theme={null}
curl -X DELETE "https://api.rolla.xyz/api/v1/external/accounts/eec3cbed-79d8-4370-87a0-b6be9e287337/documents" \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "documentType": "bank_statement"
  }'
```

## Example Response

```json theme={null}
{
  "success": true,
  "message": "Document deleted successfully",
  "data": {
    "success": true
  }
}
```

<Warning>
  Deleting a document from an application that was already completed moves it back to `draft`, and it must be re-submitted.
</Warning>


## OpenAPI

````yaml DELETE /accounts/{accountId}/documents
openapi: 3.1.0
info:
  title: Rolla Developer API
  description: >-
    API for programmatic transaction management on the Rolla platform. Monetary
    `amount` fields use the smallest unit of the referenced currency unless an
    endpoint says otherwise (e.g. NGN = kobo, USD = cents, where **100 cents =
    USD 1.00**).
  version: 1.0.0
servers:
  - url: https://api.rolla.xyz/api/v1/external
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /accounts/{accountId}/documents:
    delete:
      summary: Delete Document
      description: >-
        Deletes an uploaded document by type. Use `relatedPersonId` to target a
        related person's document.
      operationId: deleteAccountDocument
      parameters:
        - name: accountId
          in: path
          required: true
          description: >-
            Identifier of an account owned by the same user as your API key's
            business
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - documentType
              properties:
                documentType:
                  type: string
                  enum:
                    - certificate_of_incorporation
                    - articles_of_association
                    - proof_of_address
                    - director_register
                    - shareholder_register
                    - proof_of_tax_id
                    - bank_statement
                    - wolfsberg_questionnaire
                    - msb_flow_form
                    - flow_of_funds_diagram
                    - aml_policy_procedures
                    - ach_procedures
                    - wire_procedures
                    - customer_complaint_procedures
                    - prohibited_jurisdictions_industries
                relatedPersonId:
                  type: string
                  format: uuid
      responses:
        '200':
          description: Document deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Document deleted successfully
                  data:
                    type: object
                    properties:
                      success:
                        type: boolean
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Account or document not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your Rolla API key

````