Docs
Uploads and temporary files
Upload private input files once, reuse their IDs in native processing requests, and delete owned files when finished.
Upload private input files once, reuse their IDs in native processing requests, and delete owned files when finished.
Upload raw bytes
POST /v1/files is authenticated. Send the exact Content-Length (1–104857600 bytes), application/octet-stream, and optional X-Filename (at most 255 characters, no path separators). This is a raw-body upload, not multipart/form-data.
curl https://api.relaypdf.com/v1/files \
-H "Authorization: Bearer $RELAYPDF_API_KEY" \
-H "Content-Type: application/octet-stream" \
-H "X-Filename: scan.pdf" \
--data-binary @scan.pdfUse the upload ID
A 201 response contains id, filename, sizeBytes, and expiresAt. Supply id as fileId to native document operations, including OCR, PDF/A, crop, resize, advanced compression, image conversion, and email. Do not assume every older endpoint accepts fileId.
{"fileId":"upload_0123456789abcdef0123456789abcdef","response":"async","options":{"language":"eng"}}Ownership and retention
Inputs are private to the uploading account and expire after 24 hours. Other accounts cannot process or delete them. Internal signed download URLs are short-lived processing capabilities, not public sharing links. Generated output URLs at GET /v1/files/:id are public to anyone holding the URL for 24 hours.
Delete a file
DELETE /v1/files/:id requires the owning account’s API key and returns 204. Missing files or files owned by another account return 404. New outputs carry ownership metadata; older outputs without that metadata cannot be deleted through this endpoint.
curl -X DELETE "https://api.relaypdf.com/v1/files/$FILE_ID" -H "Authorization: Bearer $RELAYPDF_API_KEY"SDK helpers
The current published SDKs provide upload, delete, download, native processing, and billing helpers. Node/Python/Java use client.files; PHP uses $client->files; .NET uses client.Files with UploadAsync and DeleteAsync. See /docs/sdks for release versions and language-specific examples.
const uploaded = await client.files.upload(bytes, "scan.pdf");
const result = await client.process("ocr", { fileId: uploaded.id, response: "url" });
await client.files.delete(uploaded.id);