Chat Messages

Send a new message to a chat.

Idempotency. Pass an Idempotency-Key header to make retries safe. The first request with a given key is executed normally and its response is stored for 24 hours; any later request with the same key returns that stored response, plus an Idempotent-Replayed: true header, without contacting OnlyFans and without consuming credits. The replayed body is the original response with its _meta._credits block rewritten to show used: 0 and your current balance.

Keys are scoped to your team, this endpoint and the account in the URL, so the same value can be reused safely against a different account. Use a fresh, unique value (a UUID works well) for each message you send; it must be 1-255 printable ASCII characters.

  • 400 IDEMPOTENCY_KEY_INVALID — the header value is empty, too long, or contains non-ASCII characters.
  • 409 IDEMPOTENCY_CONFLICT — an earlier request with this key is still running. Retry once it finishes.
  • 422 IDEMPOTENCY_KEY_MISMATCH — this key was already used with a different request body or chat.

Responses with a 5xx status (and 408/429) are never stored, so a failed send can be retried with the same key. The header is optional: omit it and the endpoint behaves exactly as before.

post/api/{account}/chats/{chat_id}/messages

Request

  • Base URL
    https://app.onlyfansapi.com
  • URL
    https://app.onlyfansapi.com/api/{account}/chats/{chat_id}/messages
  • Auth
    HTTP bearer

Headers

Idempotency-Keystring

Request body

textstring

The message text content. Required unless a media file is present.

replyToMessageIdinteger

Mark this message as a reply to another (can be either your own, or the recipient's)

lockedTextboolean

Set to true to hide the text until the message is purchased. Allows paid text without media.

pricenumber

Price for paid content in USD (0 or between 3-200). A paid message requires mediaFiles unless lockedText is true.

giphyIdstring

The ID of the Giphy GIF to attach to the message. Get IDs from the Giphy listing endpoints (/giphy/trending, /giphy/search).

rfTagstring

Array of OnlyFans Creator User IDs to tag in your message

rfPartnerstring

Array of OnlyFans Release Form Partners IDs to tag in your message

rfGueststring

Array of OnlyFans Release Form Guest IDs to tag in your message

blockBannedWords'strict_ban' | 'risky' | 'replace_soften'

Screen text for OnlyFans banned words and block the send if any are found (returns a 422 listing the offending words). strict_ban blocks all tiers, risky blocks Risky + Replace/soften, replace_soften blocks Replace/soften only. Omit to disable screening.

Example request

{
  "text": "Hello!",
  "replyToMessageId": 123456789,
  "lockedText": true,
  "price": 6.97,
  "mediaFiles": [
    "ofapi_media_abc123",
    1234567890
  ],
  "previews": [
    "ofapi_media_abc123",
    1234567890
  ],
  "giphyId": "WAGC3LeqJvXglm5H7a",
  "blockBannedWords": "strict_ban"
}

Response

Success

Example response

{
  "data": {
    "responseType": "message",
    "text": "<p>Message text</p>",
    "giphyId": null,
    "lockedText": true,
    "isFree": true,
    "price": 0,
    "isMediaReady": true,
    "mediaCount": 0,
    "media": [],
    "previews": [],
    "isTip": false,
    "isReportedByMe": false,
    "isCouplePeopleMedia": false,
    "queueId": 123,
    "isMarkdownDisabled": true,
    "releaseForms": [],
    "fromUser": {
      "id": 339543013,
      "_view": "s"
    },
    "isFromQueue": false,
    "id": 123,
    "isOpened": false,
    "isNew": true,
    "createdAt": "2025-02-03T23:29:53+00:00",
    "changedAt": "2025-02-03T23:29:53+00:00",
    "cancelSeconds": 119,
    "isLiked": false,
    "canPurchase": false,
    "canPurchaseReason": "free",
    "canReport": false,
    "canBePinned": true,
    "isPinned": false
  },
  "_pagination": {
    "next_page": "https://app.onlyfansapi.com/api/acct_XXXXXXXXXXX/chats/XXXXXXXXX/messages?limit=10&id=XXXXXXXXX"
  },
  "_meta": {
    "_credits": {
      "used": 1,
      "balance": 1,
      "note": "Always"
    },
    "_cache": {
      "is_cached": false,
      "note": "Cache disabled for this endpoint"
    },
    "_rate_limits": {
      "limit_minute": 1000,
      "limit_day": 50000,
      "remaining_minute": 999,
      "remaining_day": 49999
    }
  }
}

Changes

    • info

      added the new optional header request parameter Idempotency-Key

    • info

      added the new optional request property

    • info

      the request property type was generalized from integer to number

    • info

      added the non-success response with the status

    • breaking

      the / request property type changed from string to file[]|string

    • breaking

      the / request property type changed from string to file[]|string[]|int

    • breaking

      the response property / became nullable for the status

    • info

      api tag Chat Messages added

    • info

      api tag Chats removed

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      request body became optional

    • info

      the request property became optional