Logo

Find or create conversation

POST
/conversations
/conversations

Request Body

application/jsonRequired

Conversation find or create

assistant_keystring

The unique identifier of the assistant.

user_idstring

The unique identifier of the user.

subject_idstring

The unique identifier of the subject.

recreateboolean

Indicates if the conversation should be recreated if it already exists.

contextobject

Contextual data associated with the conversation.

additional_dataobject

Additional data associated with the conversation.

titlestring

Title of the conversation.

Header Parameters

x-llm-key
Required
string

The API key for the LLM provider (e.g., OpenAI).

curl -X POST "https://example.com/conversations" \
  -H "x-llm-key: {{your_llm_provider_key}}" \
  -H "Content-Type: application/json" \
  -d '{
    "assistant_key": "string",
    "user_id": "string",
    "subject_id": "string",
    "recreate": true,
    "context": {},
    "additional_data": {},
    "title": "string"
  }'

Conversation created successfully

{
  "id": 0,
  "is_active": true,
  "user_id": "string",
  "subject_id": "string",
  "assistant_key": "string",
  "title": "string",
  "last_run": {
    "status": "initializing",
    "in_finite_state": true
  },
  "context": [
    {}
  ],
  "additional_data": [
    {}
  ],
  "error": {
    "message": "string"
  },
  "history": [
    {
      "role": "user",
      "run_status": "initializing",
      "messages": [
        {
          "id": "string",
          "content": "string"
        }
      ],
      "actions": [
        {
          "id": "string",
          "role": "tool",
          "content": "string",
          "status": "pending"
        }
      ]
    }
  ],
  "pendingItems": [
    {
      "role": "user",
      "run_status": "initializing",
      "messages": [
        {
          "id": "string",
          "content": "string"
        }
      ],
      "actions": [
        {
          "id": "string",
          "role": "tool",
          "content": "string",
          "status": "pending"
        }
      ]
    }
  ]
}