---
title: PDF Delete File API Reference
version: 1.0.0
description: Delete a PDF file from the server using its unique file ID. Once deleted, the file ID cannot be used in other API calls. Returns a success indicator and confirmation message.
openapi: 3.1.1
servers:
  - https://api.apifreaks.com/v1.0
paths: 1
operations: 1
schemas: 2
---

## Table of Contents

- [PDF Delete File API Reference v1.0.0](#pdf-delete-file-api-reference-v100)
  - [Authentication](#authentication)
  - [Task Status and File Info APIs](#task-status-and-file-info-apis)
    - [deleteFile](#deletefile)
      - [Parameters](#parameters)
      - [Responses](#responses)
  - [Schemas](#schemas)
    - [DeleteFileResponse](#deletefileresponse)
    - [ErrorResponse](#errorresponse)



# PDF Delete File API Reference v1.0.0

Delete a PDF file from the server using its unique file ID. Once deleted, the file ID cannot be used in other API calls. Returns a success indicator and confirmation message.

Base URLs:

* [https://api.apifreaks.com/v1.0](https://api.apifreaks.com/v1.0)

## Authentication

* API Key (ApiKeyAuthHeader)
    - Parameter Name: **X-apiKey**, in: header. Pass your API key via the X-apiKey request header.

* API Key (ApiKeyAuthQuery)
    - Parameter Name: **apiKey**, in: query. Pass your API key via the apiKey query parameter.

## Task Status and File Info APIs

### deleteFile

`DELETE /pdf/file`

*Delete a PDF file*

This API deletes a PDF file using its unique file ID.

#### Parameters

|Name|In|Type|Required|Description|
|---|---|---|---|---|
|format|query|string|false|Specifies the desired format for the API response. Choose 'json' for a JSON object or 'xml' for an XML structure.|
|file_id|query|string|true|The unique ID of the file to be deleted.|

##### Enumerated Values

|Parameter|Value|
|---|---|
|format|json|
|format|xml|

> Example responses

> Successful operation

```json
{
  "fileId": "abc123",
  "success": true,
  "message": "File deleted successfully."
}
```

> Bad Request — Missing required file_id parameter

```json
{
  "error": "Invalid Param Exception",
  "message": "please pass correct parameters",
  "path": "/v1.0/pdf/file",
  "status": 400,
  "timestamp": "2026-07-27T10:45:56.656Z"
}
```

> File ID Not Found

```json
{
  "timestamp": "2026-07-27T10:45:55.737Z",
  "path": "/v1.0/pdf/file",
  "status": 404,
  "error": "File ID Not Found",
  "message": "Please provide a valid file ID."
}
```

#### Responses

|Status|Meaning|Description|Schema|
|---|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[DeleteFileResponse](#deletefileresponse)|
|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad Request — Missing required file_id parameter|[ErrorResponse](#errorresponse)|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|File ID Not Found|[ErrorResponse](#errorresponse)|

#### Response Headers

|Status|Header|Type|Format|Description|
|---|---|---|---|---|
|200|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|400|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|404|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|

To perform this operation, you must be authenticated by means of one of the following methods:
ApiKeyAuthHeader, ApiKeyAuthQuery

## Schemas

### DeleteFileResponse

File deletion response containing the result of the delete operation.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|fileId|string|true|none|The unique identifier of the file.|
|success|boolean|true|none|Indicates whether the file deletion request was successful.|
|message|string|true|none|A message indicating the result of the file deletion request.|

### ErrorResponse

Standard error envelope returned by the API on failed requests.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|error|string|false|none|Short error category or exception type.|
|message|string|true|none|Human-readable error message describing the failure.|
|path|string|false|none|API endpoint path that produced the error.|
|status|integer|false|none|HTTP status code returned with the error.|
|timestamp|string(date-time)|false|none|Timestamp when the error occurred (ISO 8601).|
