> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# Sessions

> A session in Open represents any interaction between a customer and your support team.

A session in Open represents any interaction between a customer and your support team. This could be a conversation with an AI agent, a human agent, or both working together to help the customer.

## What is a Session?

Think of a session as a complete conversation thread. It starts when a customer reaches out and ends when their inquiry is resolved. Each session can include:

* Messages between the customer and AI
* Messages between the customer and human agents
* Files and attachments
* System actions and responses
* Session metadata (duration, channel, status)

## Communication Channels

Sessions can happen through multiple channels:

<CardGroup>
  <Card title="Web Chat" icon="globe">
    Real-time chat through your website or app
  </Card>

  <Card title="Email" icon="envelope">
    Email conversations with threaded replies
  </Card>

  <Card title="SMS" icon="message">
    Text message conversations
  </Card>

  <Card title="Phone" icon="phone">
    Voice calls with transcription
  </Card>

  <Card title="WhatsApp" icon="whatsapp">
    WhatsApp Business conversations
  </Card>

  <Card title="Slack" icon="slack">
    Slack conversations
  </Card>

  <Card title="API" icon="code">
    API integrations
  </Card>
</CardGroup>

## How Sessions Work

1. **Session Start**

   * Customer initiates contact through any channel
   * System creates a new session
   * AI agent begins the conversation

2. **During the Session**

   * AI handles initial responses
   * Human agents can join when needed
   * Files and information can be shared
   * System actions can be triggered

3. **Session End**
   * Customer's inquiry is resolved
   * Session is marked as complete
   * Summary and insights are generated

## Session Custom Data

Use top-level `custom_data` on [Create Session](/api-reference/chat-sessions/create) or [Send Message](/api-reference/chat-sessions/send) for attributes that belong to the session, such as an order ID, cart value, or routing flag. Use `contact.custom_data` for attributes that belong to the contact, such as plan, region, or account tier.

Both can be sent in one request:

```json theme={"dark"}
{
  "sender": "contact",
  "custom_data": { "order_id": "ord_123", "priority": "high" },
  "contact": { "custom_data": { "plan": "pro" } },
  "message": { "type": "text", "text": "I need help with this order" }
}
```

## Available Endpoints

<CardGroup>
  <Card title="Create Session" icon="plus" href="/api-reference/chat-sessions/create">
    Start a new chat session
  </Card>

  <Card title="Get Session" icon="magnifying-glass" href="/api-reference/chat-sessions/get">
    Retrieve session details
  </Card>

  <Card title="List Sessions" icon="list" href="/api-reference/chat-sessions/list">
    View all sessions
  </Card>

  <Card title="Update Session" icon="pen" href="/api-reference/chat-sessions/update">
    Modify session information
  </Card>

  <Card title="Send Message" icon="paper-plane" href="/api-reference/chat-sessions/send">
    Send a message in a session
  </Card>

  <Card title="Session History" icon="list" href="/api-reference/chat-sessions/list_history">
    View session message history
  </Card>
</CardGroup>
