Hi Vijay,
Since Production is working but Acceptance is failing with "Invalid personal access token (PAT)", I would first verify that you're registering the PDF Document Generation service against the Acceptance application details, not the Production ones.
A few things I've seen cause this:
One important point: PATs are user-specific, not environment-specific. If the same PAT works for one application but fails for another, I would check application permissions and the registration details rather than the token itself.
Since the error occurs during registration itself:
Failed to register application: Invalid personal access token (PAT)
I would try the following:
Also compare the PDF Document Generation configuration between Production and Acceptance. If Production was registered previously and Acceptance was re-created, cloned, or moved between teams, I've seen registration issues caused by mismatched App IDs.
The fact that PDF generation was working before and suddenly stopped also makes me check whether:
My suspicion is that this is an application access/App ID mismatch issue rather than a problem with the PDF Document Generator itself, especially since Production continues to work normally.
Hope this helps.
Hi Vijay,
Since PDF generation works in Production but the Acceptance environment suddenly reports “Access token is not valid”, I would focus on the DocGen app registration for the Acceptance environment, rather than the PDF template itself.
One important point: the current PDF Document Generation documentation does not describe creating a normal Mendix Cloud PAT with mx:deployment:read and using that as the DocGen registration credential. The Document Generation module manages its own access token after the app environment is registered.
I would check the following:
“Domain verification failed, invalid token”
DocumentGeneration
└─ Scheduled events
└─ SE_AccessToken_Refresh
is enabled.
This scheduled event is responsible for automatically refreshing the token used to secure communication with the Document Generation service.
mx:deployment:read is intended for Mendix deployment APIs, not as a replacement for the Document Generation service's application registration token. /docgen/ access/docgen/ is accessible to the Document Generation service. Mendix specifically requires the /docgen/ path to be accessible when using the service. So, because Production is working with the same application, my first step would be:
Acceptance → open the Snip_AppRegistration page → register/renew that specific environment again using its current Acceptance URL.
If registration itself fails, the exact error is important. For example, “Invalid Developer Credentials”, “Invalid App”, and “Domain verification failed” point to different problems. Mendix has a dedicated troubleshooting table for these cases.
I would not generate another random PAT or change the PDF template first. This looks much more like an Acceptance environment registration/token issue.
Hope this helps.