Environment is also not defined in URL parameters. It is defined in Specification URL though.
Was able to work around by using custom auth to define a variable, setting the value with the environment variable, and then using that variable in the header.
I'm trying to do the same thing. I've tried using custom auth like you did to define a variable. However, entering the variable name in the header doesn't actually give me the value of the variable...