curl --request POST \
--url https://api.orion.file.ai/prod/v1/files/preview/batch \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"s3Paths": [
"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d",
"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2e"
]
}
'import requests
url = "https://api.orion.file.ai/prod/v1/files/preview/batch"
payload = { "s3Paths": ["s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d", "s3://orion.com/649e2d2d2d2d2d2d2d2d2d2e"] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
s3Paths: [
's3://orion.com/649e2d2d2d2d2d2d2d2d2d2d',
's3://orion.com/649e2d2d2d2d2d2d2d2d2d2e'
]
})
};
fetch('https://api.orion.file.ai/prod/v1/files/preview/batch', 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.orion.file.ai/prod/v1/files/preview/batch",
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([
's3Paths' => [
's3://orion.com/649e2d2d2d2d2d2d2d2d2d2d',
's3://orion.com/649e2d2d2d2d2d2d2d2d2d2e'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.orion.file.ai/prod/v1/files/preview/batch"
payload := strings.NewReader("{\n \"s3Paths\": [\n \"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d\",\n \"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2e\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.orion.file.ai/prod/v1/files/preview/batch")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"s3Paths\": [\n \"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d\",\n \"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2e\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orion.file.ai/prod/v1/files/preview/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"s3Paths\": [\n \"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d\",\n \"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2e\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"previews": [
{
"s3Path": "s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d",
"signedUrl": "https://s3.amazonaws.com/bucket/upload/file.txt?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Signature=1%2F6%2BN7Z6h%2F7oV7Z6i%2F9oV7Z4%3D&Expires=3600"
}
]
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}Create file previews in batch
Create presigned preview URLs for several S3 paths in a single request.
Accepts up to 100 paths in s3Paths. Results are returned in
request order, each echoing its s3Path so callers can map URLs back to files.
All-or-nothing: if any path is invalid the whole request fails — no partial results.
Use POST /v1/files/preview for a single path.
curl --request POST \
--url https://api.orion.file.ai/prod/v1/files/preview/batch \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"s3Paths": [
"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d",
"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2e"
]
}
'import requests
url = "https://api.orion.file.ai/prod/v1/files/preview/batch"
payload = { "s3Paths": ["s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d", "s3://orion.com/649e2d2d2d2d2d2d2d2d2d2e"] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
s3Paths: [
's3://orion.com/649e2d2d2d2d2d2d2d2d2d2d',
's3://orion.com/649e2d2d2d2d2d2d2d2d2d2e'
]
})
};
fetch('https://api.orion.file.ai/prod/v1/files/preview/batch', 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.orion.file.ai/prod/v1/files/preview/batch",
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([
's3Paths' => [
's3://orion.com/649e2d2d2d2d2d2d2d2d2d2d',
's3://orion.com/649e2d2d2d2d2d2d2d2d2d2e'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.orion.file.ai/prod/v1/files/preview/batch"
payload := strings.NewReader("{\n \"s3Paths\": [\n \"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d\",\n \"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2e\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.orion.file.ai/prod/v1/files/preview/batch")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"s3Paths\": [\n \"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d\",\n \"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2e\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orion.file.ai/prod/v1/files/preview/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"s3Paths\": [\n \"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d\",\n \"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2e\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"previews": [
{
"s3Path": "s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d",
"signedUrl": "https://s3.amazonaws.com/bucket/upload/file.txt?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Signature=1%2F6%2BN7Z6h%2F7oV7Z6i%2F9oV7Z4%3D&Expires=3600"
}
]
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}POST /files/preview
once per file.
Request Parameters
Request Body
| Property | Type | Required | Description |
|---|---|---|---|
| s3Paths | array | Yes | S3 paths to sign. Between 1 and 100 per request. |
{
"s3Paths": [
"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d",
"s3://orion.com/649e2d2d2d2d2d2d2d2d2d2e"
]
}
Response
previews contains one entry per requested path, in request order, each
echoing its s3Path so you can map URLs back to files without relying on order
alone.
| Field | Type | Description |
|---|---|---|
| s3Path | string | The requested S3 path, echoed back |
| signedUrl | string | Short-lived presigned URL for that path |
{
"previews": [
{
"s3Path": "s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d",
"signedUrl": "https://s3.amazonaws.com/bucket/upload/file.txt?..."
}
]
}
s3Paths is invalid, the whole request
fails with a 422 and no partial results are returned. Check errors[] in the
problem response for the failing field.Idempotency
Idempotency-Key is accepted for client uniformity but ignored here: the
presigned URLs expire well inside the 24-hour replay window, so a replayed
response would hand back URLs that are already dead. Every request executes
fresh. See Idempotent requests.Authorizations
API key for authentication
Headers
Accepted for client uniformity but IGNORED on this endpoint. It has no side effects, and its presigned URLs expire in an hour — well inside the 24h replay window — so a replayed response would carry URLs that are already dead against S3. Every request executes fresh: no 24h window, no replay, no Idempotent-Replayed header, and no key-reuse 422.
Body
S3 paths to sign, at most 100 per request.
1 - 100 elements[ "s3://orion.com/649e2d2d2d2d2d2d2d2d2d2d", "s3://orion.com/649e2d2d2d2d2d2d2d2d2d2e" ]
Response
A signed URL is returned for every requested path
One entry per requested path, in request order. All-or-nothing: an invalid path fails the whole request rather than returning partial results.
Show child attributes
Show child attributes