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

# Classroom API Integration

> Build a Kralis-branded Classroom client without bypassing event access, admission, attendance, or recording rules.

Kralis Classroom is available through authenticated GraphQL workflows. A custom client works with Kralis event IDs and permissions; it does not create public provider meeting links or require separate meeting accounts.

## Core concepts

| Concept                 | Meaning for a client                                                   |
| ----------------------- | ---------------------------------------------------------------------- |
| Classroom event         | The planned or instant classroom with schedule, audience, and settings |
| Classroom session       | One live run of the event                                              |
| Participant             | A Kralis user associated with the event and effective role             |
| Admission               | Waiting-room state controlling entry                                   |
| Presence and attendance | Server-calculated evidence from actual room joins and leaves           |
| Recording               | A session output with processing and publication state                 |
| Whiteboard              | An independently owned board optionally attached to an event           |

```mermaid theme={null}
stateDiagram-v2
    [*] --> DiscoverEvent
    DiscoverEvent --> RequestAdmission: Waiting room applies
    DiscoverEvent --> RequestJoin: Bypass or no waiting room
    RequestAdmission --> Waiting
    Waiting --> RequestJoin: Admitted
    Waiting --> Rejected: Rejected
    RequestJoin --> LiveRoom: Join credentials issued
    LiveRoom --> Review: Leave or event ends
    Review --> [*]
```

## Recommended join flow

1. Query an event visible to the signed-in user.
2. Display schedule, access state, media defaults, and recording notice.
3. Request admission when the waiting room requires it.
4. Observe admission state instead of repeatedly submitting requests.
5. Acknowledge the recording notice when required.
6. Request short-lived join credentials through Kralis GraphQL.
7. Connect using only the returned room information and permissions.
8. Return to Kralis event history after leaving.

```mermaid theme={null}
sequenceDiagram
    participant C as Custom client
    participant K as Kralis API
    participant R as Realtime room
    C->>K: Query visible event
    C->>K: Request admission if required
    K-->>C: Pending, admitted, or rejected
    C->>K: Request join credentials
    K-->>C: Short-lived scoped credentials
    C->>R: Connect
    R-->>K: Authoritative join/leave evidence
    C->>K: Query attendance, sessions, and published recordings
```

## Roles and moderation

Render actions from the effective event role and current settings. A host or moderator may receive management actions; an ordinary participant does not. Always handle a rejected mutation because roles or live permissions can change after the screen was loaded.

## Chat, hand state, and presentation

Use documented Classroom GraphQL operations for application state. Do not invent a parallel chat, admission, or attendance system and expect it to appear in Kralis history.

## Recordings

Ordinary participants should see only recordings the API exposes to them. Managers can receive processing, failed, ready, published, and deleted states according to authorization. Never expose a playback URL beyond its intended user or assume it is permanent.

## Whiteboards

Whiteboards can exist without an event. A client may list boards available to the user and attach or open them through documented operations. Editing access and live-view behavior remain subject to current Kralis permissions.

<Warning>
  Do not embed infrastructure credentials, construct realtime room names, or bypass Kralis admission with arbitrary meeting links. Always request access and room credentials through authenticated Kralis operations.
</Warning>

Use [GraphiQL](https://api.kralis.app/graphiql/) to inspect the current `classroom` queries, mutations, inputs, connection fields, and responses.
