Bitbucket Data Center REST API | Edit File API Not working

I’m working on automating a process where we update files and commit changes directly from a Figma Plugin, leveraging Bitbucket Data Center REST APIs. However, I’m encountering an issue when trying to update a file in a repository.

When I execute a PUT request to update a file, I receive the following error response:

{
    "errors": [
        {
            "context": null,
            "message": "An error occurred while processing the request. Check the server logs for more information.",
            "exceptionName": null
        }
    ]
}

Have referred this doc Bitbucket Data Center REST API