> ## Documentation Index
> Fetch the complete documentation index at: https://docs2.travtus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Google Review

> This endpoint ingests a Google review.

A group must be provided for creating a review.

You can provide either a group id through the `group_id` parameter or a group external reference through the `group_external_ref` attribute.

Do not provide both, as this will result in the request failing.

If no group id or group external reference is provided, the operation will fail.

Currently the endpoint will only process review messages, any other types of messages will not be processed.

All datetime fields included in the body parameters need to be specified as [ISO8601-formatted date strings](https://en.wikipedia.org/wiki/ISO_8601).

Datetime fields should follow a "YYYY-MM-DDThh:mm:ss" format.

### Header

<ParamField header="Authorization" type="string" default="none" required>
  The authentication token for your request
</ParamField>

### Body

<ParamField body="group_id" type="string" default="none">
  The id of the group you want to create or update the message for.
</ParamField>

<ParamField body="group_external_ref" type="string" default="none">
  The external reference of the group you want to create or update the message for.
</ParamField>

<ParamField body="channel" type="enum" default="none">
  The channel of the message. Possible value: `review`.
</ParamField>

<ParamField body="review" type="object" default="none">
  The review message to be ingested.

  <Expandable tilte="review">
    <ParamField body="source" type="enum">
      The source of the review. Possible values: `google`.
    </ParamField>

    <ParamField body="review_id" type="string">
      The id of the review.
    </ParamField>

    <ParamField body="title" type="string">
      The title of the review.
    </ParamField>

    <ParamField body="comment" type="string">
      The comment of the review.
    </ParamField>

    <ParamField body="rating" type="number">
      The rating of the review.
    </ParamField>

    <ParamField body="created_datetime" type="datetime" default="none">
      The date and time that the review was posted. Example: 2023-01-01T00:00:00
    </ParamField>

    <ParamField body="updated_datetime" type="datetime" default="none">
      The date and time that the review was updated. Example: 2023-01-01T00:00:00
    </ParamField>
  </Expandable>
</ParamField>

### Response

<ResponseField name="request_id" type="string">
  The UUID of the request.
</ResponseField>

### Errors

Listed below are common errors that may be returned by the endpoint, along with their corresponding status code.

Status Code - 400

```json Missing Authorization header theme={null}
{
   "error": {
    "type": "missing_authorization",
    "message": "Your request does not include an 'Authorization' header with a bearer token for your account."
  }
}
```

Status Code - 401

```json Expired Authorization header bearer token value theme={null}
{
   "error": {
    "type": "expired_token",
    "message": "The bearer token you have provided in the 'Authorization' header has expired. Please obtain a new one."
  }
}
```

Status Code - 401

```json Invalid Authorization header bearer token value theme={null}
{
   "error": {
    "type": "invalid_authorization",
    "message": "The bearer token you have provided in the 'Authorization' header is invalid."
  }
}
```

Status Code - 400

Returned if no group id or external reference is passed in the body.

```json No group id or external reference supplied theme={null}
{
   "error": {
    "type": "no_group",
    "message": "You must either provide a group id or group external reference in the request body."
  }
}

```

Status Code - 400

Returned if both a group id and group\_external\_ref are provided

```json Both group id and external ref provided for the unit post-multiple operation theme={null}
{
   "error": {
    "type": "both_group_identifiers_provided",
    "message": "You have provided both a group id and group external reference for the create/update units operation. Please only provide one of the two."
  }
}
```

Status Code - 401

Returned if the authenticated API user does not have access to the requested group.

```json No access to the provided group theme={null}
{
   "error": {
    "type": "no_access_to_group",
    "message": "You do not have access to the group you have provided."
  }
}

```

Status Code - 404

Returned if no group for the provided group ID is found

```json Group with provided ID not found theme={null}
{
   "error": {
    "type": "group_not_found",
    "message": "We could not find a group with the ID you have provided."
  }
}
```

<RequestExample>
  ```bash Example Request theme={null}
  curl --location --request "https://api.travtus.com/messages/'" \
  --header 'Content-Type: application/json' \
  --header 'Authorization: bearer <token>' \
  --data-raw '{
      "group_id": "group-id-1",
      "channel": "review",
      "review": {
        "source": "google",
        "review_id": "review-1",
        "title": "Very good apartment and service!",
        "comment": "Lovely apartment, great rent and service, would recommend!",
        "rating": 5,
        "created_datetime": "2023-01-01T00:00:00"
      }
  }'
  ```
</RequestExample>
