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

# Active sessions

> List users with open MOJA chat sessions before sending session messages.

MOJA session messages can only be sent to users with an **active session** — a conversation where the user has interacted with your business within the last **24 hours** (the WhatsApp 24-hour rule).

Use the **Get active sessions** endpoint to see who you can message right now.

***

## 24-hour session rule

Businesses may send free-form session messages only when the user has sent a message (or otherwise engaged) within the last 24 hours on that channel.

Outside that window, you must use an approved **WhatsApp template** via [Send template message](/api-reference/moja/send-template-message).

```text theme={null}
User messages your business
        │
        ▼
24-hour session opens
        │
        ▼
You can send session messages (POST /v1/chatapi)
        │
        ▼
After 24 hours of inactivity → use templates only
```

***

## Retrieve active sessions

Call `GET /v1/chatapi/active-users` to list active sessions for the authenticated vendor.

Each item includes:

| Field                 | Description                        |
| --------------------- | ---------------------------------- |
| `sesssion_start_time` | When the session started           |
| `channel`             | Channel type (e.g. `whatsapp`)     |
| `from_addr`           | User address you can reply to      |
| `username`            | Display name when available        |
| `last_message`        | Most recent message in the session |

<Info>
  The response field is spelled `sesssion_start_time` (three s) in the API — match this exactly when parsing.
</Info>

***

## Typical workflow

1. Call **Get active sessions** to find users you can message.
2. Use the `from_addr` value as the `to` field in [Send session message](/api-reference/moja/send-session-message).
3. Optionally set `callback_url` to receive inbound replies at your server.
