Create an Application Password under Users → Profile → Application Passwords. It works only for the REST API and can be revoked without changing your login password.
curl -X POST "https://example.com/wp-json/wp/v2/posts"
-u "your-user:xxxx xxxx xxxx xxxx xxxx xxxx"
-H "Content-Type: application/json"
-d '{
"title": "My new post",
"status": "draft",
"content": "<p>Hello from the API.</p>",
"excerpt": "One-sentence summary for listings.",
"categories": [12]
}'
Find category IDs with curl https://example.com/wp-json/wp/v2/categories. Keep "status": "draft" for anything generated automatically, and review before publishing. This is how this blog’s n8n workflow creates drafts.