{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "#/components/schemas/Session",
"title": "Session",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "This is the unique identifier for the session."
},
"orgId": {
"type": "string",
"description": "This is the unique identifier for the organization that owns this session."
},
"createdAt": {
"format": "date-time",
"type": "string",
"description": "This is the ISO 8601 timestamp indicating when the session was created."
},
"updatedAt": {
"format": "date-time",
"type": "string",
"description": "This is the ISO 8601 timestamp indicating when the session was last updated."
},
"cost": {
"type": "number",
"description": "This is the cost of the session in USD."
},
"costs": {
"type": "array",
"description": "These are the costs of individual components of the session in USD.",
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/ModelCost",
"title": "ModelCost"
},
{
"$ref": "#/components/schemas/AnalysisCost",
"title": "AnalysisCost"
},
{
"$ref": "#/components/schemas/SessionCost",
"title": "SessionCost"
}
]
}
},
"name": {
"type": "string",
"description": "This is a user-defined name for the session. Maximum length is 40 characters.",
"maxLength": 40
},
"status": {
"type": "string",
"description": "This is the current status of the session. Can be either 'active' or 'completed'.",
"enum": [
"active",
"completed"
]
},
"expirationSeconds": {
"type": "number",
"description": "Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.",
"minimum": 60,
"maximum": 2592000,
"example": 86400
},
"assistantId": {
"type": "string",
"description": "This is the ID of the assistant associated with this session. Use this when referencing an existing assistant."
},
"assistant": {
"description": "This is the assistant configuration for this session. Use this when creating a new assistant configuration.\nIf assistantId is provided, this will be ignored.",
"allOf": [
{
"$ref": "#/components/schemas/CreateAssistantDTO"
}
]
},
"assistantOverrides": {
"description": "These are the overrides for the assistant configuration.\nUse this to provide variable values and other overrides when using assistantId.\nVariable substitution will be applied to the assistant's messages and other text-based fields.",
"allOf": [
{
"$ref": "#/components/schemas/AssistantOverrides"
}
]
},
"squadId": {
"type": "string",
"description": "This is the squad ID associated with this session. Use this when referencing an existing squad."
},
"squad": {
"description": "This is the squad configuration for this session. Use this when creating a new squad configuration.\nIf squadId is provided, this will be ignored.",
"allOf": [
{
"$ref": "#/components/schemas/CreateSquadDTO"
}
]
},
"messages": {
"type": "array",
"description": "This is an array of chat messages in the session.",
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/SystemMessage",
"title": "SystemMessage"
},
{
"$ref": "#/components/schemas/UserMessage",
"title": "UserMessage"
},
{
"$ref": "#/components/schemas/AssistantMessage",
"title": "AssistantMessage"
},
{
"$ref": "#/components/schemas/ToolMessage",
"title": "ToolMessage"
},
{
"$ref": "#/components/schemas/DeveloperMessage",
"title": "DeveloperMessage"
}
]
}
},
"customer": {
"description": "This is the customer information associated with this session.",
"allOf": [
{
"$ref": "#/components/schemas/CreateCustomerDTO"
}
]
},
"customerId": {
"type": "string",
"description": "This is the customerId of the customer associated with this session."
},
"phoneNumberId": {
"type": "string",
"description": "This is the ID of the phone number associated with this session."
},
"phoneNumber": {
"description": "This is the phone number configuration for this session.",
"allOf": [
{
"$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO"
}
]
},
"artifact": {
"description": "These are the artifacts that were extracted from the session messages.\nThey are only available after the session has completed.\nThe artifact plan from the assistant or active assistant of squad is used to generate the artifact.\nCurrently the only supported fields of assistant artifact plan are:\n- structuredOutputIds",
"allOf": [
{
"$ref": "#/components/schemas/Artifact"
}
]
}
},
"required": [
"id",
"orgId",
"createdAt",
"updatedAt"
]
}