You can do it with the Tabs API, and the id of the default tabs looks consistent (i.e. you get the files tab with `/courses/{course_id}/tabs/files`)
So you can do the update in one step (per class):
curl -X PUT "https://{canvas_url}/api/v1/courses/{course_id}/tabs/files" -F "hidden=true" -H "Authorization: Bearer {SUPERSECRET}" | jq --raw-output
which for the course I tested it with returned:
{
"id": "files",
"html_url": "/courses/28241/files",
"full_url": "https://templeu.instructure.com/courses/28241/files",
"position": 4,
"hidden": true,
"visibility": "admins",
"label": "Files",
"type": "internal"
}It seems worth pointing out -- I'm pretty sure that that the link will just greyed out for Teachers, not invisible (alas, I tried -F "enabled=false" and -F "visibility=false" just to see, but they didn't have any effect -- I'm guessing that disabling the tool would break the course files functionality, not just hide the link entirely).
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.