It isn't possible to change the API endpoint of a repository once it's been set.
If you need a new endpoint, you'll need to create a new repository with the correct URL. To recreate your Page Types, Custom Types, Slices, etc, use the Types API, and to migrate your content, the Migration API will help transfer your documents.
These tools help you with the process of setting up a new repository with the correct url name.