This endpoint deleted a stored processed file from PDF.js Express servers.
If this endpoint is not called, the file will be deleted in 24 hrs.
Calling this endpoint does not count as an action.
Endpoint
POST https://api.pdfjs.express/delete
Body params
The request body must be formatted as multipart/form-data
Name | Type | Description |
---|---|---|
id | string | The id of the file, retrieved from the response of other endpoints. |
license | string | Your PDF.js Express API license key. You must pass the correct license key depending if you are making the request from the server or the client. If no license key is provided, the output will be watermarked and usage will be heavily limited. |
Response body (success)
A success response will come back in json
format and will contain the following:
Property | Type | Description |
---|---|---|
id | string | The ID of the deleted file |
message | string | A message from the server |
Response body (error)
See the list of error responses for details.
Example
The following example creates a function that can be used to delete a file.
const deleteFile = async (id) => {
const data = new FormData();
data.append('id', id);
data.append('license', my_license_key);
// Process the file
const response = await fetch('https://api.pdfjs.express/delete', {
method: 'post',
body: data
}).then(resp => resp.json());
// do something after...
}