Docs / Storage

Platform

Storage

By default DevilPDF stores each generated file and gives you a signed download link. You can also have files delivered straight to your own bucket, or keep nothing at all.

A render with "output": "url" (the default) or "base64" stores the file and returns a link like this:

https://devilpdf.com/f/doc_nWWGc4ehhC44vpOsHFGn/invoice.pdf?exp=1773532800&sig=8fe4b5c6...
  • The link is signed and unguessable, but it needs no API key. Anyone you give it to can download the file until it expires.
  • Files open in the browser. Add &download=1 to force a download.
  • Fetch the document again with GET /v1/documents/:id to get a fresh link at any time before it expires.

#Retention

PlanFiles kept for
Free24 hours
Starter7 days
Growth30 days
Business30 days
Scale30 days

Shorten this for one document with expires_in (seconds, minimum 60). You cannot go above your plan's maximum.

{ "template": "invoice", "data": {}, "expires_in": 3600 }

When a file expires, its link stops working and the file is deleted. To remove a file sooner, call DELETE /v1/documents/:id.

#Store nothing

With "output": "file", the response body is the file and DevilPDF keeps no copy. The document is logged with its size and page count, but there is no link and nothing to expire.

Use this for sensitive documents you would rather not leave with a third party, even briefly.

#Your own bucket

On paid plans, DevilPDF can upload each file to a bucket you own. It works with Amazon S3 and anything that speaks the S3 API: Cloudflare R2, Backblaze B2, Wasabi, MinIO, DigitalOcean Spaces.

#1. Connect the bucket

In the dashboard, open Settings → Storage and enter:

SettingDescription
BucketThe bucket name.
RegionFor example us-east-1. Use auto for Cloudflare R2.
Access key ID and secret access keyCredentials that are allowed to PutObject in that bucket. Nothing else is needed.
EndpointLeave empty for Amazon S3. For other providers, their S3 endpoint, for example https://<account-id>.r2.cloudflarestorage.com.
PrefixOptional folder to put files under, for example documents/2026.

Create an access key that can only write to this one bucket. The credentials are encrypted before they are stored.

A minimal IAM policy for Amazon S3:

{
  "Version": "2012-10-17",
  "Statement": [
    { "Effect": "Allow", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::your-bucket/*" }
  ]
}

#2. Ask for S3 delivery

Add "destination": "s3" to a render.

curl https://devilpdf.com/v1/render \
  -H "Authorization: Bearer $DEVILPDF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "template": "invoice", "data": { "number": "INV-1001" }, "filename": "INV-1001", "destination": "s3" }'

The file is uploaded to:

<prefix>/<document id>/<filename>.pdf

The document id in the path keeps every key unique, so one file never overwrites another.

In the response, url is the object's address in your bucket and expires_at is null. DevilPDF keeps no copy, so retention is entirely up to you. The URL is only publicly readable if your bucket is; for a private bucket, sign a URL yourself when you need to share the file.

Delivery works with async renders and batches too. If the upload fails (wrong credentials, missing bucket), the render fails with a render_error that includes your storage provider's status and error code, and it is not counted.

#EU storage

On paid plans you can choose to keep hosted files in the European Union. Switch it on under Settings → Storage. From then on, files DevilPDF stores for your account are written to storage that is restricted to EU data centres.

What this covers, precisely:

  • Covered: the generated files behind hosted download links.
  • Not covered: rendering itself, which runs wherever capacity is nearest; your account's records (templates, the document log, usage); and the request data of a queued async render, which is held briefly until the job runs.
  • Files stored before you switched stay where they were until they expire.

If you need the files in a specific country, or need full control, deliver to your own bucket in the region of your choice and use "output": "file" or "destination": "s3" so DevilPDF stores nothing.