Email delivery fails with error message "The provided authorization grant is invalid, expired, or revoked."

Problem statement

We have configured Sendgrid SMTP provider, but emails failed. Searching with query type:“fn” in the tenant logs, we found logs with an error message “The provided authorization grant is invalid, expired, or revoked.”

Cause

This error seems to be returned by Sendgrid when we attempt to deliver the email using the API key added to the Auth0 Sendgrid configuration and Sendgrid rejects the API key.

If it worked in the past, it is likely your key is revoked or expired.

If you copied the API Key ID instead of the Key value that will also generate the email failure.

Solution

You can attempt to create a new Sendgrid API key and copy the **Key value" in case the previous one has been revoked or expired: