Passing environmental variables to new Jupyter Notebook via API

Utilizing the API endpoint via POST (ref here):


I am trying to send send a payload that includes environmental variables to be initialized in the notebook on start. Currently, my request looks like the following:

# Creates notebook for the user to use.
req =
        "environment": {
            "PROJECT_UUID": project,
            "USER_ID": user_id,
            "STORAGE_URI": storage_uri,
            "DATABASE_URI": database_uri,

However, the above does not seem to initialize any env variables within the Spawner. The user of the environment key is after seeing online that the payload must follow the Spawner’s variables – however, I also did try with it, and it did not work. My JupyterHub setup is currently running with Kubernetes, and configuring extraEnv does seem to work, but it is not as dynamic as I need it to be.

# Spawned Jupyter Notebook configuration.
  defaultUrl: "/lab"
    name: ...
    tag: 1.0.2
    EASTERN: "You've found me! :)"

Any help would be appreciated.