- Newest
- Most votes
- Most comments
The AccessDeniedException you're encountering with the GetDocumentContent API call could be due to several factors:
-
Authentication Method: Since your Q Business application is configured with IAM Identity Center, you need to use an identity-aware session. The error suggests that the authentication method you're using might not be properly passing your identity context to the API.
-
Profile Mismatch: I notice you're using the "QBusiness" profile for list-documents but switching to the "Admin" profile for get-document-content. This inconsistency could be causing the authorization failure. Try using the same profile for both operations.
-
Document Access Control: The GetDocumentContent API validates user authorization against document Access Control Lists (ACLs) before returning content. Even if you have general permissions to the Q Business application, you might not have specific access to the particular document you're trying to retrieve.
-
Document ID Format: The document ID you're using (a full URL) might not be in the correct format expected by the API. The GetDocumentContent API expects the document ID as it's stored in the index, which might not be the full URL.
To troubleshoot:
- Use the same profile for both operations (stick with the QBusiness profile that worked for list-documents)
- Try using the CheckDocumentAccess API to verify if you have access to the specific document
- Ensure the document ID format is correct - you might need to encode the URL or use a different identifier
- Verify that your permission set includes not just broad qbusiness:* permissions but specifically the permissions needed for document content retrieval
If these steps don't resolve the issue, it's possible that the GetDocumentContent functionality might have specific requirements or limitations that aren't fully addressed in your current setup.
Sources
GetDocumentContent - Amazon Q Business
AccessDeniedException - ChatSync operation (IAM Identity Center) | AWS re:Post
CheckDocumentAccess - Amazon Q Business
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated a year ago

Can you confirm that access to the GetDocumentContent is implemented if the document id is a webpage?