Skip to main content
POST
/
api
/
v2
/
tools
/
chatflows
Create a chatflow session
curl --request POST \
  --url https://paradigm.lighton.ai/api/v2/tools/chatflows/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "messages": "<string>",
  "model": "<string>",
  "tool": "<string>",
  "workspace_ids": [
    123
  ],
  "file_ids": [
    123
  ],
  "company_scope": true,
  "private_scope": true
}
'
{
  "id": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "feedback": {
    "id": 123,
    "created_at": "2023-11-07T05:31:56Z",
    "liked": true,
    "copied": true,
    "regenerated": true,
    "comment": "<string>",
    "feedbackCategories": [
      {}
    ]
  },
  "document_extracts": [
    {
      "id": 123,
      "created_at": "2023-11-07T05:31:56Z",
      "chat_response_id": 123,
      "document_id": 123,
      "page_start": 1073741823,
      "page_end": 4611686018427388000,
      "document_name": "<string>",
      "document_file_type": "<string>",
      "metadata": {},
      "document_external_url": "<string>",
      "document_datasource_name": "<string>",
      "document_workspace_name": "<string>",
      "text": "<string>"
    }
  ],
  "flag_created_at": "<string>",
  "tool_call": {
    "id": 123,
    "tool": {
      "id": 123,
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "name": "<string>",
      "class_name": "<string>",
      "description": "<string>",
      "is_offline_tool": true,
      "parameters": "<unknown>",
      "require_document": true,
      "enabled": true
    },
    "third_party_tool": {
      "id": 123,
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "name": "<string>",
      "description": "<string>",
      "enabled": true,
      "parameters": "<unknown>",
      "headers": "<string>",
      "openapi_schema_file": "<string>",
      "openapi_schema": "<unknown>",
      "base_url": "<string>",
      "endpoint_path": "<string>",
      "http_method": "get"
    },
    "tool_steps": [
      {}
    ],
    "created_at": "2023-11-07T05:31:56Z",
    "is_forced": true,
    "arguments": "<unknown>",
    "output": "<string>",
    "celery_task_id": "<string>",
    "third_party_tool_events": "<unknown>",
    "status": "pending"
  },
  "chat_message": 123,
  "text": "<string>",
  "error_message": "<string>",
  "completion": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "is_chosen": true,
  "source": "embeddings"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

Request serializer for creating a chatflow.

messages
string
required

List of messages for the chatflow conversation

model
string | null

Model to use for the chatflow, must exist and be configured from the admin

tool
string | null

Tool to use for the chatflow, must exist and be configured from the admin

workspace_ids
integer[]

List of workspace IDs whose documents will be added to scope

file_ids
integer[]

List of document IDs that will be added to scope

company_scope
boolean

Include documents from company scope

private_scope
boolean

Include documents from private scope

Response

id
integer
required
created_at
string<date-time>
required
feedback
object
required
document_extracts
object[]
required
flag_created_at
string | null
required
tool_call
object
required
chat_message
integer | null
text
string | null
error_message
string | null
completion
string<uuid> | null
is_chosen
boolean
source
enum<string>
  • embeddings - embeddings
  • corpus - corpus
Available options:
embeddings,
corpus