{
    "name": "exdata API",
    "version": "1",
    "type": "bruno-collection",
    "environments": {
        "default": {
            "base_url": "https://www.exdata.app/api/v1",
            "api_token": "your-test-token",
            "document_id": "123",
            "extraction_run_id": "456",
            "physical_page": "1",
            "projection": "invoice-lines.csv",
            "preview_id": "987",
            "extraction_result_etag": "\"extraction-result-789-v0\""
        }
    },
    "requests": [
        {
            "name": "Check API authentication",
            "method": "GET",
            "url": "{{base_url}}/ping"
        },
        {
            "name": "List documents",
            "method": "GET",
            "url": "{{base_url}}/documents?sort=-created_at&per_page=25"
        },
        {
            "name": "Upload a document",
            "method": "POST",
            "url": "{{base_url}}/documents",
            "headers": {
                "Idempotency-Key": "invoice-{{timestamp}}"
            },
            "body": {
                "mode": "multipartForm",
                "fields": [
                    {
                        "name": "file",
                        "type": "file",
                        "value": "./invoice.pdf"
                    },
                    {
                        "name": "locale",
                        "type": "text",
                        "value": "en"
                    },
                    {
                        "name": "custom_types[]",
                        "type": "text",
                        "value": "invoice"
                    },
                    {
                        "name": "requester",
                        "type": "text",
                        "value": "accounts-payable"
                    },
                    {
                        "name": "processing_mode",
                        "type": "text",
                        "value": "extraction"
                    },
                    {
                        "name": "processing_lane",
                        "type": "text",
                        "value": "standard"
                    },
                    {
                        "name": "extraction_profile",
                        "type": "text",
                        "value": "generic"
                    }
                ]
            }
        },
        {
            "name": "Upload a document with x402 payment",
            "method": "POST",
            "url": "{{base_url}}/x402/extractions"
        },
        {
            "name": "Retrieve an anonymous x402 extraction",
            "method": "GET",
            "url": "{{base_url}}/x402/extractions/{{document_id}}"
        },
        {
            "name": "Retrieve a document",
            "method": "GET",
            "url": "{{base_url}}/documents/{{document_id}}"
        },
        {
            "name": "Delete a document",
            "method": "DELETE",
            "url": "{{base_url}}/documents/{{document_id}}"
        },
        {
            "name": "Download document thumbnail",
            "method": "GET",
            "url": "{{base_url}}/documents/{{document_id}}/thumbnail"
        },
        {
            "name": "List document previews",
            "method": "GET",
            "url": "{{base_url}}/documents/{{document_id}}/previews"
        },
        {
            "name": "List document extractions",
            "method": "GET",
            "url": "{{base_url}}/documents/{{document_id}}/extractions?include=evidence"
        },
        {
            "name": "Download an extraction evidence page preview",
            "method": "GET",
            "url": "{{base_url}}/documents/{{document_id}}/extraction-runs/{{extraction_run_id}}/pages/{{physical_page}}/preview"
        },
        {
            "name": "Download a document profile export",
            "method": "GET",
            "url": "{{base_url}}/documents/{{document_id}}/exports/{{projection}}"
        },
        {
            "name": "Download a deterministic batch profile export",
            "method": "GET",
            "url": "{{base_url}}/documents/exports/{{projection}}?document_ids[]=123&document_ids[]=456"
        },
        {
            "name": "Review a profile result",
            "method": "POST",
            "url": "{{base_url}}/documents/{{document_id}}/extractions/reviews",
            "headers": {
                "Content-Type": "application/json",
                "Idempotency-Key": "extraction-review-{{timestamp}}",
                "If-Match": "{{extraction_result_etag}}"
            },
            "body": {
                "mode": "json",
                "json": {
                    "action": "correct",
                    "invoice_ref": "invoice_5f2db86e322d058b2bfd",
                    "entity_ref": "relationship_1",
                    "field": "customer_number",
                    "corrected_value": "KUNDE-10",
                    "reason": "Confirmed against the printed account block.",
                    "evidence_reference": {
                        "component_ref": "component_8a1f74f0f1d8c2ab",
                        "physical_page": 1,
                        "label": "Kundennummer",
                        "text": "Kundennummer KUNDE-10",
                        "source": "native_text",
                        "match": "manual"
                    }
                }
            }
        },
        {
            "name": "Download a preview file",
            "method": "GET",
            "url": "{{base_url}}/previews/{{preview_id}}"
        }
    ]
}
