Skip to main content
POST
/
datasources
/
{source_id}
/
documents
Upload a new file into a extraction source
curl --request POST \
  --url https://api.cloudsquid.io/api/datasources/{source_id}/documents \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "mimetype": "application/pdf",
  "filename": "<string>",
  "file_type": "uri",
  "zero_retention_mode": true,
  "file": "<string>"
}'
{
  "file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Authorizations

X-API-Key
string
header
required

Path Parameters

source_id
string<uuid>
required

The ID of the datasource

Body

application/json
mimetype
enum<string>
required

the mimetype of the document being uploaded

Available options:
application/pdf,
image/jpg,
image/jpeg,
image/png,
application/pdf,
application/json,
image/jpg,
image/jpeg,
image/png,
text/csv,
text/plain,
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
video/mp4,
audio/mp3,
audio/wav,
audio/ogg,
multipart/related,
message/rfc822
filename
string
required

the name of the file being uploaded

file_type
enum<string>
required

Indicates whether the file is a binary upload or a signed link to the document.

Available options:
uri,
binary,
multipart
file
required

A signed URL to the file.

zero_retention_mode
boolean

indicates if the file was uploaded in zero-retention mode

Response

Uploaded file successfully

file_id
string<uuid>
required

the created cloudsquid file-id for the uploaded document

I