PUT {presigned url}

Important The presigned URL must be retreived from the /file/upload/get-presigned-url for the PUT operation to succeed.

Content-Type header When sending PUT request don’t forget to add Content-Type header with proper value based on input file type.

For example:

File ExtensionContent-Type Value
.txt .csv .xml .jsontext/plain
.pdfapplication/pdf
.msg .emlapplication/vnd.ms-outlook
.docapplication/msword

If you’re not sure then use application/octet-stream header. It works for most file types.

All uploaded files are treated as temporary files and are automatically permanently removed after 1 hour. If you have a file that you want to reuse over and over, please upload it to PDF.co Built-In Files Storage and get its filetoken:// link that you may reuse inside PDF.co API.

Example Response

To see the main response codes, please refer to the Response Codes page.
{
  "presignedUrl": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/0c72bf56341142ba83c8f98b47f14d62/test.pdf?X-Amz-Expires=900&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIZJDPLX6D7EHVCKA/20200302/us-west-2/s3/aws4_request&X-Amz-Date=20200302T143951Z&X-Amz-SignedHeaders=host&X-Amz-Signature=8650913644b6425ba8d52b78634698e5fc8970157d971a96f0279a64f4ba87fc",
  "url": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/0c72bf56341142ba83c8f98b47f14d62/test.pdf?X-Amz-Expires=3600&x-amz-security-token=FwoGZXIvYXdzEGgaDA9KaTOXRjkCdCqSTCKBAW9tReCLk1fVTZBH9exl9VIbP8Gfp1pE9hg6et94IBpNamOaBJ6%2B9Vsa5zxfiddlgA%2BxQ4tpd9gprFAxMzjN7UtjU%2B2gf%2FKbUKc2lfV18D2wXKd1FEhC6kkGJVL5UaoFONG%2Fw2jXfLxe3nCfquMEDo12XzcqIQtNFWXjKPWBkQEvmii4tfTyBTIot4Na%2BAUqkLshH0R7HVKlEBV8btqa0ctBjwzwpWkoU%2BF%2BCtnm8Lm4Eg%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA4NRRSZPHEGHTOA4W/20200302/us-west-2/s3/aws4_request&X-Amz-Date=20200302T143951Z&X-Amz-SignedHeaders=host;x-amz-security-token&X-Amz-Signature=243419ac4a9a315eebc2db72df0817de6a261a684482bbc897f0e7bb5d202bb9",
  "error": false,
  "status": 200,
  "name": "test.pdf",
  "remainingCredits": 98145
}

Code Samples

curl --location --request PUT '<insert presignedUrl here>'
--header 'x-api-key: YOUR_API_KEY'
--header 'Content-Type: application/octet-stream'
--data-binary '@./sample.pdf'