---
title: "GET /agents/fetch-output"
method: GET
path: "/agents/fetch-output"
tags: ["agents"]
---

# GET /agents/fetch-output

`GET /agents/fetch-output`

Gets the output of the most recent container of an agent. This API endpoint is specifically designed so that it's easy to get incremental data from an agent.

## Query parameters

- `id` string, required
- `fromOutputPos` number
- `prevContainerId` string
- `prevStatus` union
  - 'starting' | 'running' | 'finished' | 'unknown' | 'launch error'
  - 'never launched'
- `prevRuntimeEventIndex` number

## Headers

- `X-Phantombuster-Org` string

## Response `200`

OK

- object
  - `containerId` string
  - `status` union, required
    - 'starting' | 'running' | 'finished' | 'unknown' | 'launch error'
    - 'never launched'
  - `output` string
  - `outputPos` number
  - `mostRecentEndedAt` number
  - `progress` number
  - `progressLabel` string
  - `isAgentRunning` boolean, required
  - `canSoftAbort` boolean, required
  - `runtimeEvents` object[]
    - `timestamp` number
    - `slug` string, required
    - `icon` string
    - `type` string
    - `category` string
    - `title` string
    - `text` string
    - `primaryValue` union
      - number
      - string
      - boolean
    - `secondaryValue` union
      - number
      - string
      - boolean
    - `props` object
    - `setupLink` string
    - `redirectPage` string

## Other responses

- `400` — Invalid output position provided.

---

[API](https://skmtc.dev/phantombuster/apis/phantombuster-api-v2.md) · [All operations](https://skmtc.dev/phantombuster/apis/phantombuster-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/phantombuster/phantombuster-api-v2/revisions/acf0049d7c7f/schema)
