MarketIntell

Sessions API

Manage conversation sessions and message history

Sessions API

Sessions group related messages into conversations. Each call to the Chat API creates or continues a session. Use the Sessions API to list, inspect, and delete sessions.


GET /v1/sessions

List all sessions for the authenticated user.

Request

curl https://api.marketintell.ai/v1/sessions \
  -H "X-API-Key: YOUR_API_KEY"

Response

{
  "success": true,
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "created_at": "2025-01-15T10:00:00.000Z",
      "updated_at": "2025-01-15T10:05:00.000Z",
      "message_count": 4,
      "last_message_preview": "What about the short-term outlook?"
    },
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
      "created_at": "2025-01-14T08:30:00.000Z",
      "updated_at": "2025-01-14T08:32:00.000Z",
      "message_count": 2,
      "last_message_preview": "Give me a trade setup for SOL"
    }
  ]
}

GET /v1/sessions/:id/messages

Retrieve all messages in a session.

Path Parameters

ParameterTypeDescription
idstring (UUID)The session ID

Request

curl https://api.marketintell.ai/v1/sessions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/messages \
  -H "X-API-Key: YOUR_API_KEY"

Response

{
  "success": true,
  "data": [
    {
      "role": "user",
      "content": "What is the risk/reward for a long ETH position?",
      "timestamp": "2025-01-15T10:00:00.000Z"
    },
    {
      "role": "assistant",
      "content": "## ETH Long Position Risk/Reward Analysis\n\n...",
      "timestamp": "2025-01-15T10:00:04.000Z",
      "classification": {
        "specialists": ["technical", "fundamental", "quantitative"],
        "tokens": ["ETH"],
        "timeframe": "medium",
        "intent": "trade_setup"
      }
    },
    {
      "role": "user",
      "content": "What about the short-term outlook?",
      "timestamp": "2025-01-15T10:05:00.000Z"
    },
    {
      "role": "assistant",
      "content": "## Short-Term ETH Outlook\n\n...",
      "timestamp": "2025-01-15T10:05:03.000Z",
      "classification": {
        "specialists": ["technical", "sentiment"],
        "tokens": ["ETH"],
        "timeframe": "short",
        "intent": "price_analysis"
      }
    }
  ]
}

DELETE /v1/sessions/:id

Delete a session and all its messages.

Path Parameters

ParameterTypeDescription
idstring (UUID)The session ID

Request

curl -X DELETE https://api.marketintell.ai/v1/sessions/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "X-API-Key: YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "deleted": true
  }
}

Deleting a session is permanent and cannot be undone.

On this page