Yes, non-hosted services, applications, and operational and basemap service URLs within webmaps can be updated via the Sharing API using a script, but did you need to update hosted services? Those cannot be updated via the Sharing API and need to be updated elsewhere, a workflow that is not supported and risky.