Skip to navigation

Create Upload URL

View as Markdown

Creates an upload slot for a file you want to process later.

Flow:

  1. Call this endpoint. You can send content_type (for example application/pdf), but it is optional.
  2. Upload the file with the returned method, url and headers before expires_at (about an hour after you create the slot).
  3. Pass the returned upload_id in the upload_ids field of a Parse, Extract, Split or Classify request, instead of sending file. To include several uploads in one request, separate their ids with commas.

An upload_id can be used once: a second request that uses it returns 404 UPLOAD_NOT_FOUND. Using an upload_id before its file has been uploaded returns 400 UPLOAD_NOT_COMPLETED. The file type is detected from the file contents.

Authentication

api-subscription-keystring
API Key authentication via header

Request

This endpoint expects an object.
content_typestringOptional

Optional MIME type you expect to upload, for example application/pdf. When set, it is returned in headers as the Content-Type to send with the upload. The file type is detected from the file contents, not from this value.

Response

Created
upload_idstring

Handle for the uploaded file. Pass it in upload_ids on a Parse, Extract, Split or Classify request. It can be used once.

methodstring

HTTP method to use for the upload (e.g. PUT).

urlstring
Presigned URL to upload the file to.
expires_atstring
Timestamp after which the upload URL is no longer valid.
headersmap from strings to stringsOptional

Headers to send with the upload request, for example Content-Type when you set content_type. Absent when there are none.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
429
Too Many Requests Error
503
Service Unavailable Error