Docs

AITL (Adjudicator-in-the-Loop) flow

The API drives a structured flow. The agent calls the API and relays prompts to you; you confirm or provide feedback until the classification is approved.

Steps

  1. Start — Call POST /api/classify/start-free (with walletAddress) or paid POST /api/classify/start. You get a jobId and a prompt asking for item details.
  2. Submit item info — Agent sends to POST /api/classify/submit-info: jobId plus item fields (description, specifications, intendedUse, notes; optionally performanceParameters, valuation, units, htsCode, scheduleBNumber, endUser, endUse, destinationCountry). API returns jurisdiction (BIS or ITAR), rationale, and structured output (justification, exportRestrictions, licenseRequirements, auditLog).
  3. Get proposed classification — Either API-driven: confirm jurisdiction via POST /api/classify/confirm-jurisdiction, then POST /api/classify/request-oor (API runs Order of Review). Or agent-driven: agent runs classification using the skill prompts, calls POST /api/classify/submit-classification with proposedClassification, then POST /api/classify/request-oor to retrieve the proposal for you.
  4. Review and refine — You approve or give feedback. Agent calls POST /api/classify/refine-oor with feedback if needed (or re-submits classification in agent-driven flow). Repeat until you are satisfied.
  5. Approve — Agent calls POST /api/classify/approve. API stores the classification and generates an audit-ready report; returns reportUrl when Supabase Storage is configured. If report storage fails, the response includes reportStorageError; the classification is still approved.

All session steps (submit-info, submit-classification, confirm-jurisdiction, request-oor, refine-oor, approve, status) require the same jobId in the request body. Only start (and optionally jurisdiction) are paid. To recover context (e.g. "where are we?"), call POST /api/classify/status with jobId; the API returns state, nextStep, and promptForUser.