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 ()
Retrieve media shared in a specific conversation:
// Get all media from a chat
const response = await fetch ( "https://api.ofauth.com/v2/access/chats/123456/media" , {
headers: {
apikey: "YOUR_API_KEY" ,
"x-connection-id" : "conn_abc123"
}
})
// Or filter by type: photos, videos, or audios
const photos = await fetch ( "https://api.ofauth.com/v2/access/chats/123456/media?type=photos" , {
headers: {
apikey: "YOUR_API_KEY" ,
"x-connection-id" : "conn_abc123"
}
})
const media = await response . json ()
Parameter Type Description typestring Filter by media type: photos, videos, or audios. Omit for all media. limitnumber Results per page skip_usersstring Skip user data in response
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
})
})
Delete a Message
Delete a sent message:
const response = await fetch ( "https://api.ofauth.com/v2/access/chats/123456/messages/MESSAGE_ID" , {
method: "DELETE" ,
headers: {
apikey: "YOUR_API_KEY" ,
"x-connection-id" : "conn_abc123"
}
})
Mass Messaging
Send to multiple fans at once using the mass messaging endpoints:
Create Mass Message
const response = await fetch ( "https://api.ofauth.com/v2/access/mass-messages" , {
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/mass-messages" , {
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"
})
})
List Mass Messages
View mass message history:
const response = await fetch ( "https://api.ofauth.com/v2/access/mass-messages?" + new URLSearchParams ({
limit: "20" ,
offset: "0"
}), {
headers: {
apikey: "YOUR_API_KEY" ,
"x-connection-id" : "conn_abc123"
}
})
const massMessages = await response . json ()
Update Mass Message
const response = await fetch ( "https://api.ofauth.com/v2/access/mass-messages/MASS_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 Mass Message
const response = await fetch ( "https://api.ofauth.com/v2/access/mass-messages/MASS_MESSAGE_ID" , {
method: "DELETE" ,
headers: {
apikey: "YOUR_API_KEY" ,
"x-connection-id" : "conn_abc123"
}
})
API Endpoints
Endpoint Method Description /v2/access/chatsGET List all chats /v2/access/chats/{userId}/messagesGET Get messages in a chat /v2/access/chats/{userId}/messagesPOST Send a message /v2/access/chats/{userId}/messages/{messageId}DELETE Unsend a message /v2/access/chats/{userId}/mediaGET Get media from a chat /v2/access/mass-messagesGET List mass messages /v2/access/mass-messagesPOST Create mass message /v2/access/mass-messages/{massMessageId}GET Get mass message details /v2/access/mass-messages/{massMessageId}PUT Update mass message /v2/access/mass-messages/{massMessageId}DELETE Delete mass message
Full API Reference See complete endpoint documentation
Query Parameters
List Chats Query
Parameter Type Default Description limitnumber 10 Results per page (1-20) offsetnumber 0 Pagination 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
Parameter Type Default Description limitnumber 10 Results per page (1-20) offsetnumber 0 Pagination offset querystring - Search within messages
Message Options
Field Type Description textstring Message content (supports markdown ) mediaItems(number|string)[] Media references (see below) pricenumber PPV price (3 − 3- 3 − 200) isLockedTextboolean Lock text behind paywall previewMediaCountnumber Number of preview media items isMarkdownboolean Parse text as markdown (default: true) userTagsnumber[] Tag users in message releaseFormsobject Release form attachments
Use markdown formatting like **bold**, *italic*, and # headers in your messages. See Text Formatting Guide for all options.
The mediaItems array accepts:
Format Example Description Vault Media ID 12345Direct OnlyFans vault media ID Vault ID (string) "12345"Auto-converted to number Upload Reference "ofauth_upload_abc..."mediaUploadId from upload flowURL "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
Field Type Description userIdsnumber[] Target specific user IDs userListsnumber[] Target user list IDs excludeUserListsnumber[] Exclude user list IDs scheduledDatestring ISO date for scheduled sending subscribedAfterDatestring Target 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.
Common Workflows
Welcome New Subscriber
Automatically greet new fans when they subscribe:
// 1. Get recently subscribed fans
const response = await fetch (
"https://api.ofauth.com/v2/access/subscribers?type=latest&latestType=new&limit=10" ,
{ headers }
)
const newFans = await response . json ()
// 2. Send welcome message to each
for ( const fan of newFans . list ) {
await fetch ( `https://api.ofauth.com/v2/access/chats/ ${ fan . id } /messages` , {
method: "POST" ,
headers ,
body: JSON . stringify ({
text: `Hey ${ fan . name } ! Thanks so much for subscribing! Let me know if there's anything you'd like to see.`
})
})
// Space out messages to avoid rate limits
await new Promise ( r => setTimeout ( r , 2000 ))
}
Send PPV to High-Value Fans
Target your best customers with exclusive content:
// 1. Upload exclusive content first
const uploadInit = await fetch ( "https://api.ofauth.com/v2/access/uploads/init" , {
method: "POST" ,
headers ,
body: JSON . stringify ({
filename: "exclusive.mp4" ,
mimeType: "video/mp4" ,
size: fileSize
})
})
const { mediaUploadId , uploadUrl } = await uploadInit . json ()
// 2. Upload the file
await fetch ( uploadUrl , {
method: "PUT" ,
body: fileBuffer ,
headers: { "Content-Type" : "video/mp4" }
})
// 3. Complete the upload
await fetch ( "https://api.ofauth.com/v2/access/uploads/complete" , {
method: "POST" ,
headers ,
body: JSON . stringify ({ mediaUploadId })
})
// 4. Send as PPV to a specific user list
await fetch ( "https://api.ofauth.com/v2/access/mass-messages" , {
method: "POST" ,
headers ,
body: JSON . stringify ({
text: "Exclusive content just for my VIPs!" ,
mediaItems: [ mediaUploadId ],
price: 15.00 ,
previewMediaCount: 1 ,
userLists: [ VIP_LIST_ID ]
})
})
Respond to Unread Messages
Build a simple auto-responder or notification system:
// Get unread chats
const response = await fetch (
"https://api.ofauth.com/v2/access/chats?filter=unread&limit=20" ,
{ headers }
)
const unreadChats = await response . json ()
for ( const chat of unreadChats . list ) {
// Get the latest message
const messagesResp = await fetch (
`https://api.ofauth.com/v2/access/chats/ ${ chat . withUser . id } /messages?limit=1` ,
{ headers }
)
const messages = await messagesResp . json ()
const lastMessage = messages . list [ 0 ]
// Process the message (e.g., send to your AI, notify staff, etc.)
console . log ( `New message from ${ chat . withUser . name } : ${ lastMessage . text } ` )
}