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

> Modify a post's details.

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

<ParamField body="/posts/:postId" type="path" />

### Path Parameters

<ParamField body="postId" type="string" required>
  Identifier of the post to be updated.
</ParamField>

### Body Parameters

<ParamField body="title" type="string | undefined">
  New title for the post.
</ParamField>

<ParamField body="desc" type="string | undefined">
  Updated description or body of the post.
</ParamField>

<ParamField body="boardId" type="string | undefined">
  New board identifier if the post is being moved.
</ParamField>

<ParamField body="statusId" type="string | undefined">
  New status identifier for updating the post's status.
</ParamField>

<ParamField body="hide" type="boolean | undefined">
  Option to hide the post.
</ParamField>

<ParamField body="pin" type="boolean | undefined">
  Option to pin the post to the top of the board.
</ParamField>

<ParamField body="disableComments" type="boolean | undefined">
  Option to disable comments on the post.
</ParamField>

<ParamField body="etc" type="Date | undefined">
  Additional date or timestamp detail for the post.
</ParamField>

<RequestExample>
  ```javascript curl theme={null}
  // Replace API_KEY with your api key
  curl --location --request PUT 'https://api.supahub.com/api/v1/posts/:postId' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --header 'Authorization: Bearer API_KEY' \
  --data-urlencode 'title=Updated Post Title' \
  --data-urlencode 'desc=Updated description of post.' \
  --data-urlencode 'board=clrjfu0l10009bfg8xy27xy8c' \
  --data-urlencode 'status=clrjfu0l1000cbfg8nkmdx3vl' \
  --data-urlencode 'etc=2024-06-20T16:03:00Z'
  ```

  ```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("title", "Updated Post Title");
  urlencoded.append("desc", "Updated description of post.");
  urlencoded.append("board", "clrjfu0l10009bfg8xy27xy8c");
  urlencoded.append("status", "clrjfu0l1000cbfg8nkmdx3vl");
  urlencoded.append("etc", "2024-06-20T16:03:00Z");

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

  fetch("https://api.supahub.com/api/v1/posts/:postId", 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({
    'title': 'Updated Post Title',
    'desc': 'Updated description of post.',
    'board': 'clrjfu0l10009bfg8xy27xy8c',
    'status': 'clrjfu0l1000cbfg8nkmdx3vl',
    'etc': '2024-06-20T16:03:00Z'
  });

  let config = {
    method: 'put',
    maxBodyLength: Infinity,
    url: 'https://api.supahub.com/api/v1/posts/:postId',
    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/posts/:postId"

  payload = 'title=Updated%20Post%20Title&desc=Updated%20description%20of%20post.&board=clrjfu0l10009bfg8xy27xy8c&status=clrjfu0l1000cbfg8nkmdx3vl&etc=2024-06-20T16%3A03%3A00Z'

  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>
