Corsair
PluginsOura Ring

Oura Webhooks

All available Oura webhook events

The Oura plugin handles incoming webhook events from Oura. Webhooks are identified by the x-oura-signature header (HMAC-SHA256).

New to Corsair? Learn about webhooks, hooks, and multi-tenancy.

Full Implementation: See the Oura plugin source code.

Setup

app/api/webhook/route.ts
import { processWebhook } from "corsair";
import { corsair } from "@/server/corsair";

export async function POST(request: Request) {
    const headers = Object.fromEntries(request.headers);
    const body = await request.json();

    const result = await processWebhook(corsair, headers, body);
    return result.response;
}

Configure your webhook secret:

corsair.ts
oura({
    webhookSecret: process.env.OURA_WEBHOOK_SECRET, 
})

Available Webhooks

dailyActivity

summary.dailyActivity

Event Type: Daily Activity

Fires when a user's daily activity data is updated.

When it fires:

  • End of day activity summary is computed
  • Activity data is backfilled

Payload:

{
    event_type: "create" | "update",
    data_type: "daily_activity",
    object_id: "activity-id", 
    user_id: "user-id",
    timestamp: "2024-01-01T00:00:00Z",
}

Example Usage:

oura({
    webhookHooks: {
        summary: {
            dailyActivity: {
                after: async (ctx, result) => {
                    await inngest.send({
                        name: "oura/activity-updated",
                        data: {
                            tenantId: ctx.tenantId,
                            objectId: result.data.object_id,
                            userId: result.data.user_id,
                        },
                    });
                },
            },
        },
    },
})

Key Fields:

FieldTypeDescription
event_typestringcreate or update
data_typestringAlways daily_activity
object_idstringID of the activity record
user_idstringOura user ID

dailyReadiness

summary.dailyReadiness

Event Type: Daily Readiness

Fires when a user's daily readiness score is computed.

When it fires:

  • Daily readiness is calculated (typically after waking)

Payload:

{
    event_type: "create" | "update",
    data_type: "daily_readiness",
    object_id: "readiness-id", 
    user_id: "user-id",
    timestamp: "2024-01-01T08:00:00Z",
}

Key Fields:

FieldTypeDescription
event_typestringcreate or update
object_idstringID of the readiness record

dailySleep

summary.dailySleep

Event Type: Daily Sleep

Fires when a user's sleep data is processed.

When it fires:

  • Sleep session is processed and scored
  • Sleep data is backfilled

Payload:

{
    event_type: "create" | "update",
    data_type: "daily_sleep",
    object_id: "sleep-id", 
    user_id: "user-id",
    timestamp: "2024-01-01T07:00:00Z",
}

Key Fields:

FieldTypeDescription
event_typestringcreate or update
object_idstringID of the sleep record