Expire a document by API request

Discover how to use the API to expire a PDF of your choosing

In this topic, you’ll learn how to delete a PDF in your environment. You will make use of your document ID and an API testing tool. We recommend you to use Insomnia, but any other tool works too. An alternative option is to use Postman, another popular choice.

At the end of this guide, you should have an already existing PDF deleted.

Prerequisites:

  • You have previously created a PDF
  • You are aware of document IDs
  • You have an API testing tool at hand and know how to use it
  • You have created an API key with the appropriate permissions (Renders.Delete)

Read more about:

Before you delete your PDF

Inkit Render performs hard-deletion of documents. This means that once you delete your PDF, you cannot recover it.
We have a zero-trust policy. This means we cannot go into your data. Ever. Bear this in mind as you use the techniques laid out in this guide. First, work with a generated sample document, then delete documents you are sure don’t need anymore.

Deleting a PDF document with the API

Make sure you have an API key token with the appropriate permissions. You need to have the Renders.delete permission.

Read more about managing API keys here. In this section of the documentation, you’ll see how to add permissions to API keys.

Then, proceed as follows:

  1. Open your API request testing tool and create a new DELETE request
  2. Get your document ID and put it into this format:

https://api.inkit.com/v1/render/yourDocumentID

Your endpoint will look something like this:

https://api.inkit.com/v1/render/rend_24OLYJXRwIfvuxP3I2osW

  1. Set this link as the targeted endpoint of your request
  2. Include your API key in the JSON headers under the variable name: X-Inkit-API-Token
  3. Send your request

You should have now successfully deleted your PDF. You can replicate this process as often as you like. However, do mind that deletion is permanent. We cannot recover your files. Therefore, be prudent.