I get 404 error when try to delete a page from curl

srini nall
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 17, 2025

I encounter a 404 error when attempting to delete a page using Curl. However, I can successfully delete the page through the Confluence interface in the browser, utilizing the same user ID. 

I can get/put/post with the same user and API token. But not Delete, why?

I use this curl syntax:

curl --request DELETE \ --url 'https://{your-domain}/wiki/api/v2/pages/{id}' \ --user 'email@example.com:<api_token>'

2 answers

0 votes
Victor Law
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 17, 2025

Hi @srini nall

I tested with the same REST API as documented below, and it works:

https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-id-delete

As a side note, I think you might need to correct the backslash usage in your command:

 

  • The backslash (\) is used to indicate that a space follows a line continuation. This space will break the command.
  • Correct usage: The backslash should be at the very end of the line with no trailing space.

 

Thank you.

srini nall
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 18, 2025

Hi @Victor Law 

Update:

1. I can delete a page from my account(free & personal)

2. But when I delete a page from my work account, I get 404 status code. But GET works fine and the page status is "current". Do you think, my admin who created the account in Confluence didn't give the Delete permission for the account I use?

 

Thanks

 

Victor Law
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 18, 2025

Hi @srini nall

I suggest you check with the space admin, as permission to delete is granted on the Confluence space level.

https://support.atlassian.com/confluence-cloud/docs/assign-space-permissions/

Thank you.

Like srini nall likes this
0 votes
srini nall
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 17, 2025

I use this curl syntax:

curl --request DELETE \ --url 'https://{your-domain}/wiki/api/v2/pages/{id}' \ --user 'email@example.com:<api_token>'

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events