Deleting a document using our API


As of today, we provide the following libraries:


In order to generate a PDF through the API, you’ll need to grab your API KEY first.

Head to the My account page using the top-right menu.

Toggle your API KEY by clicking on the Display value link below the API SECRET KEY field and copy your key.

You can then use this key to authenticate every call to the API:

# Method 1: Use the PDFMONKEY_PRIVATE_KEY environment variable.
# No code needed.

# Method 2: Set the private key manually (this will generally go in an initializer).
Pdfmonkey.configure do |config|
  config.private_key = '[API KEY]'
curl '' \
  -H 'Authorization: Bearer [API KEY]'

Delete a document

Here is a code snippet you can use to delete a document:

document_id = '[DOCUMENT ID]'

# Delete a Document directly

#=> true

# Delete a Document after fetching it

document = Pdfmonkey::Document.fetch(document_id)
#=> true
curl '[DOCUMENT ID]' \
  -H 'Authorization: Bearer [API KEY]'

Be careful to replace [API KEY] and [DOCUMENT ID] with the corresponding information.