---
title: "Recent containers of the given phantoms, reduced to their shape"
method: POST
path: "/api/phantombuster-monitor/containers"
tags: ["PhantomBuster monitor"]
---

# Recent containers of the given phantoms, reduced to their shape

`POST /api/phantombuster-monitor/containers`

## Request

- Base URL: `https://api.sponsorunited.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.sponsorunited.com/api/phantombuster-monitor/containers`
- Auth: HTTP bearer

Passed on to social-platforms-api, which holds the PhantomBuster key and reduces each container to its shape. Each phantom carries its own ok/error, so one failing phantom leaves the others intact. When social-platforms-api itself fails, the answer is a 502 or 504, never an empty list. Requires the phantombuster-monitor-read permission.

## Request body

- FetchPhantomBusterContainersRequest
  - `agentIds` string[], required: Phantom ids, as strings: several are larger than JavaScript can hold exactly as a number. Between 1 and 50, no repeats; each one is a separate PhantomBuster call.
  - `lookbackHours` number, nullable: How far back to look for finished containers. Defaults to 24.
  - `limit` integer, nullable: Containers to read per phantom. Defaults to 50.
  - `beforeEndedAt` integer, nullable: Epoch milliseconds: the nextBeforeEndedAt of a previous response, to read the next page.
  - `includeResultObject` boolean, nullable: Also return the shape of the result object of each phantom's most recent containers. Defaults to false.

## Response `200`

One result per phantom

- object
  - `results` object[], required
    - `agentId` string, required
    - `ok` boolean, required
    - `maxLimitReached` boolean: Present when ok is true. PhantomBuster's own page-cap flag, passed through: it is not set when the page stops at limit, so it does not say whether more containers exist - page on windowCovered instead.
    - `windowCovered` boolean: Present when ok is true. False when the page came back full (limit containers, or PhantomBuster's own cap) before reaching the lookback cutoff.
    - `nextBeforeEndedAt` integer: Present when windowCovered is false: send it as beforeEndedAt to read the next page.
    - `containers` object[]: Present when ok is true. Each container reduced to its shape.
    - `error` string: Present when ok is false.

## Other responses

- `401`: No valid token
- `403`: Caller lacks the phantombuster-monitor-read permission
- `422`: Invalid request
- `502`: social-platforms-api failed or answered without a list
- `504`: social-platforms-api did not answer within 60 seconds

---

[API](https://skmtc.dev/sponsorunited/apis/sponsorunited-api.md) - [All operations](https://skmtc.dev/sponsorunited/apis/sponsorunited-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sponsorunited/apis/sponsorunited-api/revisions/cbf1ca5bff8f?raw)
