How to use the subcription key of an endpoint in atlas trigger


I have a trigger in mongodb atlas which will call an API with subcription key.
const response = await{ url: ‘xxxx’,
headers: {‘Ocp-Apim-Subscription-Key’: [‘1234’]}, encodeBodyAsJSON: true}
I dont want to use the subcription as above. Is there any way we can save this key somewhere and use it here.

please help me in this… thanks in advance

Hi @Rajalakshmi_R and welcome to MongoDB community forums!!

As mentioned in the documentation, the Values and Secrets in Atlas app services, provides you the privilege to use the environment variables or secrets which could be used in the Atlas Triggers.
You can define the subscription key in your case as secrets or environment variable and the triggers can use it from the backend.

If this is not what you are looking for, could you please help me understand the use case you are trying to achieve?

Warm regards