I think the documentation you are looking for is https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/src#post
THis describes how you can upload files using the api.