Skip to main content
POST
/
extractions
/
sessions
/
{sessionId}
/
documents
Upload Document
curl --request POST \
  --url https://api.raydocs.com/extractions/sessions/{sessionId}/documents \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "filename": "<string>",
  "mime_type": "<string>",
  "size": 123,
  "status": "pending",
  "extraction_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z"
}

Authentication & Scope

Requires the sessions-write ability.

Request

POST /extractions/sessions/770e8400-e29b-41d4-a716-446655440000/documents HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>
Content-Type: multipart/form-data

--boundary
Content-Disposition: form-data; name="file"; filename="invoice.pdf"
Content-Type: application/pdf

<binary file data>
--boundary--

Path Parameters

ParameterTypeRequiredDescription
sessionIduuidYesThe session ID

Body Parameters

ParameterTypeRequiredDescription
filebinaryYesThe document file

Supported Formats

  • PDF (.pdf)
  • Microsoft Word (.docx, .doc)
  • Images (.png, .jpg, .jpeg, .tiff)
  • PowerPoint (.pptx)

Response

201 Created – Document uploaded and queued for processing.
{
  "id": "880e8400-e29b-41d4-a716-446655440000",
  "filename": "invoice.pdf",
  "status": "uploaded",
  "extraction_session_id": "770e8400-e29b-41d4-a716-446655440000",
  "meta": {},
  "created_at": "2024-01-15T10:30:00Z"
}
Document processing starts automatically after upload. The status will change from uploaded to processing and finally to ready when complete.
422 Unprocessable Entity – Invalid file format or file too large.

Authorizations

Authorization
string
header
required

Personal Access Token

Path Parameters

sessionId
string<uuid>
required

Body

multipart/form-data
file
file
required

PDF, PNG, JPG, or other supported file

Response

Uploaded

id
string<uuid>
filename
string
mime_type
string
size
integer

File size in bytes

status
enum<string>
Available options:
pending,
parsing,
parsed,
failed
extraction_session_id
string<uuid>
created_at
string<date-time>