# Start adhoc document integrity check

> `POST /job/add/workflow` · Section: Document AI — OCR & IDP · PaperOffice AI API, release `R20261020.1635`.

`POST https://api.paperoffice.ai/latest/job/add/workflow`

## Overview

WRITE: start an adhoc Trust / integrity scan (credits). No agent id. Required: pofid or documents_id. Optional profile and tier. Then read po_documents_trust_get. Use processing_lane for Start-SLA (no_sla|sla_24h|sla_12h|sla_6h|sla_1h|instant). Legacy priority is internal only.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `pofid` | string | One of (`documents_id`, `pofid`) | PaperOffice File ID of a stored PDF |
| `documents_id` | integer | One of (`documents_id`, `pofid`) | Numeric document ID — Alternative to pofid |
| `profile` | string | No | Integrity profile. Default general. (allowed: general, invoice, bank_statement, contract, identity_document, payslip, application, utility_bill, receipt, certificate, official_letter, medical_certificate, insurance, delivery_note, rental_agreement, power_of_attorney, vehicle_document, email_export) |
| `tier` | string | No | Check depth / billing tier. Default premium. (allowed: basic, premium, ultra) |
| `include_visual_evidence` | boolean | No | Premium/Ultra: include visual evidence. Ignored on basic. |
| `processing_lane` | string | No | Start-SLA lane (wait-to-start guarantee, not completion). Values: no_sla (fair use ×1), sla_24h (×1.5), sla_12h (×2), sla_6h (×3), sla_1h (×4), instant (×5 interactive start). Prefer this over legacy numeric priority. If omitted: workspace default_processing_lane, else no_sla. (allowed: no_sla, sla_24h, sla_12h, sla_6h, sla_1h, instant) |

## Required alternatives

Provide **at least one** of: `documents_id` **or** `pofid`.

**Request body:** `multipart/form-data` — upload via field `file`, `file_1`, or `files` **or** pass `pofid` in the form body. Runtime accepts `file`, `files`, `file_1`, `file_2`, …. The parameter table lists `file_1` and `pofid` as **one of** when both exist. **Exception:** JSON `files` URL arrays are **not** supported on `/job/add/workflow` (unlike most `/job/add/{pipeline}` endpoints). Do not send `application/json` with a `files` array.

## Responses

Returns JSON with `status: "success"`; key fields: `job_id` or inline **`result`**. After poll, workflow/IDP payload stays in **`result`** (not `job_result`). When `idp_collection=invoice`: `pages_idp` / `pages_aiocr` with `_supplier_name`, `_total_amount`. Always read `result ?? job_result`. Optional `_billing` and `processing_time`. Errors: HTTP 4xx/5xx with `status: "error"`, `code`, and `message`.

## Connection hold & polling

- **Default (`client_wait` omitted or `true`):** The API holds **this HTTP connection** while the job runs, up to the **dynamic pipeline timeout** (priority, pages, pipeline type; minimum about 20s, infrastructure cap about 295s). Returns the finished result when ready.
- **Hold exceeded:** If the job is not finished in time → **HTTP 202** with `job_id`, `poll_url`, `max_wait_seconds`, and `client_wait: false`. The job **continues in the background** — poll `GET /job/get/{job_id}` every 5–10 seconds.
- **Immediate poll mode:** `client_wait=false` or `async_only=true` → `job_id` immediately (about 100ms), then poll as above.

**Response fields:** `client_wait` (boolean) — whether this response used connection hold; `max_wait_seconds` — actual hold duration attempted.

**Completed payload key:** After polling, OCR pipelines return the payload in `job_result`; workflow/IDP (`POST /job/add/workflow`) return it in `result`. Always read `result ?? job_result`. See **Job result schema**.

**Note:** Prefer `processing_lane` Start-SLA for wait-to-start / job price — see collection guide **Start-SLA (`processing_lane`) — wait-to-start**. Legacy `priority` is compat only.

## Essentials (all endpoints)

- **Base URL:** `https://api.paperoffice.ai/latest` · **Auth:** `Authorization: Bearer po_sk_…` or `po_ut_…` (server-side only); browser code uses `po_pk_…` with an allowlisted `Origin`. No Bearer at all on a product API returns HTTP 403 `TIER_RESTRICTED`.
- **Errors:** HTTP 4xx/5xx with `status: "error"`, `code` and `message`. Retry 429 (`Retry-After`) and 5xx with exponential backoff; do not retry validation errors.
- **Jobs:** `client_wait=true` (default) holds the connection. HTTP 202 means the job is still running — poll `GET /job/get/{job_id}` every 5–10 s until `job_status` is `completed`, then read `result ?? job_result`. `processing_lane` sets the Start-SLA; legacy `priority` is not part of the public contract.
- **Billing:** every billable product call costs at least 5 credits; read `_billing.job.credits_billed` on billed responses.
- **Mutations** use `POST` with action paths (e.g. `POST /documents/document-delete`), not HTTP `DELETE`.

---

All endpoints: [llms.txt](https://api.paperoffice.ai/latest/docs/llms.txt) · Everything in one file: [llms-full.txt](https://api.paperoffice.ai/latest/docs/llms-full.txt) · [OpenAPI 3.1](https://api.paperoffice.ai/latest/docs/openapi.json) · This page: https://api.paperoffice.ai/latest/docs/endpoints/po-documents-trust-check.md

*Generated 2026-10-20 from live API documentation (release `R20261020.1635`).*
