Skip to main content
POST
/
vapor
/
signed-storage-url
Get Signed Upload URL
curl --request POST \
  --url https://api.raydocs.com/vapor/signed-storage-url \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "content_type": "application/pdf",
  "visibility": "private"
}
'
{
  "url": "<string>",
  "key": "<string>",
  "headers": {}
}

Authentication & Scope

Requires authentication. No specific ability required.

Overview

Before uploading documents to Raydocs, you need to obtain a signed URL that allows direct upload to cloud storage. This two-step process:
  1. Get signed URL - This endpoint returns a presigned S3 URL
  2. Upload file - PUT your file directly to the URL (no auth header needed)
This approach enables efficient, direct-to-storage uploads without proxying through the API server.

Request

POST /vapor/signed-storage-url HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>
Content-Type: application/json

{
  "content_type": "application/pdf",
  "visibility": "private"
}

Body Parameters

ParameterTypeRequiredDescription
content_typestringYesMIME type of the file (application/pdf, image/png, image/jpeg)
visibilitystringNoStorage visibility (default: private)

Supported File Types

TypeContent-Type
PDFapplication/pdf
PNGimage/png
JPEGimage/jpeg

Response

200 OK – Signed URL details.
{
  "url": "https://s3.amazonaws.com/bucket/tmp/abc123-def456-ghi789...",
  "key": "tmp/abc123-def456-ghi789-invoice.pdf",
  "headers": {}
}

Response Fields

FieldTypeDescription
urlstringPresigned S3 URL for file upload
keystringFile key to use in subsequent API calls
headersobjectAdditional headers to include in upload request

Upload the File

After receiving the signed URL, upload your file directly:
PUT https://s3.amazonaws.com/bucket/tmp/abc123... HTTP/1.1
Content-Type: application/pdf

<binary file data>
Do not include the Authorization header when uploading to the signed URL. The signature in the URL provides authentication.

Complete Example

import requests

# Step 1: Get signed URL
api_url = "https://api.raydocs.com"
headers = {"Authorization": "Bearer <token>"}

response = requests.post(
    f"{api_url}/vapor/signed-storage-url",
    headers=headers,
    json={
        "content_type": "application/pdf",
        "visibility": "private"
    }
)
upload_data = response.json()

# Step 2: Upload file to S3
with open("invoice.pdf", "rb") as f:
    requests.put(
        upload_data["url"],
        data=f,
        headers={"Content-Type": "application/pdf"}
    )

# Step 3: Use the key in batch create
file_key = upload_data["key"]
print(f"File uploaded with key: {file_key}")

Next Steps

After uploading files, use the file keys to create sessions:

Authorizations

Authorization
string
header
required

Personal Access Token

Body

application/json
content_type
string
required

MIME type of the file

Example:

"application/pdf"

visibility
enum<string>
default:private
Available options:
private,
public

Response

Signed URL generated

url
string<uri>

Presigned S3 URL for file upload (PUT)

key
string

File key to use in batch create

headers
object

Additional headers to include in upload request