Creating pipeline via API doesn't work with passed in variables. What am i doing wrong?

I’m hitting Pipelines API | GitLab and getting a successful response which also creates the pipeline. However, when I try to pass in variables… nothing seems to come across in the pipeline itself when I log them. I’m sure my request is wrong, but those docs aren’t the most straight forward.

Should they be sent in the body?

[
    {
        "key": "UPLOAD_TO_S3",
        "variable_type": "file",
        "value": "true"
    }
]

It says pass it in as an array, but also feels like it needs the variables key.

{
    "variables": [
        {
            "key": "UPLOAD_TO_S3",
            "variable_type": "file",
            "value": "true"
        }
    ]
}

Either way, neither seem to work as expected. What am I doing wrong here?

There’s no way that it’s required to pass this in as a query param right?

The issue was in the variable_type value.

This endpoint requires this format:

{
    "variables": [
        {
            "key": "UPLOAD_TO_S3",
            "variable_type": "file",
            "value": "true"
        }
    ]
}

and valid values for variable_type are env_var and file. Relevant docs