Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do i download attachments from pages with scoped token

Arpit autviz
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!
April 16, 2026

I'm unable to download attachments from Confluence pages using a scoped API token with all the read scopes. The attachment metadata API works fine, but the actual download fails with 401 Unauthorized.

Setup:



The downloadLink from the metadata returns a relative path like /wiki/download/attachments/{pageId}/{filename}?api=v2. When I:

  1. Build the full URL: https://{domain}.atlassian.net/wiki/download/attachments/{pageId}/{filename}?api=v2 + Bearer {token}

  2. Or call: api.atlassian.com/ex/confluence/{cloudId}/wiki/download/attachments/{pageId}/{filename}?api=v2 Bearer {token}

  3. Or use the dedicated download endpoint: /wiki/rest/api/content/{pageId}/child/attachment/{attId}/download + Bearer {token}

All return 401 Unauthorized



Questions:

  1. Does the download endpoint require additional scopes beyond read:attachment:confluence?

  2. Is there a different download endpoint for scoped tokens? (e.g. always use /content/{id}/child/attachment/{attId}/download?)

  3. Does the service account need explicit attachment download permissions beyond space/page view access?

 

1 answer

1 vote
Tomislav Tobijas
Community Champion
April 16, 2026

Hi @Arpit autviz ,

Have you tried using Basic auth instead of Bearer? I have to see how we got this configured on our instance, but @Rebekka Heilmann _viadee_ created a great article series related to service accounts: 👇

This should definitely clarify some things.

As for differences related to service accounts - there might be some, but I'm not entirely sure when it comes to fetching attachments.

For example, if you can get attachments when you call that specific endpoint and the service account can't, that might just be a limitation of the system (these are, still, relatively new) 🆕

If you're app admin, you or some other app admin on your instance could reach out to Atlassian Support to confirm this and get confirmation of the scopes required to fetch this information. 👀

Cheers,
Tobi

Arpit autviz
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!
April 16, 2026

Hi @Tomislav Tobijas

Yes i have tried basic auth, but it does not work with the scoped token with classic token can Basic auth email+token i am able to download the attachment, but with the scoped token having issue.

Suggest an answer

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

Atlassian Community Events