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

# Update Comment

> Edit or pin/unpin a comment.

<ParamField body="PUT" type="method" />

<ParamField body="/comments/:commentId" type="path" />

### Path Parameters

<ParamField body="commentId" type="string" required>
  Unique identifier of the comment being requested.
</ParamField>

### Body Parameters

<ParamField body="commentDescription" type="string | undefined">
  Description of the comment.
</ParamField>

<ParamField body="pinComment" type="boolean | undefined">
  Flag to pin or unpin the comment.
</ParamField>

<RequestExample>
  ```javascript curl theme={null}
  // Replace API_KEY with your api key
  curl --location --request PUT 'https://api.supahub.com/api/v1/comments/:commentId' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --header 'Authorization: Bearer API_KEY' \
  --data-urlencode 'commentDescription=Updated comment text' \
  --data-urlencode 'pinComment=false'
  ```

  ```javascript fetch theme={null}
  const myHeaders = new Headers();
  myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
  myHeaders.append("Authorization", "Bearer API_KEY"); // Replace API_KEY with your api key

  const urlencoded = new URLSearchParams();
  urlencoded.append("commentDescription", "Updated comment text");
  urlencoded.append("pinComment", "false");

  const requestOptions = {
    method: "PUT",
    headers: myHeaders,
    body: urlencoded,
    redirect: "follow",
  };

  fetch("https://api.supahub.com/api/v1/comments/:commentId", requestOptions)
    .then((response) => response.text())
    .then((result) => console.log(result))
    .catch((error) => console.error(error));
  ```

  ```javascript axios theme={null}
  const axios = require('axios');
  const qs = require('qs');
  let data = qs.stringify({
    'commentDescription': 'Updated comment text',
    'pinComment': 'false'
  });

  let config = {
    method: 'put',
    maxBodyLength: Infinity,
    url: 'https://api.supahub.com/api/v1/comments/:commentId',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': 'Bearer API_KEY' // Replace API_KEY with your api key
    }
    data : data
  };

  async function makeRequest() {
    try {
      const response = await axios.request(config);
      console.log(JSON.stringify(response.data));
    }
    catch (error) {
      console.log(error);
    }
  }

  makeRequest();
  ```

  ```python python theme={null}
  import requests

  url = "https://api.supahub.com/api/v1/comments/:commentId"

  payload = 'commentDescription=Updated%20comment%20text&pinComment=false'

  headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Authorization': 'Bearer API_KEY' # Replace API_KEY with your key.
  }

  response = requests.request("PUT", url, headers=headers, data=payload)

  print(response.text)
  ```
</RequestExample>
