Solr provides Managed Synonym Graph Filter to manage synonyms using a REST API (in this example via /solr/collection_name/schema/analysis/synonyms/english
endpoint):
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.ManagedSynonymGraphFilterFactory" managed="english"/>
<filter class="solr.FlattenGraphFilterFactory"/> <!-- required on index analyzers after graph filters -->
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.ManagedSynonymGraphFilterFactory" managed="english"/>
</analyzer>
A core reload is needed to apply synonyms changes. Solr provides a REST API for this too CoreAdmin API Reload admin/cores?action=RELOAD&core=core-name
The RELOAD action loads a new core from the configuration of an existing, registered Solr core. While the new core is initializing, the existing one will continue to handle requests. When the new Solr core is ready, it takes over and the old core is unloaded.