> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modaic.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get instruction optimization job

> Poll an instruction optimization job's status, progress, and result.

Get the current state of an instruction optimization job. Poll until `status` is
`completed`, `failed`, or `cancelled`.

**jobId** `UUID` *required*

Instruction optimization job ID.

## Response

**id** `UUID` *required*

**repositoryId** `UUID` *required*

**status** `queued | running | completed | failed | cancelled` *required*

**phase** `queued | optimizing | done | failed | cancelled` *required*

**branch** `string` *required*

**sourceCommitSha** `string` *required*

**resultCommitSha** `string | null` *required*

**result** `InstructionOptimizationResult | null` *required*

A completed result contains `status: "completed"`, `improved`,
`bestCandidate`, `initialScore`, `bestScore`, `usage`, optional `metrics`, and
nullable `artifactPath`.

**progress** `InstructionOptimizationProgress | null` *required*

`stage` is one of `starting`, `optimizing`, `scoring`, `finishing`,
`committing`, or `done`. `metricCalls / maxMetricCalls` is the useful progress
fraction when both values are present; the run may finish before reaching the
maximum.

**error** `object | null` *required*

**createdAt** `ISO 8601 datetime` *required*

**updatedAt** `ISO 8601 datetime` *required*

**startedAt** `ISO 8601 datetime | null` *required*

**finishedAt** `ISO 8601 datetime | null` *required*


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.