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

# Update Product Reviews

> Update status, reply, etc of a particular review

Update status, reply, etc of a particular review

```http theme={null}
PUT https://services.leadconnectorhq.com/products/reviews/{reviewId}
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Path parameters

<ParamField path="reviewId" type="string" required default="6578278e879ad2646715ba9c">
  Review Id
</ParamField>

## Body

<ParamField body="altId" type="string" required default="6578278e879ad2646715ba9c">
  Account Id or Agency Id
</ParamField>

<ParamField body="altType" type="string" required>
  Posibles valores: 'account'
</ParamField>

<ParamField body="productId" type="string" required default="6578278e879ad2646715ba9c">
  Product Id
</ParamField>

<ParamField body="status" type="string" required default="approved">
  Status of the review
</ParamField>

<ParamField body="reply" type="object[]">
  Reply of the review

  <Expandable title="cada item">
    <ParamField body="headline" type="string" required default="Amazing product with great quality">
      Headline of the Review
    </ParamField>

    <ParamField body="comment" type="string" required default="This product exceeded my expectations in terms of quality and performance. Highly recommended!">
      Detailed Review of the product
    </ParamField>

    <ParamField body="user" type="object" required>
      User who is giving the review/reply
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="rating" type="number" default="4.5">
  Rating of the product
</ParamField>

<ParamField body="headline" type="string" default="Amazing product with great quality">
  Headline of the Review
</ParamField>

<ParamField body="detail" type="string" default="The product is for sure a must and recommended buy">
  Detailed Review of the product
</ParamField>

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="status" type="boolean" required default="True">
    Status of api action
  </ResponseField>

  <ResponseField name="message" type="string" default="Successfully created">
    Success message
  </ResponseField>

  ```json theme={null}
  {
    "status": true,
    "message": "Successfully created"
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT 'https://services.leadconnectorhq.com/products/reviews/YOUR_reviewId' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "altId": "6578278e879ad2646715ba9c",
    "altType": "account",
    "productId": "6578278e879ad2646715ba9c",
    "status": "approved",
    "reply": [
      {
        "headline": "Amazing product with great quality",
        "comment": "This product exceeded my expectations in terms of quality and performance. Highly recommended!"
      }
    ],
    "rating": "4.5",
    "headline": "Amazing product with great quality",
    "detail": "The product is for sure a must and recommended buy"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/products/reviews/YOUR_reviewId', {
    method: 'PUT',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "productId": "6578278e879ad2646715ba9c", "status": "approved", "reply": [{"headline": "Amazing product with great quality", "comment": "This product exceeded my expectations in terms of quality and performance. Highly recommended!"}], "rating": "4.5", "headline": "Amazing product with great quality", "detail": "The product is for sure a must and recommended buy"}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'PUT',
      'https://services.leadconnectorhq.com/products/reviews/YOUR_reviewId',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "productId": "6578278e879ad2646715ba9c", "status": "approved", "reply": [{"headline": "Amazing product with great quality", "comment": "This product exceeded my expectations in terms of quality and performance. Highly recommended!"}], "rating": "4.5", "headline": "Amazing product with great quality", "detail": "The product is for sure a must and recommended buy"},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/products/reviews/YOUR_reviewId');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'PUT',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
          'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'account', 'productId': '6578278e879ad2646715ba9c', 'status': 'approved', 'reply': [{'headline': 'Amazing product with great quality', 'comment': 'This product exceeded my expectations in terms of quality and performance. Highly recommended!'}], 'rating': '4.5', 'headline': 'Amazing product with great quality', 'detail': 'The product is for sure a must and recommended buy'}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
