According to the Wordpress API for Create a Post, it needs to be an array.
When you are using “Map” for a field, you are responsible for ensuring the value is exactly as required. However, the Wordpress API documentation doesn’t tell you that you can also pass a comma-separated text string of category IDs:
So all you need to do is put a comma in-between them
In future, please create a new thread for each question. This makes it easier for others with the same problem to search for the answer. Thank you for your cooperation!
The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.
This marks the topic as solved, so that:
others can save time when catching up with the latest activity here, and
allows others to quickly jump to the solution if they come across the same problem
To do this, simply click the checkbox at the bottom of the post that answers your question: