The projects API endpoint supports the create action and edit action, which can pass the default_branch parameter.
default_branch