Automate OnlyFans Chat with Webhooks and Real-Time Messaging API
Get webhooks the instant a fan messages. Auto-respond, send PPV, trigger welcome sequences, and manage chat at scale — all via API. Build the chatting automation your agency needs.
How Chat Automation Works
Webhooks deliver fan messages to your server in real time. Your AI or rule engine processes them, then responds via the API — in seconds.
Real Webhook-Driven Chat Automation Use Cases
Each use case shows the webhook trigger and the API call to make. Build AI chatbots, welcome sequences, and upsell flows.
Auto-Respond to New Messages
When a fan sends a message, your webhook fires instantly. Route the message to your AI chatbot or rule engine and respond within seconds.
Fires on every incoming fan message with full content and media
Send a reply message — text, media, or PPV
Welcome New Subscribers Automatically
Trigger a welcome message sequence when a fan subscribes. Send a greeting, then follow up with PPV content on a schedule.
Fires when a fan initiates a new subscription
Send the welcome message with optional media
PPV Upsell on Tip Events
When a fan sends a tip, automatically follow up with exclusive PPV content — they already showed buying intent.
Fires when a fan sends a tip with gross/net amounts
Send a PPV message with price and media attachment
Show Typing Indicators
Make automated responses feel human. Trigger typing indicators before sending replies for a natural conversation flow.
Fires when a fan starts typing — know when to engage
Show typing indicator in the chat
Search and Analyze Chat History
Search through chat messages to find keywords, analyze conversation patterns, and extract insights for your AI models.
Build a real-time message index as messages arrive
Search messages within a specific chat
Track Chat-Driven Revenue
Monitor which automated conversations drive the most PPV unlocks and tips. Optimize your chat flows for maximum revenue.
Fires when a fan unlocks PPV — attribute to chat flow
Get direct message engagement and revenue stats
Production-Ready Code Examples
Webhook handlers for auto-responding, welcome sequences, and tip-based upsells. Copy into your project and customize.
Listen for incoming messages via webhook, process with your AI chatbot, show typing indicator, then respond.
// Webhook handler: messages.received
app.post('/webhooks/onlyfans', async (req, res) => {
const { event, account_id, payload } = req.body;
if (event === 'messages.received') {
// payload.fromUser = sender profile with subscription info
// payload.text = message content (HTML)
// payload.fanData.spending = fan's lifetime spend
const { fromUser, text, fanData } = payload;
// Skip if message is from the creator (outgoing)
if (fromUser.isPerformer) return res.sendStatus(200);
// Generate AI response (your chatbot logic)
const aiReply = await yourAIChatbot.generateReply({
message: text,
fanName: fromUser.name,
fanSpend: fanData.spending.total,
});
// Show typing indicator for natural feel
await fetch(
'https://app.onlyfansapi.com/api/' + account_id + '/chats/' + fromUser.id + '/typing',
{
method: 'POST',
headers: {
'Authorization': 'Bearer sk_your_api_key',
'Content-Type': 'application/json'
}
}
);
// Wait 2-4 seconds to simulate typing
await new Promise(r => setTimeout(r, 2000 + Math.random() * 2000));
// Send the reply
await fetch(
'https://app.onlyfansapi.com/api/' + account_id + '/chats/' + fromUser.id + '/messages',
{
method: 'POST',
headers: {
'Authorization': 'Bearer sk_your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({ text: aiReply })
}
);
}
res.sendStatus(200);
});Available Endpoints and Webhooks
Every endpoint and webhook event for chat automation. Full documentation at docs.onlyfansapi.com.
APIEndpoints
/api/{account}/chatsList all chats with fans
/api/{account}/chats/{chat_id}/messagesList messages in a chat
/api/{account}/chats/{chat_id}/messagesSend a message — text, media, or PPV
/api/{account}/chats/{chat_id}/messages/searchSearch messages in a chat
/api/{account}/chats/{chat_id}/typingShow typing indicator
/api/{account}/chats/{chat_id}/mark-as-readMark chat as read
/api/{account}/chats/mark-as-readMark all chats as read
/api/{account}/chats/{chat_id}/mediaList media in a chat
/api/{account}/media/uploadUpload media for messages
/api/{account}/chats/{chat_id}/messages/{id}Delete a message
/api/{account}/chats/{chat_id}/messages/{id}/likeLike a message
/api/{account}/chats/{chat_id}/messages/{id}/pinPin a message
/api/{account}/engagement/messages/direct-messagesDM engagement stats
/api/{account}/engagement/messages/direct-messages/chartDM engagement chart data
WHWebhook Events
messages.receivedNew incoming message from a fan — includes full content, media, and sender data
messages.sentOutgoing message sent to a fan — confirms delivery with message details
messages.ppv.unlockedFan purchases a paid message — includes amount and fan spending history
messages.deletedA chat message was deleted — includes message ID
tips.receivedFan sends a tip — trigger upsell flows with gross/net amounts
users.typingFan is typing a message — know when to engage or prepare a response
subscriptions.newNew subscriber — trigger welcome message sequences
OnlyFans Chatting Automation — Frequently Asked Questions
Common questions about automating OnlyFans chat with webhooks and API.
Every Unanswered Message Is a Missed Sale.
Start free. Automate your first chat flow in minutes.