Skip to main content
Send a free or paid message to one fan and save the returned message ID. Use a mass message when you need multiple recipients or scheduled delivery.

Before you start

Ask the user to authorize your app with messages:write, which lets your app send messages. Use the returned access token and select a linked account the user shared. You also need the fan’s numeric OnlyFans user ID. Install the TypeScript SDK version 4. Create a client on your server:
Use this client for the rest of this guide. The SDK sends the access token and linked account ID for you.

Select a recipient

Use the fan’s numeric OnlyFans ID in the URL. If you do not have it, read fans or chats with the read permission listed in that guide. For the example below, that ID is 123456.

Send text

The response contains the created message, with no data field around it. Save message.id with the recipient. You have finished when that record contains the message ID. If you do not know whether the request succeeded, check the conversation with messages:read. Follow error recovery before trying again. A timeout can happen after the message was sent. To reply to one message, add its ID as the string replyToMessageId. To send text or HTML unchanged, set isMarkdown: false. See Text formatting.

Read the recent conversation (optional)

If you need context before sending, request messages:read when the user authorizes your app. Then read recent messages. Skip this request when you already know the recipient and message.
Process history.items. Follow history.page.nextCursor for older messages while history.page.hasMore is true.

Attach media and set a price

Upload new media or choose existing Vault IDs. Pass this object as body to client.access.chats.messages.send({ userId: 123456, body }):
The first attachment is the free preview. The remaining attachments require purchase. Set price from 0 to 200. Set previewMediaCount to a whole number from zero to the number of attachments. When charging, keep some text or media paid. To include release forms for people in the media, add releaseForms: { "users": [123456], "partners": [], "guests": [] }. Use numeric IDs in these arrays. See Media references for supported attachment formats and single-use upload references.

Delete a sent message

Delete the selected message with the same fan ID in the path and body:
Wait for the call to succeed before removing the message from your app. For multiple recipients, use mass messages. Handle errors before retrying a send, particularly when it is unclear whether the message was sent.