Back to API Documentation

Chat API

Real-time messaging and conversation management

Version
1.0.0
Base URL
ws://hyperion:9999/chat-api
Authentication
JWT Bearer Token

Endpoints

GET/api/v1/conversations

List all conversations for the current user

Parameters

limit
integer

Maximum number of conversations (default: 10)

offset
integer

Number of conversations to skip

Response

{
  "conversations": [
    {
      "id": "507f1f77bcf86cd799439011",
      "name": "Project Discussion",
      "participantIds": ["user123", "agent456"],
      "lastMessage": {
        "content": "Let's review the requirements",
        "timestamp": "2025-01-08T10:30:00Z"
      },
      "createdAt": "2025-01-07T09:00:00Z",
      "updatedAt": "2025-01-08T10:30:00Z"
    }
  ],
  "total": 42,
  "limit": 10,
  "offset": 0
}
POST/api/v1/conversations

Create a new conversation

Request Body

{
  "name": "New Project Discussion",
  "participantIds": ["user123", "agent456"]
}

Response

{
  "id": "507f1f77bcf86cd799439011",
  "name": "New Project Discussion",
  "participantIds": ["user123", "agent456"],
  "createdAt": "2025-01-08T11:00:00Z",
  "updatedAt": "2025-01-08T11:00:00Z"
}
GET/api/v1/conversations/{conversationId}

Get detailed information about a specific conversation

Parameters

conversationId
stringrequired

MongoDB ObjectID of the conversation

Response

{
  "id": "507f1f77bcf86cd799439011",
  "name": "Project Discussion",
  "participantIds": ["user123", "agent456"],
  "participants": [
    {
      "id": "user123",
      "name": "John Doe",
      "type": "human"
    },
    {
      "id": "agent456",
      "name": "AI Assistant",
      "type": "agent"
    }
  ],
  "messageCount": 127,
  "createdAt": "2025-01-07T09:00:00Z",
  "updatedAt": "2025-01-08T10:30:00Z"
}
DELETE/api/v1/conversations/{conversationId}

Delete a conversation permanently

Parameters

conversationId
stringrequired

MongoDB ObjectID of the conversation

Response

{
  "success": true,
  "message": "Conversation deleted successfully"
}