> ## Documentation Index
> Fetch the complete documentation index at: https://docs.file.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Processing callback

> Real-time updates for your file processing pipeline through secure webhook callbacks.

## **Overview**

Our file processing system sends webhook events to notify your application about the status of uploaded files as they progress through our processing pipeline. Each event contains detailed information about the current processing step and file status.

**📋 Quick Facts**

* **Method**: `POST`
* **Content-Type**: `application/json`
* **Retries**: Up to 5 attempts with exponential backoff
* **Timeout**: 30 seconds

***

## **🚀 Integration Guide**

### **1. Set up your webhook endpoint**

Create an HTTP endpoint that accepts POST requests and returns a `200` status code to acknowledge receipt of the webhook.

### **2. Configure webhook URL**

Set your webhook URL in the dashboard or contact support to configure your callback endpoint.

### **3. Handle events in your application**

Your endpoint will receive JSON payloads for each processing step. Parse the `status`, `step`, `uploadId`, and `fileIds` fields to track file processing progress.

```

---

## 📊 Processing Workflow

Your files progress through our automated processing pipeline:
```

📁 File Upload\
↓ ⚡ Processing Started ↓ 🛡️ Fraud Detection ↓ 📄 First Page Analysis ↓ 🔍 OCR Processing ↓ ✅ OCR Evaluation ↓ 📑 Split & Classify ↓ 🎉 Processing Finished

````

---

## 📋 Event Reference

### Base Event Structure

All webhook events share this common structure:

```json
{
  "status": "completed",
  "step": "processing_started",
  "uploadId": "e9818d17-e5be-4d57-bdc8-5a40b4f6f4e1",
  "timestamp": "2025-06-11T10:30:00Z",
  "fileIds": "b765bd00-181e-4737-b4d9-004dadd6bd45"
}
````

#### **Core Fields**

| **Field**   | **Type** | **Description**                                  |
| :---------- | :------- | :----------------------------------------------- |
| `status`    | `string` | Current status: `waiting`, `completed`, `failed` |
| `step`      | `string` | Processing step identifier                       |
| `uploadId`  | `string` | Unique identifier for the upload session         |
| `timestamp` | `string` | ISO 8601 timestamp when event occurred           |
| `fileIds`   | `string` | Available in final steps - processed file IDs    |

***

## **🔄 Event Types**

### **1. File Uploaded**

**Step**: `file_uploaded`\
**When**: File successfully uploaded to our system

JSON

```
{
  "status": "completed",
  "step": "file_uploaded",
  "uploadId": "e9818d17-e5be-4d57-bdc8-5a40b4f6f4e1",
  "timestamp": "2025-06-11T10:30:00Z"
}
```

**Next Step**: `processing_started`

***

### **2. Processing Started**

**Step**: `processing_started`\
**When**: File enters processing queue

JSON

```
{
  "status": "waiting",
  "step": "processing_started", 
  "uploadId": "e9818d17-e5be-4d57-bdc8-5a40b4f6f4e1",
  "timestamp": "2025-06-11T10:30:15Z"
}
```

JSON

```
{
  "status": "completed",
  "step": "processing_started",
  "uploadId": "e9818d17-e5be-4d57-bdc8-5a40b4f6f4e1", 
  "timestamp": "2025-06-11T10:30:30Z"
}
```

**Status Flow**: `waiting` → `completed`\
**Next Step**: `fraud_detection`

***

### **3. Fraud Detection**

**Step**: `fraud_detection`\
**When**: Security and fraud checks completed

JSON

```
{
  "status": "completed",
  "step": "fraud_detection",
  "uploadId": "e9818d17-e5be-4d57-bdc8-5a40b4f6f4e1",
  "timestamp": "2025-06-11T10:31:00Z"
}
```

**Next Step**: `first_page_analysis`

***

### **4. First Page Analysis**

**Step**: `first_page_analysis`\
**When**: Initial document analysis completed

JSON

```
{
  "status": "completed",
  "step": "first_page_analysis",
  "uploadId": "e9818d17-e5be-4d57-bdc8-5a40b4f6f4e1",
  "timestamp": "2025-06-11T10:31:30Z"
}
```

**Next Step**: `beethoven_ocr`

***

### **5. OCR Processing**

**Step**: `beethoven_ocr`\
**When**: Optical Character Recognition completed

JSON

```
{
  "status": "completed", 
  "step": "beethoven_ocr",
  "uploadId": "e9818d17-e5be-4d57-bdc8-5a40b4f6f4e1",
  "timestamp": "2025-06-11T10:32:15Z"
}
```

**Next Step**: `ocr_evaluation`

***

### **6. OCR Evaluation**

**Step**: `ocr_evaluation`\
**When**: OCR quality assessment completed

JSON

```
{
  "status": "completed",
  "step": "ocr_evaluation", 
  "uploadId": "e9818d17-e5be-4d57-bdc8-5a40b4f6f4e1",
  "timestamp": "2025-06-11T10:32:45Z"
}
```

**Next Step**: `split_classify`

***

### **7. Split & Classify**

**Step**: `split_classify`\
**When**: Document splitting and classification completed

JSON

```
{
  "status": "completed",
  "step": "split_classify",
  "uploadId": "e9818d17-e5be-4d57-bdc8-5a40b4f6f4e1",
  "fileIds": ["b765bd00-181e-4737-b4d9-004dadd6bd45"],
  "timestamp": "2025-06-11T10:33:15Z"
}
```

**📌 Important**: First event where `fileIds` becomes available\
**Next Step**: `processing_finished`

***

### **8. Processing Finished**

**Step**: `processing_finished`\
**When**: All processing completed successfully

JSON

```
{
  "status": "completed",
  "step": "processing_finished",
  "uploadId": "e9818d17-e5be-4d57-bdc8-5a40b4f6f4e1",
  "fileIds": ["b765bd00-181e-4737-b4d9-004dadd6bd45"],
  "timestamp": "2025-06-11T10:33:30Z"
}
```

**🎉 Final Step**: Your files are ready for download/use
