How to delete attachments

Velan Krishnan
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!
August 21, 2023

Hi, I have a confluence page which has lot of attachments. I need to delete all the attachments using rest api. Is there any way to achieve this?

I tried below, getting 403

curl  -u ${USER_NAME}:${USER_PASSWORD} -H 'Content-Type: application/json' -H 'Accept: application/json' -X DELETE ${CONFLUENCE_BASEURL}'/rest/api/content/'${ATTACHMENT_ID}'?status=current'

2 answers

0 votes
Rick Westbrock
Contributor
August 28, 2023

I think that authorization requires an API token instead of password. See the Basic auth for REST APIs page here: https://developer.atlassian.com/cloud/confluence/basic-auth-for-rest-apis/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events