use the create process api to execute the backup utilities (pg_dimp, pg_dumpall, or pg_basebackup). the utilities must be installed on the server hosting the webapi.
https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.start?view=net-7.0