> This page is for TRF Agent.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://revenue-docs.creliohealth.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://revenue-docs.creliohealth.com/_mcp/server.

# TRF Agent API

> Submit arbitrary JSON input to the TRF Agent and poll the asynchronous run.

# TRF Agent API

The TRF Agent API runs the configured TRF extraction flow asynchronously. Submit the JSON produced by your integration as-is; the gateway does not define or transform the TRF payload schema.

## Run lifecycle

1. Send the JSON input to `POST /public/v1/trf-runs`.
2. Receive `202 Accepted` with a prefixed TRF run ID and polling URL.
3. Poll the returned `statusUrl` until the status is `COMPLETED` or `FAILED`.
4. Read the flow output from `result` when processing completes.

Each submission creates an independent workflow. A document whose bytes match an earlier non-failed run in the same environment is refused with `409 trf_duplicate_document`; `details.runId` names that run, or is null while that run is still being accepted. Pass `?allowDuplicate=true` to start a new run for it anyway.

## Authentication

Use the same organization-scoped API key and SDK configuration as the other CrelioHealth APIs. The TRF Agent remains part of the current SDK; the product selector only separates its documentation and API reference inside this portal.