# Composing messages (/introduction/guides/composing-messages)



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

<Callout type="warn">
  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](/api-reference/chats/list-chats) endpoint.**
</Callout>

<Callout>
  **Looking for the developer-oriented documentation?** Please refer to our [API Reference](/api-reference/chats/send-message).
</Callout>

## Text-only messages

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

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

## Adding media

Please refer to our dedicated guide on [uploading media](/introduction/guides/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:

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

<Callout>
  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](/introduction/guides/uploading-media). **You can mix-and-match these IDs in the same array.**
</Callout>

### 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.

<Callout>
  **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.
</Callout>

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

<Callout>
  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](/introduction/guides/uploading-media). **You can mix-and-match these IDs in the same array.**
</Callout>

## 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.

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

<Callout>
  **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](/api-reference/account/list-accounts) endpoint.
  * **Not connected, but you know the creator's username?** You can use our [Get Profile Details](/api-reference/public-profiles/get-profile-details) endpoint.
  * **Not connected and don't know the username?** You can use our [Search Profiles](/api-reference/public-profiles/search-profiles) endpoint.
</Callout>

## Formatting your message text

Please refer to our dedicated guide on [text formatting](/introduction/guides/text-formatting) for more information on how to format your message text, including text styles, colors, and more.
