POST /v1/files
Uploads a document or audio file so it can be sent to OCR or STT by id, without hosting it anywhere public. Returns a file_id to pass as {"type": "file_id", "file_id": "..."}.
Three ways to upload
# a file from disk
curl -X POST https://relayon.app/v1/files \
-H "Authorization: Bearer ro_live_YOUR_KEY" \
-F "file=@report.pdf;type=application/pdf"
# raw bytes, no encoding overhead
curl -X POST https://relayon.app/v1/files \
-H "Authorization: Bearer ro_live_YOUR_KEY" \
-H "Content-Type: application/pdf" \
-H "X-Filename: report.pdf" \
--data-binary @report.pdf
# base64 in json
curl -X POST https://relayon.app/v1/files \
-H "Authorization: Bearer ro_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"data": "JVBERi0x...", "filename": "report.pdf", "content_type": "application/pdf"}'Response
{
"id": "file_8f96360be4d2a854b97d06e6b3c8142e",
"object": "file",
"filename": "report.pdf",
"content_type": "application/pdf",
"bytes": 74062,
"purpose": "ocr",
"created_at": "2026-09-24T09:09:31.335Z"
}Managing uploads
| Parameter | Type | Default | Description |
|---|---|---|---|
| GET /v1/files | — | — | Your most recent uploads |
| GET /v1/files/{id} | — | — | One upload, or 404 if it is not yours |
| DELETE /v1/files/{id} | — | — | Removes it from storage immediately |
Retention
An upload is deleted 24 hours after it arrives, whether or not you use it, and you can delete one sooner. A document is only ever readable by the account that uploaded it, and is never exposed on a public URL.