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

# Webhooks

> Current status of webhook delivery for document workflows.

## Status

Public webhook registration is not part of the current generally available API. Use polling against document, file, host, and workflow endpoints until webhook delivery is promoted back into the public surface.

## Recommended Patterns

### Document processing

Upload a document, then poll the document status endpoint until the phase is terminal:

```bash theme={null}
curl https://api.okrapdf.com/v1/documents/doc-abc123 \
  -H "Authorization: Bearer $OKRA_API_KEY"
```

When the document is ready, read Markdown, JSON, page content, entities, or run chat/structured-output requests.

### Direct file workflows

For passive file uploads, use `/v1/files` or the direct-upload pair `/v1/files/presign` and `/v1/files/finalize`. Files are storage assets; they do not imply an extraction job by themselves.

### Invoice extraction workflow

For the built-in invoice workflow, create a run and poll the run endpoint:

```bash theme={null}
curl https://api.okrapdf.com/v1/workflows/invoice-extraction/runs/run_abc123 \
  -H "Authorization: Bearer $OKRA_API_KEY"
```

Then download JSON, CSV, XML, or XLSX results from the run result endpoints.

## Future Webhook Shape

Webhook delivery will return as a first-class account setting instead of a per-upload legacy field. Until then, avoid building against old `/document/.../upload-url` webhook examples.
