title: How to create new page in Confluence using their REST API?
body: <p>I need working example of creating new wiki page in confluence using rest api. I prefer the new page to be created under specific space and specific page. I read their api documentation and looked at few examples they had and still coming short. </p>
  
  <p>Here is an example they had on their site</p>
  
  <pre><code>curl -u admin:admin -X POST -H 'Content-Type: application/json' -d'{"type":"page","title":"new page","space":{"key":"TST"},"body":{"storage":{"value":"&lt;p&gt;This is a new page&lt;/p&gt;","representation":"storage"}}}' http://localhost:8080/confluence/rest/api/content/ | python -mjson.tool
  </code></pre>
  
  <p>I tried above with my space name, new title and changed the url to mysite/rest/api/content
  and returned content was basically html page saying the page does not exist or the page exists but you do not have permission. I have confirmed that I have access to confluence wiki and can create new wiki using my credentials. </p>
  
  <p>What is also not clear is in the example above how is it calling the specific api that creates the page? It does not make sense.</p>
  
  <p>similar question was asked on their forum, but no reasonable answer
  <a href="https://answers.atlassian.com/questions/149561/simple-confluence-rest-api-usage-what-am-i-missing">https://answers.atlassian.com/questions/149561/simple-confluence-rest-api-usage-what-am-i-missing</a></p>
  
  <p>(I guess my end goal is to be able to create new wiki page on confluence automatically) I am okay to give up on confluence REST API to other solution if necessary.</p>