---
title: "Add Search Synonym"
method: POST
path: "/{databaseId}/synonyms/items/"
tags: ["Search"]
---

# Add Search Synonym

`POST /{databaseId}/synonyms/items/`

Adds a new synonym for the [Search items](https://docs.recombee.com/api#search-items).

When the `term` is used in the search query, the `synonym` is also used for the full-text search.
Unless `oneWay=true`, it works also in the opposite way (`synonym` -> `term`).

An example of a synonym can be `science fiction` for the term `sci-fi`.

## Path parameters

- `databaseId` string, required

## Request body

- SearchSynonymParams
  - `term` string, required — A word to which the `synonym` is specified.
  - `synonym` string, required — A word that should be considered equal to the `term` by the full-text search engine.
  - `oneWay` boolean — If set to `true`, only `term` -> `synonym` is considered. If set to `false`, also `synonym` -> `term` works. Default: `false`.

## Response `201`

Successful operation. Returns data about the added synonym (including `id`).

- SearchSynonym
  - `id` string, required — Id of the synonym record
  - `term` string, required — A word to which the `synonym` is specified.
  - `synonym` string, required — A word that should be considered equal to `term` by the full-text search engine.
  - `oneWay` boolean, required — If set to `true`, only `term` -> `synonym` is considered. I set to `false`, also `synonym` -> `term` works.

## Other responses

- `400` — Missing a field, or a field has a wrong type.
- `409` — `synonym` and `term` pair already exists in the database. In many cases, you may consider this code a success – it only tells you that nothing has been written to the database.

---

[API](https://skmtc.dev/recombee/apis/recombee-api.md) · [All operations](https://skmtc.dev/recombee/apis/recombee-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/recombee/recombee-api/revisions/a9c9c33eb2e8/schema)
