Sessions

Returns the session with its status, tags, and credit usage. With computerId, the session is read from that computer, and status is running while its agent loop runs. This feature is enabled for selected organizations only.

get/api/v0/sessions/{sessionId}

Request

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

Path parameters

sessionId, string required

Session ID

Query parameters

computerId, string

Computer ID to query directly

includePinned, boolean

Set to true to add pinned to the answer: true when your pinned list holds this session, false when it does not.

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

GetSession200ResponseBody required
sessionId, string required

Session ID

parent_session_id, string

Immediate parent session ID for a Task subagent, if one exists

title, string

Session title

status, 'idle' | 'pending' | 'running' required

Current session execution status

messageCount, integer required

Number of messages in session

createdAt, integer required

Creation timestamp (Unix ms). Read from a computer with computerId, a single session reports its earliest message's creation time (the request time when it has no messages), and a list reports when the session file was created (its last update time when the computer did not record that)

updatedAt, integer required

Last update timestamp (Unix ms). Read from a computer with computerId, a single session reports its latest message's update time (the request time when it has no messages)

completedAt, integer

Completion timestamp (Unix ms)

computerId, string

The computer the session runs on: your computer on the session's host, otherwise the computer the session records. Absent when its host has none of your computers and it records none. Read from a computer with computerId, that computer

sessionSettings, object
tags, object[]

Session tags. A workstream carries a mission-v2 tag whose metadata has kind "orchestrator" and a missionId equal to its own sessionId; spaceId appears once its shared folder is attached

artifacts, object[]

Integration artifacts (pull requests, issues, pages) the session touched, oldest first

factoryCredits, number

Total Factory credits consumed by the session and its subagents

pinned, boolean

Pin preference reported by this operation. Present on a successful getSession response when includePinned=true, or on a successful updateSession response when its body supplied pinned. Absence means not reported, not unpinned.

Changes

    • info

      added the new optional query request parameter includePinned

    • info

      added the optional property pinned to the response with the status

    • info

      added the new optional header request parameter X-Factory-Org-Id

    26 more changes in this revision