Skip to main content

What You Can Build

  • AI Chatbots: Automated fan interactions and response management
  • CRM Systems: Message history, conversation tracking, fan engagement tools
  • Mass Messaging: Send promotions, updates, or PPV content to multiple fans
  • Chat Analytics: Message volume, response times, engagement metrics

Quick Example

Send a message to a fan:
const response = await fetch("https://api.ofauth.com/v2/access/chats/123456/messages", {
  method: "POST",
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    text: "Hey! Thanks for subscribing 💕"
  })
})

const message = await response.json()
console.log("Message sent:", message.id)

Common Operations

List Chats

Get a list of all conversations:
const response = await fetch("https://api.ofauth.com/v2/access/chats?" + new URLSearchParams({
  limit: "10",
  offset: "0",
  order: "recent"  // "recent" | "old"
}), {
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

const chats = await response.json()
// Returns array of chat objects with last message, fan info, etc.

Filter Chats

// Priority chats only
const priority = await fetch(
  "https://api.ofauth.com/v2/access/chats?filter=priority",
  { headers }
)

// Unread chats
const unread = await fetch(
  "https://api.ofauth.com/v2/access/chats?filter=unread",
  { headers }
)

// Fans who tipped
const tippers = await fetch(
  "https://api.ofauth.com/v2/access/chats?filter=who_tipped",
  { headers }
)

Get Chat Messages

Fetch messages from a specific conversation:
const response = await fetch("https://api.ofauth.com/v2/access/chats/123456/messages?" + new URLSearchParams({
  limit: "20",
  offset: "0"
}), {
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

const messages = await response.json()

Send Message with Media

Include images or videos in your message:
const response = await fetch("https://api.ofauth.com/v2/access/chats/123456/messages", {
  method: "POST",
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    text: "Check this out! 🔥",
    mediaItems: [789, 790] // Media IDs from vault
  })
})

Send PPV Message

Send pay-per-view content:
const response = await fetch("https://api.ofauth.com/v2/access/chats/123456/messages", {
  method: "POST",
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    text: "Exclusive content just for you 💋",
    mediaItems: [789],
    price: 9.99,  // $3-$200
    previewMediaCount: 1  // Number of preview items
  })
})

Unsend a Message

Delete a sent message:
const response = await fetch("https://api.ofauth.com/v2/access/messages/MESSAGE_ID", {
  method: "DELETE",
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    withUserId: 123456  // The user ID from the chat
  })
})

Mass Messaging (Queue)

Send to multiple fans at once using the message queue:

Create Queued Message

const response = await fetch("https://api.ofauth.com/v2/access/messages/queue", {
  method: "POST",
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    text: "New content dropping tomorrow! 🎉",
    userIds: [123, 456, 789],
    // Or target by lists:
    // userLists: [1, 2, 3],
    // excludeUserLists: [4, 5]  // Exclude specific lists
  })
})

Schedule Mass Message

const response = await fetch("https://api.ofauth.com/v2/access/messages/queue", {
  method: "POST",
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    text: "Scheduled announcement! 📅",
    userLists: [1],
    scheduledDate: "2024-12-25T12:00:00Z"
  })
})

Get Queue Stats

View mass message history:
const response = await fetch("https://api.ofauth.com/v2/access/messages/queue/stats?" + new URLSearchParams({
  type: "sent",  // "sent" | "unsent" | "scheduled"
  limit: "20",
  offset: "0"
}), {
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

const queueStats = await response.json()

Update Queued Message

const response = await fetch("https://api.ofauth.com/v2/access/messages/queue/QUEUE_MESSAGE_ID", {
  method: "PUT",
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    text: "Updated message content!",
    userIds: [123, 456]
  })
})

Delete Queued Message

const response = await fetch("https://api.ofauth.com/v2/access/messages/queue/QUEUE_MESSAGE_ID", {
  method: "DELETE",
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

API Endpoints

EndpointMethodDescription
/v2/access/chatsGETList all chats
/v2/access/chats/{userId}/messagesGETGet messages in a chat
/v2/access/chats/{userId}/messagesPOSTSend a message
/v2/access/messages/{messageId}DELETEUnsend a message
/v2/access/messages/queuePOSTCreate queued/mass message
/v2/access/messages/queue/statsGETGet queue stats
/v2/access/messages/queue/{queueMessageId}GETGet queued message
/v2/access/messages/queue/{queueMessageId}PUTUpdate queued message
/v2/access/messages/queue/{queueMessageId}DELETEDelete queued message

Full API Reference

See complete endpoint documentation

Query Parameters

List Chats Query

ParameterTypeDefaultDescription
limitnumber10Results per page (1-20)
offsetnumber0Pagination offset
orderstring”recent”Sort order: recent, old
filterstring-Filter: priority, who_tipped, unread
querystring-Search query
userListIdnumber-Filter by user list ID

Chat Messages Query

ParameterTypeDefaultDescription
limitnumber10Results per page (1-20)
offsetnumber0Pagination offset
querystring-Search within messages

Message Options

FieldTypeDescription
textstringMessage content (supports markdown)
mediaItems(number|string)[]Media references (see below)
pricenumberPPV price (33-200)
isLockedTextbooleanLock text behind paywall
previewMediaCountnumberNumber of preview media items
isMarkdownbooleanParse text as markdown (default: true)
userTagsnumber[]Tag users in message
releaseFormsobjectRelease form attachments
Use markdown formatting like **bold**, *italic*, and # headers in your messages. See Text Formatting Guide for all options.

mediaItems Formats

The mediaItems array accepts:
FormatExampleDescription
Vault Media ID12345Direct OnlyFans vault media ID
Vault ID (string)"12345"Auto-converted to number
Upload Reference"ofauth_upload_abc..."mediaUploadId from upload flow
URL"https://..."External HTTP/HTTPS URL
You can pass the mediaUploadId from the upload flow directly - the API resolves it to the vault ID automatically. Upload references are single-use.

Queue-specific Options

FieldTypeDescription
userIdsnumber[]Target specific user IDs
userListsnumber[]Target user list IDs
excludeUserListsnumber[]Exclude user list IDs
scheduledDatestringISO date for scheduled sending
subscribedAfterDatestringTarget users subscribed after date

Tips & Best Practices

Rate Limiting: OnlyFans has strict rate limits on messaging. Space out mass messages and implement exponential backoff for retries.
Content Guidelines: Messages sent through OFAuth are subject to OnlyFans’ terms of service. Automated spam or harassment can result in account suspension.
Media First: When sending messages with media, upload the media to the vault first using /uploads/init to get media IDs, then reference those IDs in mediaItems.