ai DocgenDocs
Get API key
OverviewGuidesAPI reference
API reference
IntroductionAuthenticationErrorsStreaming
Sessions
POSTStart a sessionPOSTSend a messageGETRetrieve a sessionGETList a subject's sessionsGETList messagesGETRetrieve the answersPOSTClose a sessionDELDelete a sessionPOSTExchange a launch code
Documents
POSTCreate a documentGETRetrieve a documentGETStream eventsGETDownload a file
Usage
GETUsage for your organisation
Objects
SessionTurnMessageQuestionActionAnswersDocumentUsageError
Objects

The Turn object

Returned by Start a session, Send a message.

Attributes

object enum required
One of turn
input Message object · nullable required
The user's message; null when the turn started without one.
reply Message object required
session Session object required
The Turn object
{  "object": "turn",  "input": {    "id": "msg_01JBA2M8K3Q4R5S6T7V8W9X0YA",    "object": "message",    "role": "user",    "status": "completed",    "text": "I need a residential lease for my condo in Miami, Florida",    "question": null,    "answer": null,    "created_at": "2026-10-09T10:41:02Z"  },  "reply": {    "id": "msg_01JBA2M8K3Q4R5S6T7V8W9X0YB",    "object": "message",    "role": "assistant",    "status": "completed",    "text": "It sounds like you need a Residential Lease Agreement. Is that right?",    "question": {      "id": "form",      "type": "form",      "section": "Document",      "title": "It sounds like you need a Residential Lease Agreement. Is that right?",      "help": "Pick the document, or tell us more if it's something else.",      "options": [        {          "value": "tpl_01JAZ7RKQ3M8D2X5V9T4N6P0CE",          "label": "Residential Lease Agreement"        },        {          "value": "other",          "label": "Something else"        }      ],      "allow_unknown": false    },    "answer": null,    "created_at": "2026-10-09T10:41:02Z"  },  "session": {    "id": "ses_01JBA2M8K3Q4R5S6T7V8W9X0YZ",    "object": "session",    "status": "active",    "phase": "discovery",    "subject": "wp_user:48213",    "form": null,    "jurisdiction": {      "code": "US-FL",      "source": "detected"    },    "progress": {      "answered": 0,      "total": 0    },    "pending_question": {      "id": "form",      "type": "form",      "section": "Document",      "title": "It sounds like you need a Residential Lease Agreement. Is that right?",      "help": "Pick the document, or tell us more if it's something else.",      "options": [        {          "value": "tpl_01JAZ7RKQ3M8D2X5V9T4N6P0CE",          "label": "Residential Lease Agreement"        },        {          "value": "other",          "label": "Something else"        }      ],      "allow_unknown": false    },    "actions": [],    "outputs": [],    "settings": {      "max_questions": 15,      "confirm_form": true    },    "livemode": false,    "created_at": "2026-10-09T10:41:02Z",    "last_activity_at": "2026-10-09T10:41:02Z",    "expires_at": "2026-10-16T10:41:02Z"  }}

AiLawyer is not a law firm. Documents generated through the API are not legal advice and don't create an attorney-client relationship. Your product should tell its users the same.

Quickstart API reference Errors