50581462 makes a good point. Some variables use empty brackets, some use brackets with a contained value, and some variables don't use any bracket.
To expand on what he points out, I have also noticed that the doucmentation is sometimes inconsistent.
I found a good one yesterday while working on a script to publish courses, this might be useful for future reference so I'll mention it here: Courses - Canvas LMS REST API Documentation
When you execute the "Update a course" API call, one of the parameters is documented as "event"
So if you pass "event=offer", the course will be published and if you pass "event=claim" the course will be unpublished.
However, "event" does not work.
I added other variables to the call and was able to tweak other values in the course, so I knew the API call was succeeding, and was scratching my head trying to figure out why I couldn't publish/unpublish a course.
I ended up playing with the syntax and got it to work.
The correct syntax is consistent with the other variables defined, this form of the variable did allow me to publish/unpublis:
"course[event]=offer" and "course[event]=claim"
If at first your variables don't appear to work in an API call it is worth playing with the syntax.
Maybe this will be useful info for future API endeavors.