Wordpress - create new post endpoint - content error if variable but not if plain text

Hello everyone!

Does anyone know, why when using the wordpress API create new post endpoint - gives me the 400 response, even though content is not empty:


“response”: {
“status”: 400,
“body”: {
“code”: “empty_content”,
“message”: “Content, title, and excerpt are empty.”,
“data”: {
“status”: 400
“request”: {
“body”: “{\n "title": "Asystent AI nieruchomości: Rewolucja w sposobie kupowania i sprzedawania domów",\n "content": "\n

Imagine having a real estate assistant available 24/7, effortlessly streamlining your property transactions.


Thanks to recent advancements in artificial intelligence, this is now a reality. AI real estate assistants are revolutionizing the industry by boosting efficiency and enhancing customer experiences.

\n\n\n\n<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="702" src="https://X/wp-content/uploads/2024/06/v2-dco14-sp7ba-1024x702.jpg\” alt="" class="wp-image-322" srcset="https://X/wp-content/uploads/2024/06/v2-dco14-sp7ba-1024x702.jpg 1024w, https://X/wp-content/uploads/2024/06/v2-dco14-sp7ba-300x206.jpg 300w, https://Xwp-content/uploads/2024/06/v2-dco14-sp7ba-768x527.jpg 768w, https:X/wp-content/uploads/2024/06/v2-dco14-sp7ba.jpg 1213w" sizes="(max-width: 1024px) 100vw, 1024px" />\n\n\n\n

These AI-driven tools manage everything from property searches to client interactions, saving valuable time for real estate professionals.


This technology not only automates routine tasks but also provides advanced insights through data analytics. As a result, agents can focus more on building relationships and closing deals.


For homebuyers, AI assistants offer personalized recommendations based on their preferences, making the property search less overwhelming.


By leveraging the latest in technology, both agents and clients can navigate the real estate market more effectively and with greater confidence.

\n\n\n\n<h3 class="wp-block-heading">Key Takeaways\n\n\n\n
  • AI real estate assistants enhance efficiency and customer engagement.
  • \n\n\n\n
  • Automation frees up real estate agents to focus on client relationships.
  • \n\n\n\n
  • Personalized property recommendations make searching easier for buyers.
  • \n
\n\n\n\n<h2 class="wp-block-heading">The Rise of AI in Real Estate\n\n\n\n

<iframe style="aspect-ratio: 16 / 9; width: 100%;" title="DhoqHUcMTtA" src="YouTube" frameborder="0" allowfullscreen="allowfullscreen">


Artificial intelligence has made significant inroads into real estate. AI-powered platforms are transforming how properties are marketed, bought, and managed, and the technology behind these innovations continues to evolve rapidly.

\n\n\n\n<h3 class="wp-block-heading">What Is Real Estate AI?\n\n\n\n

Real estate AI refers to the application of artificial intelligence technologies within the real estate industry. This includes tasks such as property valuation, predictive maintenance, and customer interactions.


AI algorithms analyze vast amounts of data to provide insights that can lead to better decision-making.


One key application is property recommendations for buyers based on their preferences.


Additionally, AI assists in detecting market trends and forecasting property values.


By automating tasks like document processing, AI reduces the time agents spend on administrative duties.

\n\n\n\n<h3 class="wp-block-heading">\n",\n "status": "draft",\n "lang": "pl"\n}"

While, when inputting the same content text manually and not as a variable from the previous step, I get status 201?

Thanks for any idea!