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

> ## Agent Instructions
> Start with /introduction/getting-started. Use the Direct Query API (POST /query) with the Newton Fusion model (text, image, and video reasoning) or the Newton Omega encoder (time-series embeddings). ATAI_API_ENDPOINT must include the version path: /v0.5 for most APIs, /v0.6 for the Fine-Tuning Service. Pages whose descriptions are marked (Archived) document the legacy Lens runtime — do not use them for new projects.

# List Outputs

> Retrieve a paginated list of outputs for a specific job

<Callout icon="clock" color="#3064E3" iconType="solid">
  Requires [version 1.1.0](/release-notes/1.1.x#v1-1-0) or later of the Archetype platform.
</Callout>

## Overview

This endpoint returns a paginated list of output files produced by a job. You can filter by port name or input ID to find specific results.

## Request

<ParamField path="id" type="string" required>
  The unique job identifier
</ParamField>

<ParamField query="port_name" type="string">
  Filter outputs by port name
</ParamField>

<ParamField query="input_id" type="string">
  Filter outputs associated with a specific input
</ParamField>

<ParamField query="offset" type="integer">
  Number of items to skip for pagination (default: 0)
</ParamField>

<ParamField query="limit" type="integer">
  Maximum number of items to return per page
</ParamField>

## Response

<ResponseField name="job_id" type="string">
  The job identifier
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of outputs matching the filter criteria
</ResponseField>

<ResponseField name="offset" type="integer">
  Current pagination offset
</ResponseField>

<ResponseField name="limit" type="integer">
  Maximum number of items returned
</ResponseField>

<ResponseField name="outputs" type="array">
  Array of output objects, each containing:

  * `id` — Unique output identifier
  * `job_id` — Parent job identifier
  * `port_name` — Output port name
  * `input_id` — Associated input ID (if applicable)
  * `input_file_id` — `file_id` of the source input (if applicable)
  * `data` — Data reference (`DataRef`) with required `ref` (presigned download URL) and `filename`, plus optional `file_type`, `file_extension`, `num_bytes`, `metadata`, `file_tags`, `file_attributes`
  * `expires_at` — Expiration timestamp for the presigned download URL (re-fetch after this time)
  * `created_at` — Creation timestamp
</ResponseField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl "https://api.u1.archetypeai.app/v0.5/batch/jobs/job_2abc3def4ghi5jkl6mno7pqr/outputs?port_name=worker.results&limit=10" \
    -H "Authorization: Bearer $ATAI_API_KEY"
  ```

  ```python Python theme={"system"}
  import requests
  import os

  api_key = os.environ.get("ATAI_API_KEY")
  job_id = "job_2abc3def4ghi5jkl6mno7pqr"

  response = requests.get(
      f"https://api.u1.archetypeai.app/v0.5/batch/jobs/{job_id}/outputs",
      headers={"Authorization": f"Bearer {api_key}"},
      params={
          "port_name": "worker.results",
          "limit": 10
      }
  )

  data = response.json()
  print(f"Total outputs: {data['total']}")
  for output in data["outputs"]:
      print(f"  {output['id']}: {output['data']['filename']}")
      print(f"    Download: {output['data']['ref']}")
  ```

  ```javascript JavaScript theme={"system"}
  const jobId = 'job_2abc3def4ghi5jkl6mno7pqr';
  const params = new URLSearchParams({ port_name: 'worker.results', limit: '10' });

  const response = await fetch(`https://api.u1.archetypeai.app/v0.5/batch/jobs/${jobId}/outputs?${params}`, {
    headers: {
      'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
    }
  });

  const data = await response.json();
  console.log(`Total outputs: ${data.total}`);
  data.outputs.forEach(output => {
    console.log(`  ${output.id}: ${output.data.filename}`);
    console.log(`    Download: ${output.data.ref}`);
  });
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={"system"}
  {
    "job_id": "job_2abc3def4ghi5jkl6mno7pqr",
    "total": 2,
    "offset": 0,
    "limit": 10,
    "outputs": [
      {
        "id": "out_abc123def456",
        "job_id": "job_2abc3def4ghi5jkl6mno7pqr",
        "port_name": "worker.results",
        "input_id": "inp_abc123def456",
        "input_file_id": "file_abc123",
        "data": {
          "ref": "https://storage.example.com/outputs/result1.json?X-Amz-Signature=...",
          "filename": "result1.json",
          "file_type": "application/json",
          "file_extension": ".json",
          "num_bytes": 1024,
          "metadata": {}
        },
        "expires_at": "2026-04-14T11:00:00Z",
        "created_at": "2026-04-14T10:10:00Z"
      }
    ]
  }
  ```

  ```json 404 - Not Found theme={"system"}
  {
    "code": "NOT_FOUND",
    "message": "Job not found",
    "error_uid": "err_abc123"
  }
  ```

  ```json 401 - Unauthorized theme={"system"}
  {
    "detail": "Invalid access with key: api_key_not_found"
  }
  ```
</ResponseExample>

<Note>
  Output download URLs are presigned and expire at the time indicated by `expires_at`. Re-fetch the outputs list to get fresh URLs after expiration.
</Note>
