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"
}
'import requests
url = "https://api.raydocs.com/vapor/signed-storage-url"
payload = {
"content_type": "application/pdf",
"visibility": "private"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({content_type: 'application/pdf', visibility: 'private'})
};
fetch('https://api.raydocs.com/vapor/signed-storage-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.raydocs.com/vapor/signed-storage-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content_type' => 'application/pdf',
'visibility' => 'private'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.raydocs.com/vapor/signed-storage-url"
payload := strings.NewReader("{\n \"content_type\": \"application/pdf\",\n \"visibility\": \"private\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.raydocs.com/vapor/signed-storage-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content_type\": \"application/pdf\",\n \"visibility\": \"private\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raydocs.com/vapor/signed-storage-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content_type\": \"application/pdf\",\n \"visibility\": \"private\"\n}"
response = http.request(request)
puts response.read_body{
"url": "<string>",
"key": "<string>",
"headers": {}
}Documents
Get Upload URL
Get a presigned URL for direct file upload to cloud storage.
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"
}
'import requests
url = "https://api.raydocs.com/vapor/signed-storage-url"
payload = {
"content_type": "application/pdf",
"visibility": "private"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({content_type: 'application/pdf', visibility: 'private'})
};
fetch('https://api.raydocs.com/vapor/signed-storage-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.raydocs.com/vapor/signed-storage-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content_type' => 'application/pdf',
'visibility' => 'private'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.raydocs.com/vapor/signed-storage-url"
payload := strings.NewReader("{\n \"content_type\": \"application/pdf\",\n \"visibility\": \"private\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.raydocs.com/vapor/signed-storage-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content_type\": \"application/pdf\",\n \"visibility\": \"private\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raydocs.com/vapor/signed-storage-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content_type\": \"application/pdf\",\n \"visibility\": \"private\"\n}"
response = http.request(request)
puts response.read_body{
"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:- Get signed URL - This endpoint returns a presigned S3 URL
- 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
| Parameter | Type | Required | Description |
|---|---|---|---|
content_type | string | Yes | MIME type of the file (application/pdf, image/png, image/jpeg) |
visibility | string | No | Storage visibility (default: private) |
Supported File Types
| Type | Content-Type |
|---|---|
application/pdf | |
| PNG | image/png |
| JPEG | image/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
| Field | Type | Description |
|---|---|---|
url | string | Presigned S3 URL for file upload |
key | string | File key to use in subsequent API calls |
headers | object | Additional 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}")
const axios = require('axios');
const fs = require('fs');
async function uploadFile(filePath) {
const apiUrl = 'https://api.raydocs.com';
const token = '<token>';
// Step 1: Get signed URL
const { data: uploadData } = await axios.post(
`${apiUrl}/vapor/signed-storage-url`,
{
content_type: 'application/pdf',
visibility: 'private'
},
{
headers: { Authorization: `Bearer ${token}` }
}
);
// Step 2: Upload file to S3
const fileBuffer = fs.readFileSync(filePath);
await axios.put(uploadData.url, fileBuffer, {
headers: { 'Content-Type': 'application/pdf' }
});
// Step 3: Return the key for use in batch create
return uploadData.key;
}
# Step 1: Get signed URL
UPLOAD_DATA=$(curl -s -X POST "https://api.raydocs.com/vapor/signed-storage-url" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"content_type": "application/pdf", "visibility": "private"}')
UPLOAD_URL=$(echo $UPLOAD_DATA | jq -r '.url')
FILE_KEY=$(echo $UPLOAD_DATA | jq -r '.key')
# Step 2: Upload file to S3
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: application/pdf" \
--data-binary @invoice.pdf
echo "File key: $FILE_KEY"
Next Steps
After uploading files, use the file keys to create sessions:Batch Create Sessions
Create sessions with auto-extract from uploaded files
API Cookbook
Complete end-to-end example
Authorizations
Body
application/json
⌘I
