How do I programmatically update pathauto paths for an entity?
You could use the pathauto.generator service provided by Pathauto:

\Drupal::service('pathauto.generator')-&gt;updateEntityAlias($entity, 'update');