> ## 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 Conversation

> Update the conversation details based on the conversation ID

Update the conversation details based on the conversation ID

```http theme={null}
PUT https://services.leadconnectorhq.com/conversations/{conversationId}
```

## 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="conversationId" type="string" required default="tDtDnQdgm2LXpyiqYvZ6">
  Conversation ID as string
</ParamField>

## Body

<ParamField body="locationId" type="string" required default="tDtDnQdgm2LXpyiqYvZ6">
  Account ID as string
</ParamField>

<ParamField body="unreadCount" type="number" default="1">
  Count of unread messages in the conversation
</ParamField>

<ParamField body="starred" type="boolean" default="True">
  Starred status of the conversation.
</ParamField>

<ParamField body="feedback" type="object" />

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="success" type="boolean" required default="True">
    Boolean value as the API response.
  </ResponseField>

  <ResponseField name="conversation" type="object" required>
    Conversation data of the provided conversation ID.
  </ResponseField>

  ```json theme={null}
  {
    "success": true
  }
  ```
</Accordion>

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

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

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT 'https://services.leadconnectorhq.com/conversations/YOUR_conversationId' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "locationId": "tDtDnQdgm2LXpyiqYvZ6",
    "unreadCount": 1,
    "starred": true,
    "feedback": {}
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/conversations/YOUR_conversationId', {
    method: 'PUT',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"locationId": "tDtDnQdgm2LXpyiqYvZ6", "unreadCount": 1, "starred": true, "feedback": {}}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'PUT',
      'https://services.leadconnectorhq.com/conversations/YOUR_conversationId',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"locationId": "tDtDnQdgm2LXpyiqYvZ6", "unreadCount": 1, "starred": true, "feedback": {}},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/conversations/YOUR_conversationId');
  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({'locationId': 'tDtDnQdgm2LXpyiqYvZ6', 'unreadCount': 1, 'starred': true, 'feedback': {}}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
