Document, File & System

Upload Small File

Changed on

Uploads a small (up to 100KB) local file as a temporary file in PDF.co storage. Note: temporary files are automatically permanently removed after 1 hour.

post/v1/file/upload

Request

  • Base URL
    https://api.pdf.co
  • URL
    https://api.pdf.co/v1/file/upload
  • Auth
    API key in header x-api-key

Request body multipart/form-data

filestring binary required

Local file bytes to upload. Select a file up to 100 KB; do not enter a local file path as text.

namestring

File name for generated output.

Response

File uploaded successfully. Temporary URL values in examples are illustrative.

urlstring uri

URL to use as input to conversion endpoints after the upload succeeds.

errorboolean

False when the request succeeds.

statusinteger

API status code, such as 200 for success.

namestring

Uploaded filename.

outputLinkValidTillstring date-time

Expiration timestamp for the temporary file URL.

creditsinteger

Credits used by this request.

remainingCreditsinteger

Credits remaining in the account.

durationinteger

Request duration in milliseconds.

Changes

    • breaking

      request body became required

    • breaking

      removed the media type application/json from the request body

    • breaking

      the response's property type changed from string to integer for status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added the media type multipart/form-data to the request body

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status