Run Extraction
curl --request POST \
--url https://api.raydocs.com/extractions/sessions/{sessionId}/results \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.raydocs.com/extractions/sessions/{sessionId}/results"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.raydocs.com/extractions/sessions/{sessionId}/results', 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/sessions/{sessionId}/results",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.raydocs.com/extractions/sessions/{sessionId}/results"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/sessions/{sessionId}/results")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raydocs.com/extractions/sessions/{sessionId}/results")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"extraction_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "created",
"config_hash": "<string>",
"document_refs": [
{
"kind": "documentRef",
"documentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": 123,
"filename": "<string>",
"mime": "<string>",
"size": 123,
"sha256": "<string>",
"source": {
"type": "upload",
"url": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z"
}
],
"data": {},
"audit_data": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Results
Run Extraction
Create one extraction run for the current session document set.
POST
/
extractions
/
sessions
/
{sessionId}
/
results
Run Extraction
curl --request POST \
--url https://api.raydocs.com/extractions/sessions/{sessionId}/results \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.raydocs.com/extractions/sessions/{sessionId}/results"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.raydocs.com/extractions/sessions/{sessionId}/results', 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/sessions/{sessionId}/results",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.raydocs.com/extractions/sessions/{sessionId}/results"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/sessions/{sessionId}/results")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raydocs.com/extractions/sessions/{sessionId}/results")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"extraction_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "created",
"config_hash": "<string>",
"document_refs": [
{
"kind": "documentRef",
"documentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": 123,
"filename": "<string>",
"mime": "<string>",
"size": 123,
"sha256": "<string>",
"source": {
"type": "upload",
"url": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z"
}
],
"data": {},
"audit_data": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Authentication & Scope
Requires thesessions-write ability.
Request
POST /extractions/sessions/770e8400-e29b-41d4-a716-446655440000/results HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | uuid | Yes | The session ID |
Response
201 Created - Extraction run started.
{
"id": "990e8400-e29b-41d4-a716-446655440000",
"extraction_session_id": "770e8400-e29b-41d4-a716-446655440000",
"status": "created",
"config_hash": "9eeae65063f17f552f4f95fe8c23d0aa8b697f91df5e8dd4a7214be4d6a7aa62",
"document_refs": [
{
"kind": "documentRef",
"documentId": "880e8400-e29b-41d4-a716-446655440000",
"workspaceId": "660e8400-e29b-41d4-a716-446655440000",
"sha256": "6de7f6f5894c9f3fd1f6f8a4d1b3115d0d9b4b19d7a8a661f9fe90f9c2d80c3b",
"filename": "invoice.pdf"
}
],
"title": null,
"created_at": "2024-01-15T10:30:00Z",
"completed_at": null
}
201 Created - Extraction run created in deferred mode while parsing completes.
{
"id": "990e8400-e29b-41d4-a716-446655440001",
"extraction_session_id": "770e8400-e29b-41d4-a716-446655440000",
"status": "parsing_pending",
"config_hash": "9eeae65063f17f552f4f95fe8c23d0aa8b697f91df5e8dd4a7214be4d6a7aa62",
"audit_data": {
"_pending_manual_run": {
"pending_document_ids": [
"880e8400-e29b-41d4-a716-446655440000"
]
}
},
"created_at": "2024-01-15T10:30:00Z",
"completed_at": null
}
Each
ExtractionSessionResult represents one run snapshot for the documents attached to the session at trigger time. The output is aggregated across those documents. Poll the Get Result endpoint to check status and retrieve data when complete.422 Unprocessable Entity – No documents in session or documents not ready.Authorizations
Path Parameters
Response
Extraction run created
Available options:
created, parsing_pending, processing, completed, failed Show child attributes
Show child attributes
Extracted data matching the template schema
Verification/reasoning traces and run audit payload
