Skip to main content
GET
Rate limit tier: general, 600 requests/min. See Rate limits. Fetches one optimization by its id. It is the poll target for a run started with POST /v3/workflows/{workflow_id}/optimizations/. The id is the identifier that start returned.

Status model

The endpoint always returns 200 while the optimization exists. Poll until status is done or failed. A run whose worker stopped for more than 100 minutes is reported failed.

Reading the result

  • result_version_id names the workflow version that holds the optimized descriptions. It is null until a round is kept. The result goes live as the workflow’s latest version.
  • baseline_accuracy and best_accuracy are the measured accuracy before the run and the best a round reached. A one-shot run is not measured, so both stay null.
  • rounds lists each scored round. Round 0 is the baseline. Each round carries its matched and mismatched tallies, its accuracy, whether it was accepted, and per_field, the same scores per field, keyed by the field’s persistent_id.
An unknown id returns 404, and so does an optimization on another workflow or organization: existence never leaks. A caller outside the workflow’s organization gets 403.

Authorizations

Authorization
string
header
required

API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.

Path Parameters

workflow_id
string
required
optimization_id
string
required

Response

Successful Response

One optimization run.

id
string
required

Unique identifier of the optimization (hyphenated UUID).

Example:

"069dcc2c-e14c-7606-8000-2ee4fb17b4f9"

workflow_id
string
required

The optimized workflow (hyphenated UUID).

kind
enum<string>
required
Available options:
extraction,
extraction_oneshot
status
enum<string>
required

Lifecycle of a run. Non-terminal: evaluating, proposing. Terminal: done, failed.

Available options:
evaluating,
proposing,
done,
failed
max_rounds
integer
required

Most rounds the run may try.

rounds
OptimizationRoundV3 · object[]
required
baseline_accuracy
number | null

Accuracy before any change; null until scored and on a one-shot run.

best_accuracy
number | null

Best accuracy any round reached; null until scored and on a one-shot run.

result_version_id
string | null

The workflow version that holds the optimized descriptions; null until a round is kept.

error
string | null

Why the run failed; null unless status is failed.

created_at
string<date-time> | null

When the run started (ISO 8601).

finished_at
string<date-time> | null

When the run reached done or failed (ISO 8601); null while it runs.