Update environment variable from pipeline run

Hey!

Is there any way to save environment variables from within a pipeline run?
Let’s say you want to create or update a environment variable, so its available in a next pipeline.
I found https://docs.gitlab.com/ee/api/pipelines.html#get-variables-of-a-pipeline to get variables, but nothing about creating or updating one.

Cheers,
Tom

The API can Update variables.