Skip to main content
POST
/
v1
/
files
Create a file upload session
curl --request POST \
  --url https://api.sandbox.trycollate.ai/v1/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fileName": "clinical-note.pdf",
  "contentType": "application/pdf",
  "purpose": "authorization_attachment"
}
'
{
  "file": {
    "id": "file_123",
    "status": "pending_upload",
    "fileName": "clinical-note.pdf",
    "contentType": "application/pdf",
    "sizeBytes": null,
    "purpose": "authorization_attachment",
    "downloadUrl": null,
    "createdAt": "2026-03-13T17:00:00.000Z",
    "completedAt": null
  },
  "upload": {
    "method": "PUT",
    "url": "https://api.example.com/v1/files/file_123/content",
    "headers": {
      "Content-Type": "application/pdf"
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer token for WorkOS session JWTs and organization API keys.

Body

application/json
fileName
string
required
Minimum string length: 1
contentType
string
required
Minimum string length: 1
purpose
enum<string>
required
Available options:
authorization_attachment,
sandbox_payer_document
sizeBytes
integer

Response

Created file upload session.

file
object
required
upload
object
required