Trouble Posting Dynamic JSON Message via HTTP API (chat.postMessage)

Hi Rocket.Chat team,

I’m currently integrating Rocket.Chat with n8n (self-hosted) and trying to send dynamic messages using the chat.postMessage API endpoint. Static strings work perfectly — but as soon as I pass in dynamic values (like {{ $json.text }} from a prior node in n8n), the message still gets posted but only as the literal string (e.g., {{ $json.text }} instead of the actual content).

:check_mark: What’s working:

  • Static message like "text": "Test message" posts fine.
  • API endpoint authenticates correctly.
  • Room ID / channel (#ai-chat) is valid.
  • Headers are all set correctly (X-Auth-Token, X-User-Id, Content-Type: application/json).

:cross_mark: What’s not working:

  • Using {{ $json.text }} inside a Raw or JSON body renders it literally as-is.
  • Tried multiple formatting combinations: Raw/JSON, stringified body, expression/fixed, manual mapping, and using a Set node to store the stringified payload.
  • The API returns success true, but Rocket.Chat displays the message with unresolved template values.

Rocket.Chat Setup Info:

  • Version: 7.5.1 (Starter on PikaPods)
  • Deployment ID: 511b0d58-ec...b43ca2
  • Node Version: v22.13.1
  • MongoDB: 6.0.19 / wiredTiger (oplog enabled)
  • Apps Engine: 1.50.0
  • n8n Version: 1.88.0 (self-hosted on AlmaLinux)

Do you have any known limitations on parsing JSON with variables from external tools like n8n? Or do I need to format the body in a very specific way for Rocket.Chat to resolve dynamic expressions?

Happy to provide a sanitized curl example or screenshots if needed.

Thanks so much!
Sean