In this guide, I’ll show you how to auto-sync sleep entries from Oura to Google Calendar. Every morning, the automation will create an event with last night’s key sleep metrics, such as resting HR, HRV, and time spent per sleep stage. Luckily, Oura exposes an open API so connecting it to a calendar through Zapier is straightforward. I use Google Calendar, but any alternative that has a Zapier integration or an API should work. Building this automation will require an Oura ring, a paid Zapier plan, and about 30 mins.
Note: one limitation of this setup is that if analyzed sleep data doesn’t get synced within 4h, then the Zap can miss it, causing the sleep period to be omitted from the calendar. This can happen if your ring is in offline mode or if you don’t open the app within a few hours after wake up. In this case, you can hardcode lastNight.add_to_calendar = true in the zap to manually add the missing entry. This aspect could be improved down the line.
- A “Filter by Zapier” action to only continue if a new sleep event should be created in the calendar.
- A “Find or Create Event in Google Calendar” action to create the actual event. This action will first search for the sleep event and only create it if it doesn’t exist yet. This is to make sure that only one event is created even if the Zap runs multiple times (eg. twice within the 4m time limit assuming a professional plan).
- Generate an access token on Oura Developer under “Personal Access Tokens.” You’ll need it for the next step. Add a note “oura_google_calendar_zap” or similar.
- For the trigger, use the code from this gist.
2. Action: Only continue if…
- Select “Filter by Zapier” as the app.
- For the criteria, select “Add To Calendar” and “(Boolean) is true”.
3. Action: Find or Create Event in Google Calendar
- Select “Google Calendar” as the app.
- Select “Find Event” as the action event.
- Select the account and calendar you’ll want to use.
- For the Search Term, enter “💤💤💤”.
- For Start Time, select “Bedtime Start” from the trigger.
- Leave End Time blank.
- Check “Create Google Calendar Detailed Event if it doesn’t exist yet?”
- For the new event, set Start Date & Time to “Bedtime Start” from the trigger and End Date & Time to “Bedtime End”.
- For the Summary, enter “💤💤💤” or your title of choice.
- Select a Color for the new event. I used ■ #7AE7BF which looked nice in Google Calendar.
- Fill out the description to include sleep metrics. Oura’s API doc describes the returned metrics so you can add more if you want. Here’s my version:
After this, test your Zap for one or two sleep entries and it should be ready to go. You're done.