# Live Users

Live user / active session endpoints

## Get live user counts per script

> Returns active session counts grouped by script ID for all scripts owned by the authenticated user.

```json
{"openapi":"3.0.3","info":{"title":"Junkie Key System REST API v2","version":"2.0.0"},"tags":[{"name":"Live Users","description":"Live user / active session endpoints"}],"servers":[{"url":"https://api.jnkie.com/api/v2","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API Key with rest-api:* scope"}}},"paths":{"/live-users":{"get":{"summary":"Get live user counts per script","description":"Returns active session counts grouped by script ID for all scripts owned by the authenticated user.","tags":["Live Users"],"responses":{"200":{"description":"Live user counts","content":{"application/json":{"schema":{"type":"object","properties":{"counts":{"type":"object","additionalProperties":{"type":"integer"},"description":"Map of scriptId → active session count"},"total":{"type":"integer","description":"Total active sessions across all scripts"}}}}}},"401":{"description":"Unauthorized"},"429":{"description":"Rate limit exceeded"},"502":{"description":"Heartbeat service unavailable"}}}}}}
```

## List active sessions for a script

> Returns paginated list of currently active live users for a specific script. Only accessible by the script owner.

```json
{"openapi":"3.0.3","info":{"title":"Junkie Key System REST API v2","version":"2.0.0"},"tags":[{"name":"Live Users","description":"Live user / active session endpoints"}],"servers":[{"url":"https://api.jnkie.com/api/v2","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API Key with rest-api:* scope"}},"schemas":{"LiveSession":{"type":"object","properties":{"sessionId":{"type":"string","description":"Unique session identifier"},"robloxUsername":{"type":"string"},"robloxJobId":{"type":"string","description":"Roblox server job ID"},"placeId":{"type":"string","description":"Roblox place ID"},"hwid":{"type":"string"},"beatCount":{"type":"integer","description":"Number of heartbeats received in this session"},"created":{"type":"integer","format":"int64","description":"Unix timestamp (ms) when the session was created"},"lastBeat":{"type":"integer","format":"int64","description":"Unix timestamp (ms) of the most recent heartbeat"}}}}},"paths":{"/live-users/{scriptId}":{"get":{"summary":"List active sessions for a script","description":"Returns paginated list of currently active live users for a specific script. Only accessible by the script owner.","tags":["Live Users"],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}},{"name":"search","in":"query","schema":{"type":"string"},"description":"Filter by Roblox username (partial match, case-insensitive)"}],"responses":{"200":{"description":"Active sessions","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/LiveSession"}},"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"totalPages":{"type":"integer"}}}}}},"401":{"description":"Unauthorized"},"404":{"description":"Script not found or access denied"},"429":{"description":"Rate limit exceeded"},"502":{"description":"Heartbeat service unavailable"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jnkie.com/rest-api/live-users.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
