Skip to main content
PATCH
/
prod
/
v1
/
files
/
{fileId}
curl --request PATCH \
  --url https://api.orion.file.ai/prod/v1/files/{fileId} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "integrationExportStatus": "completed",
  "integrationExportMessages": [
    "Successfully synced to ERP system"
  ]
}
'
{
  "fileId": "53d6a0b1-2a8d-4ed9-9e6a-ceaef7ca3908",
  "exportInfo": {
    "integrationExportStatus": "completed",
    "integrationExportMessages": [
      "Successfully synced to ERP system"
    ],
    "integrationExportUpdatedAt": "2025-01-26T14:30:00.000Z"
  }
}
This endpoint enables pull-based integrations to report the export status of files back to fileAI.

Use Cases

ERP Integration

Report when documents have been successfully imported into your ERP system

Accounting Software

Confirm invoices have been processed in your accounting platform

Custom Workflows

Track document processing status in your custom integrations

Error Handling

Report validation errors or processing failures back to users

Status Values

StatusDescriptionWhen to Use
completedExport successfulDocument was successfully processed by integrated system
errorExport failedValidation error, processing failure, or other issues
exportingIn progressDocument is queued or being processed
emptyNo statusReset/clear the export status

Integration Flow

1

Fetch Files

Use GET /files with updatedAfter to get files that need processing
2

Process Files

Download and process files in your integrated system
3

Report Status

Call this endpoint to report the export status back to fileAI
4

User Visibility

Users see the status in the fileAI UI, enabling them to track integration progress

Example: Reporting Success

curl -X PATCH "https://api.orion.file.ai/prod/v1/files/53d6a0b1-2a8d-4ed9-9e6a-ceaef7ca3908" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationExportStatus": "completed",
    "integrationExportMessages": ["Successfully imported to SAP"]
  }'

Example: Reporting Error

curl -X PATCH "https://api.orion.file.ai/prod/v1/files/53d6a0b1-2a8d-4ed9-9e6a-ceaef7ca3908" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationExportStatus": "error",
    "integrationExportMessages": [
      "Validation failed: Invoice number format invalid",
      "Expected format: INV-YYYY-NNNN"
    ]
  }'
The export status and messages are visible in the fileAI file list UI, helping users understand the integration status of their documents.

Authorizations

x-api-key
string
header
required

API key for authentication

Path Parameters

fileId
string
required

The unique identifier of the file (document ID)

Example:

"53d6a0b1-2a8d-4ed9-9e6a-ceaef7ca3908"

Body

application/json

Export status update payload

integrationExportStatus
enum<string>
required

Export status from integrated system

Available options:
error,
completed,
exporting,
empty
Example:

"completed"

integrationExportMessages
string[]

Export messages describing the result from integrated system

Example:
["Successfully synced to ERP system"]

Response

Export status updated successfully

fileId
string
required

The file ID (document ID)

exportInfo
object
required

Export info object containing integration export status fields