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

# End Event

> Close the active session when the show ends

End the event when the show is over. This marks the session as `ENDED` on the backend, stops new attendees from joining, and finalizes any usage tracking.

## Endpoint

```
POST /api/v1/runtime/events/{eventId}/end/client
```

**Auth:** `Authorization: Bearer <accessToken>` (your runtime client token)

| Path param | Description                                                          |
| ---------- | -------------------------------------------------------------------- |
| `eventId`  | The event ID returned by [Start Event](/sdk/runtime-api/start-event) |

No request body required.

## Response

```json theme={null}
{
  "eventId": "evt_xxxxxxxxxxxxxxxx",
  "status": "ENDED"
}
```

## Error responses

| Status | Code                                | Meaning                                                                  |
| ------ | ----------------------------------- | ------------------------------------------------------------------------ |
| `401`  | `INVALID_RUNTIME_CLIENT`            | Token missing or invalid                                                 |
| `403`  | `EVENT_NOT_AUTHORIZED_OR_NOT_FOUND` | Event not found, already ended, or this token isn't authorized to end it |

## When to call it

Call `end-event` when the operator signals the show is over — typically on a "Stop Show" button press, on `Event EndPlay`, or when a specific game show state is reached (e.g. scoreboard displayed).

```
Operator presses "End Show"
    ↓
HTTP POST /runtime/events/{eventId}/end/client
    ↓
Session marked ENDED — audience can no longer join
    ↓
Clean up local state (clear eventId variable)
```

<Warning>
  Always end events explicitly. Abandoned sessions (e.g. from a crash) will eventually time out on the backend, but calling end proactively ensures clean analytics and prevents the session from counting against your concurrency limit.
</Warning>

## Ending from the dashboard

If your visual crashes before it can call this endpoint, you can manually end the event from the xRLive dashboard under **Creator → Runtime Clients → Active Events**.
