Skip to main content
The Realtime API delivers webhook events to your server when connections change or system events occur. Use it to react immediately without polling.

Quick Reference

TypeDeliveryPurpose
Connection eventsWebhookTrack connection creation, updates, and expiry
System eventsWebhookGet notified when Dynamic Rules change

Configuration

Configure Realtime in the OFAuth Dashboard:
  • Set your webhook endpoint URL
  • Choose which events to subscribe to
  • Review delivery history and failures

Connections Guide

Learn how to store and manage connection IDs

Error Handling

Handle delivery failures and retries

Event Types

Connection Events

EventTrigger
connection.createdA new connection is established
connection.updatedConnection details change, such as permissions after reconnection
connection.expiredA connection expires naturally or is invalidated via API

System Events

EventTrigger
rules.updatedDynamic Rules signing requirements changed

Beta

EventTrigger
of.websocket.event.receivedOFAuth relays an upstream OnlyFans websocket message through Realtime
OnlyFans Events are currently in beta. The top-level event type is stable, but the nested payload shapes may expand or be refined as we document more upstream websocket messages.

Payload Format

All connection events share the same general payload shape:
{
  "type": "connection.created",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "clientReferenceId": "user_456",
    "connection": {
      "id": "conn_abc123",
      "status": "active"
    }
  }
}

connection.created

{
  "type": "connection.created",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "clientReferenceId": "user_456",
    "connection": {
      "id": "conn_abc123",
      "status": "active",
      "permissions": ["profile:read", "posts:read"],
      "userData": {
        "id": "of_user_456",
        "name": "Jane Doe",
        "username": "janedoe",
        "avatar": "https://cdn.onlyfans.com/avatar.jpg"
      }
    }
  }
}

connection.updated

{
  "type": "connection.updated",
  "timestamp": "2024-01-15T11:00:00Z",
  "data": {
    "clientReferenceId": "user_456",
    "connection": {
      "id": "conn_abc123",
      "status": "active",
      "permissions": ["profile:read", "posts:read", "messages:read"],
      "userData": {
        "id": "of_user_456",
        "name": "Jane Doe",
        "username": "janedoe",
        "avatar": "https://cdn.onlyfans.com/avatar.jpg"
      }
    }
  }
}

connection.expired

{
  "type": "connection.expired",
  "timestamp": "2024-01-15T12:00:00Z",
  "data": {
    "clientReferenceId": "user_456",
    "connection": {
      "id": "conn_abc123",
      "status": "expired"
    }
  }
}
The connection.created event is the recommended way to receive connection IDs. Use data.clientReferenceId, which you provided when initializing Link, to map the connection to the correct user in your database.

Delivery & Retries

  • Retry policy: exponential backoff with up to 5 attempts
  • Timeout: 10 seconds per request
  • Ordering: in-order delivery per connection ID
Your endpoint should return a 2xx response within 10 seconds.

Signature Verification

Every Realtime delivery includes an OFAuth-Signature header:
OFAuth-Signature: t=1234567890,v1=abc123...
Verify requests by:
  1. Extracting the timestamp (t) and signature (v1)
  2. Rejecting requests older than 5 minutes
  3. Computing an HMAC-SHA256 of {timestamp}.{raw_body} using your signing secret
  4. Comparing the expected signature with a constant-time comparison

Implementation Checklist

  1. Parse the application/json body
  2. Verify the signature before processing
  3. Route the event by type
  4. Return 2xx within 10 seconds
  5. Make handlers idempotent by storing processed event IDs

Troubleshooting

Ensure your endpoint is publicly reachable and returns a 2xx response within 10 seconds.
Verify the endpoint URL and selected subscriptions in the Dashboard.
Use the raw request body, not the parsed JSON body, and confirm the signing secret matches your Dashboard configuration.

Next Steps

Link API

Create sessions that produce connection IDs

Access API

Use connection IDs to read and write OnlyFans data

OnlyFans Events Beta

Overview of the websocket relay and Svix delivery model