---
description: Connect a RainFocus event to Onlit — the sessions endpoint and OAuth credentials, how each session time slot becomes an item, and the fields the feed must carry.
---

# RainFocus

The RainFocus integration imports sessions from a RainFocus sessions endpoint using
OAuth 2.0 client credentials. Create the event with **Add Event → API → RainFocus**;
rooms are matched by **code** (see [Room identity and renames](room_identity.md)). This
page covers the credentials, how session times become scheduled items, and what the feed
must contain.

## Event settings

| Field | Value |
| --- | --- |
| **API URL** | The RainFocus sessions endpoint for the event, exactly as RainFocus gives it to you; it is called as is |
| **API Username** | The OAuth **client ID** |
| **API Password** | The OAuth **client secret** |
| **Additional API Headers** | Sent with every data request, if the endpoint needs any |

The token endpoint is part of the installation's server configuration, not of the event:
Onlit requests a token there with the client ID and secret, caches it for the event, and
renews it before it expires. A rejected token is retried once with a fresh one before the
sync counts as failed.

## What is imported

The response's `data` array (or the whole response when there is no `data` wrapper) is
read as the list of sessions. A RainFocus session can have several **time slots** in its
`times` array; each slot becomes its own scheduled item, with the slot's fields laid over
the session's, so a session that runs twice appears twice on the schedule.

| Field | Taken from |
| --- | --- |
| `time_start`, `time_end` | the slot's `startTime` and `endTime`, in `yyyy/MM/dd HH:mm:ss`, read in the event's time zone |
| `title` | the session's `title` |
| `room` | the slot's or session's `room` — the name shown on signs |
| `roomId` | the slot's or session's `roomId` — the room identity |
| item identity | `sessionId~sessionTimeID`, so each slot keeps its own overrides across syncs |
| everything else | the session and slot fields as RainFocus returns them |

A slot without `title`, `room`, `roomId` or usable times is rejected as bad data and listed
in the [import history](import_history.md). Sessions are not filtered by their RainFocus
`status`; use an [item filter](item_filters.md) to skip, for example, canceled ones.

## Related

- [Syncing and API health](api_events.md)
- [API event settings](event_settings.md)
- [Item filters](item_filters.md)
- [Troubleshooting integrations](troubleshooting.md)
