Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

"statusCode": 403 - "Could not create content with type page"

Caleb Hawkins November 12, 2015

I'm having issues with creating a page (child of another page which I provide the ID for) in the company's Confluence wiki via command line. I get status code 403, which tells me I could not create content with type "page".

 

My command ("user" and "mycompany" being placeholder names for this post):

 

curl -u user -X POST -H 'Content-Type: application/json' -d'{"type":"page","title":"new page","ancestors":[{"id":54362173}],"space":{"key":"TST"},"body":{"storage":{"value":"<p>This is a new page</p>","representation":"storage"}}}' https://mycompany.atlassian.net/wiki/rest/api/content/ | python -m json.tool

 

It asks for my password and I provide the correct one, and then this is the output I get:

 

{
	"data": {
		"authorized": false,
		"errors": [],
		"valid": true
	},
	"message": "Could not create content with type page",
	"statusCode": 403
}

 

I have permissions to create a page via the Confluence interface (and I have, several times), but this seems to be telling me otherwise. Can anyone shed some light into why this is happening and what I can do to fix it?

Also, I should mention I've gotten comment-posting via command-line to work, so I do indeed have permissions for the wiki.  But for creating and editing pages via this method, I'm having this problem.

3 answers

2 votes
Steve Bates September 5, 2017

Check the  space paramater.  I had this error when this was not correct.  The error is not informative.

"space":{"key":"My Project"},  Failed with the 403 error

"space":{"key":"MyProject"},  worked.

As per Steven Lancashire post using GET on the parent page will show you the exact name for the space:

curl -u admin:admin https://mycompany.atlassian.net/wiki/rest/api/content/54362173
Caleb Kirksey September 19, 2018

This was my issue as well. Thanks!

0 votes
Jason Jason January 27, 2016

There is definitely some problem with this.  I'm using a password that can successfully download and edit the page, there are no restrictions on the page,  I'm admin on the space, and I created the page I'm trying to make a child page of.

 

Worse, this was working correctly last week, but this week I get a 403 error.  Is there any way for a hosted user to get additional debug information to see what the problem is?

 

0 votes
Steve Lancashire
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 12, 2015

It looks like what you are doing is correct, and so I have to assume it is a permission problem. As you probably know, the return code 403 indicates that you are forbidden from performing the action.

Do you have permission to create pages under the ancestor?  And does the ancestor definitely exist?

Try performing a GET on https://mycompany.atlassian.net/wiki/rest/api/content/54362173

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events