This guide will give you a brief overview of how to compose messages with various elements using our API.

Please keep in mind that all of the below examples are meant to be sent as a POST request to our https://app.onlyfansapi.com/api/{account}/chats/{chat_id}/messages endpoint.

Looking for the chat_id? Use our List Chats endpoint.

Looking for the developer-oriented documentation? Please refer to our API Reference.

Text-only messages

Simply want to send a regular message? Use the following payload:

{
  "text": "The text of your message"
}

Adding media

Please refer to our dedicated guide on uploading media for more information on how to upload media files, and how to include them in your chat messages.

Setting a price (PPV)

To set a price for your chat message, you can use the price field in your payload. This will make your message paid (PPV). All paid messages must contain at least one media file.

Only including paid media

To send a paid message without any free preview media, you can use the following payload:

{
  "text": "The text of your message",
  "mediaFiles": ["ofapi_media_123", 3866342509],
  "price": 5
}

The mediaFiles parameter can contain either ofapi_media IDs, or OnlyFans Vault Media ID (e.g., 3866342509). You can find more information about these IDs in our media uploads guide. You can mix-and-match these IDs in the same array.

Including free preview media

To send a paid message with free preview media, you can use the previews field in your payload. This allows you to include media that will be visible to the recipient, even if they haven’t paid for the message.

Important!
Make sure to list every previews media file in the mediaFiles array as well. Otherwise, the API will return an error.

The previews array is only used to indicate which media files are free, while the mediaFiles array contains all media files included in the message, regardless of whether they are paid or free.

{
  "text": "The text of your message",
  "mediaFiles": ["ofapi_media_123", 3866342509],
  "previews": ["ofapi_media_456", 1234567890],
  "price": 5
}

The mediaFiles and previews parameters can contain either ofapi_media IDs, or OnlyFans Vault Media ID (e.g., 3866342509). You can find more information about these IDs in our media uploads guide. You can mix-and-match these IDs in the same array.

Tagging other OnlyFans creators

To tag other OnlyFans creators in your message, you can use the rfTag field in your payload. You can specify multiple creators by providing an array of their OnlyFans user IDs.

{
  "text": "The text of your message",
  "rfTag": [123, 456]
}

How to find the OnlyFans user ID of a creator?

  • If you’ve connected the relevant creator account to OnlyFans API, you can use our List Accounts endpoint.
  • Not connected, but you know the creator’s username? You can use our Get Profile Details endpoint.
  • Not connected and don’t know the username? You can use our Search Profiles endpoint.

Formatting your message text

Please refer to our dedicated guide on text formatting for more information on how to format your message text, including text styles, colors, and more.