Document, File & System

Upload File Using Base64

Changed on

Creates a temporary file using base64 source data. You may use this temporary file URL with other API methods. Temporary files are automatically permanently removed after 1 hour.

post/v1/file/upload/base64

Request

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

Request body

filestring byte required

Base64-encoded file bytes. Encode the local file contents, not its path.

namestring

File name for generated output.

permanentboolean

Store file permanently in the internal storage

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

      the request property format changed from path to a local file to byte

    • 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

      the request required property became not read-only

    • 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