Looks to me like you are trying to do a POST request without CSRF, can you confirm this JS is running on the same site that is running your Discourse?
Looks to me like you are trying to do a POST request without CSRF, can you confirm this JS is running on the same site that is running your Discourse?