BetterFans Link SDK — OnlyFans APIBetterFans Link SDK
API Reference

Messages

Send OnlyFans messages programmatically — DMs, mass messages, PPV (pay-per-view), media attachments, and message queue management via the BetterFans Link SDK, the infrastructure behind OFManager.

Message routes handle sending DMs, managing the mass-message queue, liking/unliking messages, and deleting messages.

The API expects message and post text as HTML, not plaintext. The SDK exports a markdownToHtml utility that converts markdown to the format the API requires.

import { markdownToHtml } from "@betterfans/link-sdk/utils"

markdownToHtml("**Bold** and *italic*")
// → <p><strong>Bold</strong> and <em>italic</em></p>

Send a message

Send a direct message to a user within a chat:

import { markdownToHtml } from "@betterfans/link-sdk/utils"

const [error, message] = await account.request(
  "POST /chats/:id/messages",
  {
    pathParams: { id: "98765" },
    body: {
      text: markdownToHtml("Thanks for subscribing!"),
    },
  },
)

if (!error) {
  console.log("Sent message:", message.id)
}

Send with media

Attach media to a message by including media IDs:

const [error, message] = await account.request(
  "POST /chats/:id/messages",
  {
    pathParams: { id: "98765" },
    body: {
      text: markdownToHtml("Check this out"),
      mediaFiles: [mediaId1, mediaId2],
    },
  },
)

Send a pay-per-view message

Set a price to create a PPV message:

const [error, message] = await account.request(
  "POST /chats/:id/messages",
  {
    pathParams: { id: "98765" },
    body: {
      text: markdownToHtml("Exclusive content"),
      mediaFiles: [mediaId],
      price: 15,
    },
  },
)

Mass-message queue

The queue system lets you send messages to many users at once. The server processes them asynchronously.

Create a queued message

const [error, queue] = await account.request(
  "POST /messages/queue",
  {
    body: {
      text: markdownToHtml("New content dropping tonight"),
      mediaFiles: [mediaId],
      userLists: [listId],
    },
  },
)

if (!error) {
  console.log("Queue ID:", queue.id, "Status:", queue.status)
}

Check queue status

const [error, queues] = await account.request(
  "GET /messages/queue",
  { query: { limit: 10 } },
)

if (!error) {
  for (const q of queues.list) {
    console.log(q.id, q.status, `${q.sentCount}/${q.totalCount}`)
  }
}

Update a queued message

Modify a queued message before it's fully sent:

const [error] = await account.request(
  "PUT /messages/queue/:id",
  {
    pathParams: { id: "12345" },
    body: { text: markdownToHtml("Updated message text") },
  },
)

Cancel a queued message

const [error] = await account.request(
  "DELETE /messages/queue/:id",
  {
    pathParams: { id: "12345" },
  },
)

Message interactions

Like a message

const [error] = await account.request(
  "POST /messages/:id/like",
  { pathParams: { id: "55555" } },
)

Unlike a message

const [error] = await account.request(
  "DELETE /messages/:id/like",
  { pathParams: { id: "55555" } },
)

Delete a message

const [error] = await account.request(
  "DELETE /messages/:id",
  { pathParams: { id: "55555" } },
)

On this page