# Airparser

> Automatically pull key information out of documents with Airparser.

App · Document Extraction · 4 actions · 1 trigger. Web page: https://docs.lodol.com/docs/integrations/airparser

## Triggers

Start a workflow when something happens in Airparser. See [how triggers work](https://docs.lodol.com/docs/concepts/triggers.md).

### Airparser New Document

Triggers when a new document is parsed in an Airparser inbox

**Filters**: Narrow which events start a run.

- `inbox_id` (required)

**Event fields**: What a run starts with. Later steps read each field with an @ reference.

- `_id` (text)
- `status` (text)
- `created_at` (text)
- `json` (object)
- `data_text` (text)

## Actions

### Get parsed document

Get the information Airparser extracted from a specific document.

**Inputs**

- Document (`document_id`, text, required): The document to retrieve, given by its ID or URL.

**Outputs**

- `document` (object)
- `status` (text)

**Example output**

```json
{
  "document": {
    "_id": "doc-001",
    "json": {
      "date": "2024-01-15",
      "invoice_number": "INV-2024-001",
      "total": 1234.56
    },
    "status": "parsed"
  },
  "status": "success"
}
```

### List documents

List documents in an Airparser inbox.

**Inputs**

- Inbox (`inbox_id`, text, required): The inbox to list documents from.
- After This Date (`from_date`, date): Only include documents on or after this date.
- Before This Date (`to_date`, date): Only include documents on or before this date.
- Status (`status`, text): Only include documents with these statuses. One or more of: `new`, `importing`, `parsing`, `parsed`, `fail` (Failed), `quota` (Quota Exceeded), `exception`.
- Query Filters (`query`, text): Filter the list of documents returned.

**Outputs**

- `documents` (list)
- `status` (text)

**Example output**

```json
{
  "documents": [
    {
      "_id": "doc-001",
      "created_at": "2024-01-15T10:00:00Z",
      "status": "parsed"
    },
    {
      "_id": "doc-002",
      "created_at": "2024-01-16T11:00:00Z",
      "status": "parsed"
    }
  ],
  "status": "success"
}
```

### List inboxes

List all inboxes in the Airparser account.

**Inputs**: None.

**Outputs**

- `inboxes` (list)
- `status` (text)

**Example output**

```json
{
  "inboxes": [
    {
      "_id": "inbox-001",
      "email": "invoices@inbox.airparser.com",
      "name": "Invoices"
    },
    {
      "_id": "inbox-002",
      "email": "receipts@inbox.airparser.com",
      "name": "Receipts"
    }
  ],
  "status": "success"
}
```

### Upload document

Upload a document to an Airparser inbox for parsing.

**Inputs**

- Inbox (`inbox_id`, text, required): The inbox to upload the document to.
- File (`file`, text, required): The document to upload, given by its URL or uploaded here.
- Metadata (`metadata`, object): Extra details to attach to the document

**Outputs**

- `document_id` (text)
- `status` (text)

**Example output**

```json
{
  "document_id": "doc-abc123",
  "status": "success"
}
```
