Skip to main content
Returns a short-lived presigned S3 URL that allows you to upload a file directly to object storage without routing the file data through the Quark server. After the upload completes, call Ingest document to process the file.
The presigned URL expires after 1 hour (3600 seconds). Upload the file before it expires.

Constraints

ConstraintValue
Maximum file size50 MB
Allowed content typesapplication/pdf, image/jpeg, image/jpg
URL expiry3600 seconds (1 hour)

Request body

filename
string
required
The name of the file to upload (e.g. report.pdf). Used to derive the storage key.
contentType
string
required
MIME type of the file. Must be one of: application/pdf, image/jpeg, image/jpg.
contentSize
number
required
Size of the file in bytes. Must not exceed 52,428,800 (50 MB).

Response

200 OK

uploadData
object
Presigned upload details. Use the fields in this object to PUT the file directly to object storage.

400 Bad Request

Returned when the file fails size or type validation.
error
string
A human-readable description of the validation failure — either "Maximum file size limit exceed" (SizeError) or "Invalid File Type | Valid Type Are: ..." (TypeError).

500 Internal Server Error

error
string
Always "Internal Server Error".
code
string
Machine-readable error code for debugging.

Example

curl -X POST http://localhost:3000/api/v1/ingest/upload/url \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "report.pdf",
    "contentType": "application/pdf",
    "contentSize": 204800
  }'
Response
{
  "uploadData": {
    "signedUrl": "https://your-bucket.s3.amazonaws.com/uploads/2026/report.pdf?X-Amz-Signature=...",
    "key": "uploads/2026/report.pdf"
  }
}
After receiving the presigned URL, upload the file with a PUT request to uploadData.signedUrl, then pass uploadData.key as the key field to POST /api/v1/ingest/process.

Build docs developers (and LLMs) love