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

# Get Job Execution Results

> Retrieve the output and results of a completed job

Once the status of a job is `COMPLETED`, you can use this endpoint to retrieve the results of the job execution. The response contains a single top-level field, `jobResultsPayloadSchema`, whose keys are the output variable names defined by your workflow.

<Warning>
  This endpoint should only be called after the job status returns `COMPLETED`. Check the status first using [Get Job Status](/api-reference/jobs/get-job-status).
</Warning>

## Path Parameters

<ParamField path="jobExecutionId" type="string" required>
  The ID of the job whose execution results you want to retrieve. This is the `jobExecutionId` returned from [Initiate Job](/api-reference/jobs/initiate-job).
</ParamField>

## Headers

<ParamField header="x-service-key" type="string" required>
  Your API authentication key
</ParamField>

## Response

<ResponseField name="jobResultsPayloadSchema" type="object" required>
  The workflow's output payload, keyed by output variable name. Each entry is a Variable Object whose shape mirrors the inputs you provided in [Execute Job](/api-reference/jobs/execute-job).

  <Expandable title="Variable Object">
    <ResponseField name="value" type="any">
      The output value. Its concrete type depends on `type` (e.g., a string for `str`, a URL for `file`, an array for `array`).
    </ResponseField>

    <ResponseField name="type" type="string">
      The data type of the output: `str`, `float`, `bool`, `date`, `file`, `array`, `array_files`, or `object`.
    </ResponseField>

    <ResponseField name="displayName" type="string">
      The variable name displayed in the Opus platform UI.
    </ResponseField>
  </Expandable>
</ResponseField>

<Note>
  The keys inside `jobResultsPayloadSchema` are defined by your workflow's output schema and will vary between workflows. The example below is illustrative — your output variable names will differ.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://operator.opus.com/job/{YOUR_JOB_EXECUTION_ID}/results \
    --header 'x-service-key: {YOUR_SERVICE_KEY}'
  ```

  ```python Python theme={null}
  import requests

  url = "https://operator.opus.com/job/{YOUR_JOB_EXECUTION_ID}/results"
  headers = {"x-service-key": "{YOUR_SERVICE_KEY}"}

  response = requests.get(url, headers=headers)
  results = response.json()

  # Iterate over each output variable defined by your workflow
  for name, variable in results["jobResultsPayloadSchema"].items():
      print(f"{name} ({variable['type']}): {variable['value']}")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://operator.opus.com/job/{YOUR_JOB_EXECUTION_ID}/results",
    {
      method: "GET",
      headers: {
        "x-service-key": "{YOUR_SERVICE_KEY}",
      },
    }
  );

  const results = await response.json();

  // Iterate over each output variable defined by your workflow
  for (const [name, variable] of Object.entries(results.jobResultsPayloadSchema)) {
    console.log(`${name} (${variable.type}): ${variable.value}`);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Response theme={null}
  {
    "jobResultsPayloadSchema": {
      "{OUTPUT_VARIABLE_1}": {
        "value": "{STRING_VALUE}",
        "type": "str",
        "displayName": "Summary"
      },
      "{OUTPUT_VARIABLE_2}": {
        "value": "{FILE_URL}",
        "type": "file",
        "displayName": "Generated Report"
      }
    }
  }
  ```
</ResponseExample>
