Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.onlyfanskit.dev/llms.txt

Use this file to discover all available pages before exploring further.

Messaging spans two resources: chats (the conversation list) and messages (the contents of a thread).
// List recent chats
const chats = await of.chats.list({ limit: 20, order: "recent" });
const first = chats.list[0];

// Read a thread
const msgs = await of.messages.list(first.withUser.id, { limit: 30 });

// Send a message
await of.messages.send(first.withUser.id, { text: "Hi!" });

// Send a paid (PPV) message
await of.messages.send(first.withUser.id, {
  text: "Unlock πŸ‘€",
  mediaFiles: [/* vault media ids */],
  price: 15,
  lockedText: false,
});

Common operations

Want toCall
List conversationschats.list({ limit, order })
Read a threadmessages.list(userId, { limit })
Send a messagemessages.send(userId, { text, mediaFiles?, price? })
Search within a chatchats.searchMessages(userId, query)
Mark readmessages.markRead(userId) / chats.markRead(userId)
Delete a messagemessages.delete(userId, messageId)
React (like / pin)messages.like(...), messages.pin(...)
Unread / priority countschats.priorityCounts()
For sending to many fans at once, see Mass messaging.
Message ids are numeric, and user ids are the fan’s OnlyFans id. The full parameter shapes are documented inline in the SDK β€” point your editor at the messages and chats resources for JSDoc on each method.