Sessions

List a session's child sessions

Changed on

Returns the caller's sessions spawned under one parent session (Task subagents, mission agents) with their last reported status and the state of the computer each runs on, oldest first. A member of a shared workstream lists the agents under it they are a member of instead. Computer details are only included for computers the caller owns. Artifacts are included only when includeArtifacts=true; what each session is waiting on only when includeAttention=true; token usage and Factory Standard Credits, rolled up with each session's Task subagents, only when includeUsage=true. Archived sessions are left out unless includeArchived=true, which lists them with archivedAt and sets archivedIncluded on the response. For enterprise organizations, usage.tokenCountsScope is byok_only and token counts cover only calls the client reported as made with the organization's own provider keys (BYOK); managed-inference calls, and usage reported before clients tagged BYOK calls, count as zero. Credits always cover every call.

get/api/v0/sessions/{sessionId}/children

Request

  • Base URL
    https://api.factory.ai
  • Auth
    HTTP bearer

Path parameters

sessionId, string required

The parent session id

Query parameters

includeArtifacts, boolean

Whether to include each child session’s integration artifacts (pull requests, issues, pages).

includeAttention, boolean

Whether to include what each child session is waiting on (a permission prompt or a question).

includeUsage, boolean

Whether to include each child session’s token usage and Factory Standard Credits, rolled up with its Task subagents.

includeArchived, boolean

Whether to include archived child sessions, such as a mission agent whose computer was reclaimed, each with its archivedAt. The response sets archivedIncluded when it does.

Headers

X-Factory-Org-Id, string

Organization a JWT request acts in; required to act in a sub-organization. Without it, the request acts in the user's root organization, or is rejected with 403 when the user cannot access the root organization. API keys always act in their own organization and ignore this header.

Response

Response for status 200

ListChildSessions200ResponseBody required
sessions, object[] required
archivedIncluded, true

Present when the list includes archived child sessions, as includeArchived=true asks for

Changes

    • breaking

      the sessions/items/artifacts/items/externalId response property's maxLength was unset from 128 for the response status

    • breaking

      the sessions/items/artifacts/items/id response property's maxLength was unset from 2048 for the response status

    • breaking

      the sessions/items/artifacts/items/title response property's maxLength was unset from 500 for the response status

    1 more change in this revision