AppFoundry OAuth Token Exchange 401 Invalid Grant

Can’t get this config to load properly. The POST /oauth/token endpoint returns 401 Invalid Grant when exchanging the authorization code for an access token in our multi-org AppFoundry integration, despite the client ID and secret being correct. How do I resolve the invalid grant error during the OAuth token exchange?

curl -X POST https://api.mypurecloud.com/oauth/token \
 -d "grant_type=authorization_code&code=<CODE>&redirect_uri=<URI>"

You need to verify the redirect URI exactly matches the registration. A single character mismatch causes the 401. Check for trailing slashes or http/https differences. The token endpoint is strict on these parameters.