Batch Export
curl --request POST \
--url https://api.raydocs.com/extractions/templates/{templateId}/sessions/batch/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"format": "json"
}
'import requests
url = "https://api.raydocs.com/extractions/templates/{templateId}/sessions/batch/export"
payload = {
"session_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"format": "json"
}
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({session_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'], format: 'json'})
};
fetch('https://api.raydocs.com/extractions/templates/{templateId}/sessions/batch/export', 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/extractions/templates/{templateId}/sessions/batch/export",
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([
'session_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'format' => 'json'
]),
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/extractions/templates/{templateId}/sessions/batch/export"
payload := strings.NewReader("{\n \"session_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"format\": \"json\"\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/extractions/templates/{templateId}/sessions/batch/export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"format\": \"json\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raydocs.com/extractions/templates/{templateId}/sessions/batch/export")
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 \"session_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"format\": \"json\"\n}"
response = http.request(request)
puts response.read_bodyBatch Operations
Batch Export Results
Export results from multiple sessions in a single file.
POST
/
extractions
/
templates
/
{templateId}
/
sessions
/
batch
/
export
Batch Export
curl --request POST \
--url https://api.raydocs.com/extractions/templates/{templateId}/sessions/batch/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"format": "json"
}
'import requests
url = "https://api.raydocs.com/extractions/templates/{templateId}/sessions/batch/export"
payload = {
"session_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"format": "json"
}
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({session_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'], format: 'json'})
};
fetch('https://api.raydocs.com/extractions/templates/{templateId}/sessions/batch/export', 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/extractions/templates/{templateId}/sessions/batch/export",
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([
'session_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'format' => 'json'
]),
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/extractions/templates/{templateId}/sessions/batch/export"
payload := strings.NewReader("{\n \"session_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"format\": \"json\"\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/extractions/templates/{templateId}/sessions/batch/export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"format\": \"json\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raydocs.com/extractions/templates/{templateId}/sessions/batch/export")
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 \"session_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"format\": \"json\"\n}"
response = http.request(request)
puts response.read_bodyAuthentication & Scope
Requires thesessions-read ability.
Request
POST /extractions/templates/550e8400-e29b-41d4-a716-446655440000/sessions/batch/export/excel HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>
Content-Type: application/json
{
"session_ids": [
"770e8400-e29b-41d4-a716-446655440001",
"770e8400-e29b-41d4-a716-446655440002",
"770e8400-e29b-41d4-a716-446655440003"
]
}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
templateId | uuid | Yes | The template ID |
format | string | Yes | Export format: json or excel |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
session_ids | array | Yes | Array of session IDs to export |
Response
JSON Format
200 OK – JSON array of results.
[
{
"session_id": "770e8400-e29b-41d4-a716-446655440001",
"session_name": "Invoice Batch 1",
"data": {
"invoice_details": {
"invoice_number": "INV-001",
"total_amount": 1500.00
}
}
}
]
Excel Format
200 OK – Excel file download with Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.
Excel exports include audit data with reasoning and source references in additional sheets.
Authorizations
Path Parameters
Body
application/json
Response
Export data
⌘I
