Run an agent over a batch
curl --request POST \
--url https://equatetravel.ai/api/v1/agents/{slug}/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"content": "Supplier: Riviera Travel ...",
"reference": "row-1"
},
{
"fileUrl": "https://example.com/inv-2.pdf",
"reference": "row-2"
}
]
}
'import requests
url = "https://equatetravel.ai/api/v1/agents/{slug}/batch"
payload = { "items": [
{
"content": "Supplier: Riviera Travel ...",
"reference": "row-1"
},
{
"fileUrl": "https://example.com/inv-2.pdf",
"reference": "row-2"
}
] }
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({
items: [
{content: 'Supplier: Riviera Travel ...', reference: 'row-1'},
{fileUrl: 'https://example.com/inv-2.pdf', reference: 'row-2'}
]
})
};
fetch('https://equatetravel.ai/api/v1/agents/{slug}/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://equatetravel.ai/api/v1/agents/{slug}/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([
'items' => [
[
'content' => 'Supplier: Riviera Travel ...',
'reference' => 'row-1'
],
[
'fileUrl' => 'https://example.com/inv-2.pdf',
'reference' => 'row-2'
]
]
]),
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://equatetravel.ai/api/v1/agents/{slug}/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"content\": \"Supplier: Riviera Travel ...\",\n \"reference\": \"row-1\"\n },\n {\n \"fileUrl\": \"https://example.com/inv-2.pdf\",\n \"reference\": \"row-2\"\n }\n ]\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://equatetravel.ai/api/v1/agents/{slug}/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"content\": \"Supplier: Riviera Travel ...\",\n \"reference\": \"row-1\"\n },\n {\n \"fileUrl\": \"https://example.com/inv-2.pdf\",\n \"reference\": \"row-2\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://equatetravel.ai/api/v1/agents/{slug}/batch")
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 \"items\": [\n {\n \"content\": \"Supplier: Riviera Travel ...\",\n \"reference\": \"row-1\"\n },\n {\n \"fileUrl\": \"https://example.com/inv-2.pdf\",\n \"reference\": \"row-2\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"agent": "<string>",
"version": 123,
"total": 123,
"succeeded": 123,
"failed": 123,
"results": [
{
"ok": true,
"runId": "<string>",
"reference": "<string>",
"result": {
"document": {
"type": "invoice",
"isInvoice": true,
"fields": {}
},
"outcome": "AUTO_MATCHED",
"actions": [
{
"actionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "EXPORT_JSON",
"status": "QUEUED"
}
],
"reference": "<string>",
"seenBefore": {
"kind": "duplicate",
"moneyChanged": true,
"changedFields": [
"commission"
],
"receivedAt": "2023-11-07T05:31:56Z",
"handledBy": "agent"
},
"data": {
"supplier": "<string>",
"reference": "<string>",
"invoiceDate": "<string>",
"invoiceCurrency": "<string>",
"totalCost": "<string>",
"vat": "<string>",
"resortTax": "<string>",
"commission": "<string>",
"onboardSpendingPerPerson": "<string>",
"drinksPackageCostPerPerson": "<string>",
"shipName": "<string>",
"tourName": "<string>",
"cruiseEmbarkation": "<string>",
"cruiseDisembarkation": "<string>",
"cruiseDuration": "<string>",
"cabinName": "<string>",
"cabinNumber": "<string>",
"cabinCategory": "<string>",
"bedType": "<string>",
"boardBasis": "<string>",
"diningRequest": "<string>",
"passengers": [
{
"title": "<string>",
"firstName": "<string>",
"middleName": "<string>",
"lastName": "<string>",
"fullName": "<string>"
}
],
"numberOfPassengers": "<string>",
"leadName": "<string>",
"flights": [
{
"flightNumber": "<string>",
"outboundAirport": "<string>",
"outboundDepartureDateTime": "<string>",
"inboundAirport": "<string>",
"inboundArrivalDateTime": "<string>"
}
],
"trains": [
{
"departureStation": "<string>",
"departureTime": "<string>",
"arrivalStation": "<string>",
"arrivalTime": "<string>",
"ticketType": "<string>"
}
],
"transfers": [
{
"transferFrom": "<string>",
"transferTo": "<string>",
"transferType": "<string>",
"vehicleType": "<string>",
"numberOfPassengers": 123
}
],
"holidayStartDate": "<string>",
"holidayEndDate": "<string>",
"holidayDuration": "<string>",
"includesCarHire": true,
"includesCarParking": true,
"resort": "<string>",
"accommodation": "<string>",
"includesTransfer": true,
"eventPackages": [
{
"hotelName": "<string>",
"roomType": "<string>",
"mealDetail": "<string>",
"arrivalDate": "<string>",
"departureDate": "<string>",
"nights": 123,
"noOfGuestsAdults": 123,
"noOfGuestsChildren": 123,
"ticketDescription": "<string>",
"durationDays": 123,
"validFor": "<string>",
"carParkingIncluded": true,
"pricing": 123,
"currency": "<string>"
}
],
"skiArea": "<string>",
"skiExtras": [
{
"item": "<string>",
"quantity": 123,
"price": 123,
"name": "<string>"
}
],
"skiCarriages": 123
},
"match": {
"matched": true,
"decision": "auto",
"confidence": 123,
"bookingReference": "<string>",
"bookingId": "<string>",
"reason": "<string>",
"fields": [
{}
]
},
"files": [
{
"role": "original",
"fileName": "invoice.pdf",
"contentType": "application/pdf",
"sizeBytes": 48213,
"url": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"contentBase64": "<string>"
}
]
},
"error": "<string>"
}
]
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
},
"runId": "<string>"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
},
"runId": "<string>"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
},
"runId": "<string>"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
},
"runId": "<string>"
}Agents
Run an agent over a batch
Process up to 100 documents in a single call.
POST
/
api
/
v1
/
agents
/
{slug}
/
batch
Run an agent over a batch
curl --request POST \
--url https://equatetravel.ai/api/v1/agents/{slug}/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"content": "Supplier: Riviera Travel ...",
"reference": "row-1"
},
{
"fileUrl": "https://example.com/inv-2.pdf",
"reference": "row-2"
}
]
}
'import requests
url = "https://equatetravel.ai/api/v1/agents/{slug}/batch"
payload = { "items": [
{
"content": "Supplier: Riviera Travel ...",
"reference": "row-1"
},
{
"fileUrl": "https://example.com/inv-2.pdf",
"reference": "row-2"
}
] }
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({
items: [
{content: 'Supplier: Riviera Travel ...', reference: 'row-1'},
{fileUrl: 'https://example.com/inv-2.pdf', reference: 'row-2'}
]
})
};
fetch('https://equatetravel.ai/api/v1/agents/{slug}/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://equatetravel.ai/api/v1/agents/{slug}/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([
'items' => [
[
'content' => 'Supplier: Riviera Travel ...',
'reference' => 'row-1'
],
[
'fileUrl' => 'https://example.com/inv-2.pdf',
'reference' => 'row-2'
]
]
]),
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://equatetravel.ai/api/v1/agents/{slug}/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"content\": \"Supplier: Riviera Travel ...\",\n \"reference\": \"row-1\"\n },\n {\n \"fileUrl\": \"https://example.com/inv-2.pdf\",\n \"reference\": \"row-2\"\n }\n ]\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://equatetravel.ai/api/v1/agents/{slug}/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"content\": \"Supplier: Riviera Travel ...\",\n \"reference\": \"row-1\"\n },\n {\n \"fileUrl\": \"https://example.com/inv-2.pdf\",\n \"reference\": \"row-2\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://equatetravel.ai/api/v1/agents/{slug}/batch")
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 \"items\": [\n {\n \"content\": \"Supplier: Riviera Travel ...\",\n \"reference\": \"row-1\"\n },\n {\n \"fileUrl\": \"https://example.com/inv-2.pdf\",\n \"reference\": \"row-2\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"agent": "<string>",
"version": 123,
"total": 123,
"succeeded": 123,
"failed": 123,
"results": [
{
"ok": true,
"runId": "<string>",
"reference": "<string>",
"result": {
"document": {
"type": "invoice",
"isInvoice": true,
"fields": {}
},
"outcome": "AUTO_MATCHED",
"actions": [
{
"actionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "EXPORT_JSON",
"status": "QUEUED"
}
],
"reference": "<string>",
"seenBefore": {
"kind": "duplicate",
"moneyChanged": true,
"changedFields": [
"commission"
],
"receivedAt": "2023-11-07T05:31:56Z",
"handledBy": "agent"
},
"data": {
"supplier": "<string>",
"reference": "<string>",
"invoiceDate": "<string>",
"invoiceCurrency": "<string>",
"totalCost": "<string>",
"vat": "<string>",
"resortTax": "<string>",
"commission": "<string>",
"onboardSpendingPerPerson": "<string>",
"drinksPackageCostPerPerson": "<string>",
"shipName": "<string>",
"tourName": "<string>",
"cruiseEmbarkation": "<string>",
"cruiseDisembarkation": "<string>",
"cruiseDuration": "<string>",
"cabinName": "<string>",
"cabinNumber": "<string>",
"cabinCategory": "<string>",
"bedType": "<string>",
"boardBasis": "<string>",
"diningRequest": "<string>",
"passengers": [
{
"title": "<string>",
"firstName": "<string>",
"middleName": "<string>",
"lastName": "<string>",
"fullName": "<string>"
}
],
"numberOfPassengers": "<string>",
"leadName": "<string>",
"flights": [
{
"flightNumber": "<string>",
"outboundAirport": "<string>",
"outboundDepartureDateTime": "<string>",
"inboundAirport": "<string>",
"inboundArrivalDateTime": "<string>"
}
],
"trains": [
{
"departureStation": "<string>",
"departureTime": "<string>",
"arrivalStation": "<string>",
"arrivalTime": "<string>",
"ticketType": "<string>"
}
],
"transfers": [
{
"transferFrom": "<string>",
"transferTo": "<string>",
"transferType": "<string>",
"vehicleType": "<string>",
"numberOfPassengers": 123
}
],
"holidayStartDate": "<string>",
"holidayEndDate": "<string>",
"holidayDuration": "<string>",
"includesCarHire": true,
"includesCarParking": true,
"resort": "<string>",
"accommodation": "<string>",
"includesTransfer": true,
"eventPackages": [
{
"hotelName": "<string>",
"roomType": "<string>",
"mealDetail": "<string>",
"arrivalDate": "<string>",
"departureDate": "<string>",
"nights": 123,
"noOfGuestsAdults": 123,
"noOfGuestsChildren": 123,
"ticketDescription": "<string>",
"durationDays": 123,
"validFor": "<string>",
"carParkingIncluded": true,
"pricing": 123,
"currency": "<string>"
}
],
"skiArea": "<string>",
"skiExtras": [
{
"item": "<string>",
"quantity": 123,
"price": 123,
"name": "<string>"
}
],
"skiCarriages": 123
},
"match": {
"matched": true,
"decision": "auto",
"confidence": 123,
"bookingReference": "<string>",
"bookingId": "<string>",
"reason": "<string>",
"fields": [
{}
]
},
"files": [
{
"role": "original",
"fileName": "invoice.pdf",
"contentType": "application/pdf",
"sizeBytes": 48213,
"url": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"contentBase64": "<string>"
}
]
},
"error": "<string>"
}
]
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
},
"runId": "<string>"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
},
"runId": "<string>"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
},
"runId": "<string>"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
},
"runId": "<string>"
}Authorizations
Path Parameters
Body
application/json
Was this page helpful?