# Create or update a synonym rule **PUT /_synonyms/{set_id}/{rule_id}** Create or update a synonym rule in a synonym set. If any of the synonym rules included is invalid, the API returns an error. When you update a synonym rule, all analyzers using the synonyms set will be reloaded automatically to reflect the new rule. ## Required authorization * Cluster privileges: `manage_search_synonyms` ## Servers - http://api.example.com: http://api.example.com () ## Authentication methods - Api key auth - Basic auth - Bearer auth ## Parameters ### Path parameters - **set_id** (string) The ID of the synonym set. - **rule_id** (string) The ID of the synonym rule to be updated or created. ### Query parameters - **refresh** (boolean) If `true`, the request will refresh the analyzers with the new synonym rule and wait for the new synonyms to be available before returning. If `false`, analyzers will not be reloaded with the new synonym rule ### Body: application/json (object) - **synonyms** (string) The synonym rule information definition, which must be in Solr format. ## Responses ### 200 #### Body: application/json (object) - **result** (string) The update operation result. - **reload_analyzers_details** (object) Updating synonyms in a synonym set can reload the associated analyzers in case refresh is set to true. This information is the analyzers reloading result. [Powered by Bump.sh](https://bump.sh)