Hi @Srikanth ,
Per my test, you can use following url to upload a file to sharepoint.
https://xxx.sharepoint.com/sites/aaa/_api/web/GetFolderByServerRelativeUrl('/sites/aaa/Document/')/Files/add(url='test.xlsx',overwrite=true)
You can also refer to following code to upload a file by rest api
https://www.c-sharpcorner.com/blogs/upload-documents-show-documents-in-a-page-using-sharepoint-rest-api
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.