> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.trustmary.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Review connections (developers)

**
**Third-party reviews can be imported into Trustmary via review connections. These review connections can be managed via our API.

# Review connection object

### Attributes

**id **string
* Unique identifier for the object.
**slug **string
* User specified short name for the object.
**title **string
* The title of the review connection.
**source** string
* Which third-party service is used in the connection.
**lang** string
* Language of the reviews.
**targetId** string
* Unique identifier of target.
**targetUrl** string
* URL of target.

### Example

```json
{
  "id": "12345",
  "slug": "my-hotel-1",
  "title": "My title for my hotel",
  "source": "airbng",
  "lang": "en",
  "targetId": "hotel-0001",
  "targetUrl": "https://airbnb.example.com/hotels/hotel-0001/"
}
```

### Listing review connections

```json
GET /review-connections
```

###### Returning

```json
{
  "reviewConnections": [review_connection_objects]
}
```
### Updating review connections

```json
PATCH /review-connections/{slug or ID}
```

The review connection ID (as returned by POST or GET) can be used to access a review connection. 

The following properties can be changed for a review connection:
* slug
* title

If not set in the POST body, the property will not be changed. E.g., to change just the slug the request body should look like this:
 
```json
{
    "slug: "my-new-slug"
}
```

### Adding new review connections

Review connections can be added by using a review source page URL or using explicit review service ID.

```json
POST /review-connections
```

The URL is the same URL as you would use to browse the reviews on the external review service.

The title and the slug can be set when adding a connection. E.g. to add a new connection by URL, the request body shoud look like this:

```json
{
  "title": "My hotel",
  "slug": "my-hotel",
  "targetUrl": "https://some-review-service.com/hotels/12345"
}
```

Alternatively, for some services it is required to use an ID or it might be more convenient in case you are already handling review page ID's. When using an ID, the source type must be known. The following request body is an example on how to add a Capterra source by ID.

```json
{
  "source": "capterra",
  "targetId": "123456"
}
```

An optional **lang** parameter might be needed for some services. The response body will contain the system set ID for the added connection. 

### Removing review connections

```json
DELETE /review-connections/{slug or ID}
```


** **