A synonym is represented by a synonym object. A synonym object consists of its query and its attached synonyms. The synonyms can be either directed or bi-directional (synonym).

querystrRequiredThe query which should have synonyms
directed_synonymsstrOptionalDirected synonyms, are synonyms that will appear when you type the query, but the query will not appear as synonym for the directed synonyms.
synonymsstrOptionalBi directional synonoms, go both ways, meaning if you have query A with bi-directional synonym B, you will also get A as a synonym when searching for B
  "query": "pants",
  "synonyms": ["trousers","legwear"],
  "directed_synonyms": ["leggings"]