Modify identity provider external ID for a User

In case of a migration, I create users via API. We use Discourse-openid-connect for connecting to our SSO (Keycloak). I want to associate users account via API with ID from Keycloak. How a
i can do this ?

I’ve seen the API /u/by-external/oidc/{ext_id].json to get user info from external ID.
I’ve also seen the API /u/{username}.json for update a User, and a field external_ids. But i don’t know the value to put on…