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

# Subscribe

> Subscribe or Unsubscribe to changelog updates.

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

<ParamField body="/changelogs/subscribe" type="path" />

### Body Parameters

<ParamField body="userEmail" type="string" required>
  Email address of the user subscribing to updates.
</ParamField>

<ParamField body="userName" type="string">
  Name of the subscribing user.
</ParamField>

<ParamField body="subscribe" type="boolean" required>
  Set to `true` to subscribe, `false` to unsubscribe.
</ParamField>

<RequestExample>
  ```javascript curl theme={null}
  // Replace API_KEY with your api key and :changelogId with changelog id
  curl --location --request PUT 'https://api.supahub.com/api/v1/changelogs/subscribe' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --header 'Authorization: Bearer API_KEY' \
  --data-urlencode 'userEmail=useremail@domain.com' \
  --data-urlencode 'subscribe=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("userEmail", "useremail@domain.com");
  urlencoded.append("userName", "User Name");
  urlencoded.append("subscribe", "false");

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

  fetch("https://api.supahub.com/api/v1/changelogs/subscribe", 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({
    'userEmail': 'useremail@domain.com',
    'userName': 'User Name',
    'subscribe': 'true'
  });


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

  payload = 'userEmail=useremail@domain.com&userName=User%20Name&subscribe=true'

  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>
