Skip to main content
POST
/
vault
/
{id}
/
upload
Generate presigned upload URL for vault file
curl --request POST \
  --url https://api.case.dev/vault/{id}/upload \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "filename": "<string>",
  "contentType": "<string>",
  "metadata": {},
  "auto_index": true,
  "sizeBytes": 123
}
'
{
  "objectId": "cm123abc456",
  "uploadUrl": "https://vault-bucket.s3.amazonaws.com/objects/cm123abc456/contract.pdf?X-Amz-Algorithm=...",
  "expiresIn": 3600,
  "s3Key": "objects/cm123abc456/contract.pdf",
  "auto_index": true,
  "instructions": {
    "method": "PUT",
    "headers": {
      "Content-Type": "application/pdf"
    },
    "note": "Upload your file to the uploadUrl using PUT request. After upload completes, call POST /vault/:vaultId/ingest/:objectId to trigger processing."
  },
  "next_step": "POST /vault/vault_789/ingest/cm123abc456"
}

Authorizations

Authorization
string
header
required

API key starting with sk_case_

Path Parameters

id
string
required

Vault ID to upload the file to

Body

application/json
filename
string
required

Name of the file to upload

contentType
string
required

MIME type of the file (e.g., application/pdf, image/jpeg)

metadata
object

Additional metadata to associate with the file

auto_index
boolean
default:true

Whether to automatically process and index the file for search

sizeBytes
number

Estimated file size in bytes for cost calculation

Response

Upload URL generated successfully

objectId
string

Unique identifier for the uploaded object

uploadUrl
string

Presigned URL for uploading the file

expiresIn
number

URL expiration time in seconds

s3Key
string

S3 object key for the file

auto_index
boolean

Whether the file will be automatically indexed

instructions
object
next_step
string | null

Next API endpoint to call for processing