Top level pipeline env empty when queried through API

We have a pipeline that includes a top level environment variable

env:
  FOO: "true"

steps:
  ...

When we query https://api.buildkite.com/v2/organizations/${org-slug}/pipelines\?per_page\=100 the variable in in each of the steps, but env is empty in the top level of the pipeline.

Is this intended to work this way or is it a bug? We use environment variables to filter pipelines from a script.

I am also experiencing this issue except via the webhook. JSON returned does not have env at pipeline level anymore, only in steps. Is there any way to add env at the top level of the pipeline?

I have 2 pipelines using the same webhook, now one is missing env and is broken :\