API: Notify endpoint still requires env variable key

Hey, not sure if this is expected, most of api endpoints work with the new api key set in admin but when trying to run notify i get error. Do I need to set it up or will it be included to use new api method?

"MB_API_KEY is not set. See https://www.metabase.com/docs/latest/configuring-metabase/environment-variables#mb_api_key for details"
curl -X POST \
-H "Content-Type: application/json" \
-H 'x-api-key: mb_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{"table_id": "3802"}' \
"https://metabase.xxxxxxx.xxx/api/notify/db/171"

Exactly, this is technical debt that we have to solve in the future

1 Like

Hello, any updates on this? I am trying to utilize the notify endpoint and facing the same issue.

just for the record, the API key you define in the admin section IS NOT THE SAME API key you define for the notify endpoint. For this SPECIFIC ENDPOINT you need to define an api key as an env var MB_API_KEY

Thank you for the clarification.

I am a bit confused. I set up an API key in the admin panel and then passed the key (as a variable) in the headers of the NOTIFY endpoint, but this didn’t work.

Could you please elaborate on the process? Specifically, if I create an environment variable named MB_API_KEY, what value should I assign to this variable?

For reference Environment variables