hs secrets add fails with “missing required scopes” even after re‑auth with correct Personal Access

Hi everyone,

I’m using HubSpot Projects (CLI v8) with an App Function (endpoint) and trying to add a secret:
hs secrets add PRIVATE_APP_ACCESS_TOKEN

The CLI always returns:

Couldn’t execute the add secret because the access key is missing required scopes

Even though:

  • I regenerated the Personal Access Key
  • It includes developer.secrets.write, developer.secrets.read, developer.projects.read
  • I re‑authenticated using hs account auth
  • hs account list shows Auth Type: personalaccesskey
  • Project builds and deploys fine (hs project upload works)

This seems specific to adding secrets — everything else works.

Environment

  • OS: Windows
  • HubSpot CLI: v8.x
  • Project: Private App, Static Auth, App Function (endpoint)

Is this a known CLI caching/permissions issue on Windows, or is there an alternative supported way to inject secrets into Projects?

Thanks!

Hey @Maryamzafar,

Thanks for brining this to the Community!

Adding our dev resources below in case you find this helpful:

Additionally, tagging is some of our Top Contributors to see if they have any experience with this!

Hey @SteveHTM, @zach_threadint, @GRajput -- Do you have any suggestions for @Maryamzafar on this?

Thanks in advance!

Sam, Community Manager

Hi @Maryamzafar,

In order to view and edit secrets in the CLI, you will also need:

developer.app_functions.read
developer.app_functions.write

Looks like those are missing from what I see in your screenshot.

This can be added by selecting “App functions” under “Serverless functions” when setting up your private access key:

Hope this helps!