Unauthorized respond with sendGrid

I’m trying to integrate the sendGrid plugin using the lifecycle hooks from the doc (Email | Strapi Documentation) , but I’m facing this issue when I create a new entry that should trigger the sendGrid:

    at F:\Toolkit\Backup\DESKTOP-1T8RUB1_1\D\PROJECTS\ThirdHug\Meediconnect\DEVELOPMENT\HCU1\healthconnectus-api\node_modules\@sendgrid\client\src\classes\client.js:146:29
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 401,
  response: {
    headers: {
      server: 'nginx',
      date: 'Fri, 03 Mar 2023 17:00:00 GMT',
      'content-type': 'application/json',
      'content-length': '116',
      connection: 'close',
      'access-control-allow-origin': 'https://sendgrid.api-docs.io',
      'access-control-allow-methods': 'POST',
      'access-control-allow-headers': 'Authorization, Content-Type, On-behalf-of, x-sg-elas-acl',
      'access-control-max-age': '600',
      'x-no-cors-reason': 'https://sendgrid.com/docs/Classroom/Basics/API/cors.html',
      'strict-transport-security': 'max-age=600; includeSubDomains'
    body: { errors: [Array] }

Has anyone faced a similar issue?

Issue resolved. When I added the API key as an env var instead as inputting directly the AP key, it works.

not for me :frowning: