How to save Jupyter notebook via API?

Good day!

Is it possible to achieve “File” -> “Save and Checkpoint” programmatically?

I know there is JS command, but it has no callback and so I can’t be sure that file is actually saved.

I also found “Save file” section in Jupyter APIs:

Tried without success:

import requests
response = requests.request(
headers={‘Authorization’: ‘token 6ec2282d28e6e755629e9007787299a929a0154e54c59df7’},

Don’t you know is it possible to achieve this?

This is helpful.

Maybe some error in your put data. put data is content which will be used in ContentManager.