Chat Sessions

A ChatSession represents one conversation with the Files.com AI Assistant.

List Chat Sessions

Endpoint

GET/chat_sessions

Return Object

ChatSession[]

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

curl https://app.files.com/api/rest/v1/chat_sessions.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": "example",
    "title": "example",
    "user_id": 1,
    "ai_task_id": 1,
    "workspace_id": 1,
    "last_active_at": "2000-01-01T01:00:00Z",
    "created_at": "2000-01-01T01:00:00Z",
    "messages": [
      {
        "id": 1,
        "role": "example",
        "content": "example",
        "created_at": "2000-01-01T01:00:00Z"
      }
    ]
  }
]

Show Chat Session

Endpoint

GET/chat_sessions/{id}

Return Object

ChatSession

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Request Parameters

ParameterDescription
id
string
Required
Chat Session ID.

Example Request

curl https://app.files.com/api/rest/v1/chat_sessions/{id}.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": "example",
  "title": "example",
  "user_id": 1,
  "ai_task_id": 1,
  "workspace_id": 1,
  "last_active_at": "2000-01-01T01:00:00Z",
  "created_at": "2000-01-01T01:00:00Z",
  "messages": [
    {
      "id": 1,
      "role": "example",
      "content": "example",
      "created_at": "2000-01-01T01:00:00Z"
    }
  ]
}

The ChatSession Object

Some of the endpoints above return a ChatSession object. The attributes of this object are listed below.

AttributeDescription
id
string
Chat Session ID.
title
string
Short AI-generated chat title.
user_id
int64
User ID.
ai_task_id
int64
AI Task ID. Present when the conversation was started by an AI Task.
workspace_id
int64
Workspace ID. 0 means the default workspace.
last_active_at
date-time
Most recent chat activity date/time.
created_at
date-time
Chat session creation date/time.
messages
array(object)
Visible conversation messages in this chat session. For performance reasons, this is not provided when listing chat sessions.

Example ChatSession Object

{
  "id": "example",
  "title": "example",
  "user_id": 1,
  "ai_task_id": 1,
  "workspace_id": 1,
  "last_active_at": "2000-01-01T01:00:00Z",
  "created_at": "2000-01-01T01:00:00Z",
  "messages": [
    {
      "id": 1,
      "role": "example",
      "content": "example",
      "created_at": "2000-01-01T01:00:00Z"
    }
  ]
}