Create Subscription for Status Pages
This API endpoint allows you to create a new subscription for statuspage notifications. The request body requires details such as the channel_type and channel_value to subscribe for notifications.

Expected Behavior:


  • On success, the system will create a new subscription and return a success message.
  • If the request is invalid, the system will return an error message with details of the invalid fields.
Request Body Parameters
  • channel_type string
    The type of notification channel. Example: 'email'
  • channel_value string
JavaScript
Response codes
const axios = require('axios');

const url = "https://statuspage-cmd.api.pinghome.io/v1/subscriptions";
const data = { channel_type: 'email', channel_value: 'info@pinghome.dev' };

axios.post(url, data, {
  headers: {
    'Content-Type': 'application/json'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).