---
title: Quickstart
description: Three commands: run a workflow on a packet, poll the case, read what was filed.
section: API
order: 3
---

You need an [API key](/docs/api/authentication) in `SHEAF_KEY` and a PDF.

## 1. Run a workflow on a packet

```bash
curl -X POST "https://sheaf.us/api/workflows/standard-intake/runs" \
  -H "Authorization: Bearer $SHEAF_KEY" \
  -F "files=@packet.pdf" \
  -F "applicant=Jane Doe" \
  -F "expectedDocList=purchase-loan-ca"
```

The answer is `201` with the case:

```json
{ "id": "euw8ydHxTW", "applicantName": "Jane Doe", "run": { "state": "running", "kind": "parse" } }
```

`standard-intake` and `purchase-loan-ca` exist in every new organization. Your own are listed by `GET /workflows` and `GET /expected-doc-lists`.

## 2. Poll until the run lands

```bash
curl "https://sheaf.us/api/applications/euw8ydHxTW" \
  -H "Authorization: Bearer $SHEAF_KEY"
```

Ask every five to ten seconds. When `run.state` is `report`, the run has landed and the workflow has filed what it could. A run takes minutes.

## 3. Read what was filed

```bash
curl "https://sheaf.us/api/applications/euw8ydHxTW/documents" \
  -H "Authorization: Bearer $SHEAF_KEY"
```

Each entry is a document with its pages, the line of the list it was filed under, and the decision. The shape is in [reading results](/docs/api/reading-results).

## If the first call answers 409

Pre-flight flagged a file and Sheaf will not override that for you. The case exists and waits for a person. See [run a workflow](/docs/api/run-a-workflow#red-flags).
