$API_TOKEN=<YOUR_API_TOKEN>
$cat > input.json << 'EOF'
<{
< "mode": "inline",
< "documents": [
< {
< "id": "invoice-1001",
< "contentType": "text/plain",
< "fileName": "invoice-1001.txt",
< "text": "Invoice Number: INV-1001\nInvoice Date: 2026-09-20\nSupplier: Northwind Parts Ltd\nTotal Due: 1240.50\nCurrency: GBP"
< }
< ],
< "jsonSchema": {
< "type": "object",
< "additionalProperties": false,
< "required": [
< "invoiceNumber",
< "invoiceDate",
< "supplier",
< "totalDue",
< "currency"
< ],
< "properties": {
< "currency": {
< "type": "string",
< "enum": [
< "GBP",
< "EUR",
< "USD"
< ]
< },
< "invoiceDate": {
< "type": "string",
< "format": "date"
< },
< "invoiceNumber": {
< "type": "string"
< },
< "supplier": {
< "type": "string"
< },
< "totalDue": {
< "type": "number",
< "minimum": 0
< }
< }
< },
< "fieldConfig": {
< "invoiceNumber": {
< "aliases": [
< "Invoice Number",
< "Invoice No"
< ],
< "description": "Unique invoice identifier"
< },
< "totalDue": {
< "aliases": [
< "Total Due",
< "Amount Due"
< ],
< "description": "Final amount payable"
< }
< }
<}
<EOF
$curl "https://api.apify.com/v2/actors/first_watch~pdf-document-structured-json-extraction/runs?token=$API_TOKEN" \
< -X POST \
< -d @input.json \
< -H 'Content-Type: application/json'