Objects

The Session object

Returned by Retrieve a session, Close a session.

Attributes

id string required
ses_…
object enum required
One of session
status enum required
closed takes no more messages. A deleted session returns 410. One of active, closed
phase enum required
discovery finds the form, intake asks its questions, ready offers actions. The user can keep talking in every phase. One of discovery, intake, ready
subject string · nullable required
Your reference for the end user, from Docgen-Subject.
form SessionForm object · nullable required
The identified form; null during discovery.
jurisdiction JurisdictionMatch object required
progress Progress object required
For a catalog form, total counts the questions that apply given the answers so far. For a custom form it is the AI interview's own estimate of its length, which may move by a question or so as it learns more; it is never below the questions already asked, and once the session is ready it equals answered.
pending_question Question object · nullable required
What the user is being asked now; null when nothing is. With steps, the first question of pending_step.
pending_step Step object · nullable required
The questions to show together now; null when nothing is being asked. Send them back in one message as answers.
actions array of Action objects required
What the user can do next. Empty until the session is ready. Ignore types you don't know.
outputs array of Output objects required
Everything made from this session, oldest first.
settings SessionSettings object required
livemode boolean required
metadata Metadata object
Up to 20 keys of your own, echoed back and shown in logs. Don't put personal data here.
created_at timestamp required
last_activity_at timestamp required
expires_at timestamp · nullable required
When the session is deleted automatically (7 days after it starts unless you asked for less). Null only on sessions from before lifetimes.