---
title: "Start a pre-audit run"
method: POST
path: "/audit/runs"
tags: ["Audit"]
---

# Start a pre-audit run

`POST /audit/runs`

## Request

- Base URL: `https://api.tarifflo.com/api/v2`
- URL: `https://api.tarifflo.com/api/v2/audit/runs`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Files the uploaded documents under a fresh audit request and runs the pre-audit (ingest, classification, rate and savings). Answers 202 with the run id; the result is delivered as a `pre_audit.completed` webhook to the key environment's URL (or `Tarifflo-Webhook-Url`) and pollable at GET /audit/runs/{jobId}. `config: "post"` (PSC) is not available yet.

Requires the API key scope `audit`.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `config` 'pre' | 'post', required
  - `fileIds` string[], required
  - `clientName` string: The audit client to file under (default "API Intake").
  - `requestName` string
  - `destinationCountries` string[]: Markets to rate for (default US).
  - `dryRun` boolean: Price the request at the organization's card and reserve nothing; answers 200 with the estimate.

## Response `202`

Queued (or, for `dryRun`, priced with 200)

- union
  - object
    - `jobId` string, required: The run id: poll GET /audit/runs/{jobId}.
    - `credits` object: What the job has reserved, used and refunded so far, in credits.
      - `action` 'rate_lookup' | 'adcvd_screen' | 'pga_applicability' | 'code_classified' | 'export_control' | 'origin_determination' | 'entry_filed' | 'entry_prepared' | 'document_ocr' | 'document_extract' | 'document_sort' | 'product_enrich' | 'entry_review' | 'rationale_document' | 'audit_parse' | 'data_export', nullable, required
      - `reserved` number, required
      - `used` number, required
      - `refunded` number, required
    - `status` 'queued', required
    - `config` 'pre', required
    - `filesQueued` number, required
    - `message` string, required
  - object
    - `dryRun` true, required
    - `estimatedCredits` number, required
    - `lines` object[], required
      - `action` 'rate_lookup' | 'adcvd_screen' | 'pga_applicability' | 'code_classified' | 'export_control' | 'origin_determination' | 'entry_filed' | 'entry_prepared' | 'document_ocr' | 'document_extract' | 'document_sort' | 'product_enrich' | 'entry_review' | 'rationale_document' | 'audit_parse' | 'data_export', required
      - `units` number, required
      - `credits` number, required
    - `balance` number, required
    - `unit` 'token' | 'credit', required
    - `note` string

## Other responses

- `400`: Invalid input data
- `401`: Authorization not provided
- `402`: Not enough credits
- `403`: Insufficient access
- `409`: The first request with this Idempotency-Key is still filing
- `500`: Internal server error
- `501`: `config: "post"` is not available yet

---

[API](https://skmtc.dev/tarifflo/apis/tarifflo-api.md) - [All operations](https://skmtc.dev/tarifflo/apis/tarifflo-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tarifflo/apis/tarifflo-api/revisions/f048ebac1ac5?raw)
