Status Pages updates & messages in our API

We'll assume you've already got the API authentication settled and you have our API key with you (this is the Authorization header in all the examples used below).

Each status page can contain updates or messages. These are used to communicate to your customers or clients in times of downtime or maintenance.

You can post these messages from your dashboard or with our API.

List all your updates for a status page #

To list the updates or messages from a single status page, you'll need to know its ID. You can retrieve that using the /api/status-pages API call explained in the status pages API documentation.

Once you have your ID, you can get the details as follows:

$ curl https://ohdear.app/api/status-pages/1/updates \
    -H 'Authorization: Bearer bgUKSWYL30iHg5w0WTDGHfubt5L1HBTr0atAehCeSqwNTqkU9rOmsNEmWf6Y' \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'

The resulting output will contain an array of all the updates to that specific status page.

If there are no status messages, the array will be empty.

{
  "data": [],
}

If there are messages, we'll return those in the data field.

{
  "data": [
    {
      "id": 65,
      "title": "3rd party API issue resolved",
      "text": "We have contacted our API provider and they have resolved the situation, everything is back to normal. We apologize for the inconvenience!",
      "pinned": false,
      "severity": "resolved",
      "time": "2019-09-16 08:24:00"
    },
    {
      "id": 64,
      "title": "We are experiencing an outage on our service",
      "text": "Due to errors in our 3rd party API provider, we are experiencing an outage of our website. Our team is working on getting it resolved ASAP.",
      "pinned": false,
      "severity": "high",
      "time": "2019-09-16 08:11:00"
    }
  ],
}

These are sorted by newest message to oldest. The output contains the following fields:

  • id: the ID of that particular update
  • title and text: these are shown on your status page
  • pinned: when set to true, this update will be posted at the very top of your status page. There can only be 1 pinned message.
  • severity: these can be info, warning, high or resolved. You are free to use these any way you like. The resolved updates will be posted in green on your status page to inform the user the problem has been resolved.
  • time: the date in UTC at which this status page was posted. This will get translated to your configured timezone.

Post a new update to your status page #

To add a new update or message to your status page, you can make a POST call to the /api/status-page-updates endpoint.

$ curl -X POST https://ohdear.app/api/status-page-updates \
    -H 'Authorization: Bearer bgUKSWYL30iHg5w0WTDGHfubt5L1HBTr0atAehCeSqwNTqkU9rOmsNEmWf6Y' \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{"status_page_id":1, "title":"Our site is down", "text":"We are working on it!", "severity":"high", "time":"2019-09-16 10:24","pinned":true}'

As a confirmation, we'll return an HTTP/1.1 201 Created with the received data fields.

{
  "id":66,
  "title":"Our site is down",
  "text":"We are working on it!",
  "pinned":true,
  "severity":"high",
  "time":"2019-09-16 08:24:00"
}

The POST API call should contain a valid json body with the following fields.

  • status_page_id: the ID of the status page where you want to add this update.
  • title: the titel of your status update
  • text: a longer text describing what is happening or how you're resolving the problem
  • severity are: info, warning, high or resolved.
  • time: a date field that acts as a timestamp for this update, should be in UTC in the Y-m-d H:i format.
  • pinned: whether this status page message should be pinned to the very top of the page. There can only be 1 pinned message, when set to true it will remove the pinned attribute from any other message.

Delete an update on your status page #

Let's use the API to delete the status message we just posted above, the one with ID 66.

$ curl -X DELETE https://ohdear.app/api/status-page-updates/66 \
    -H 'Authorization: Bearer bgUKSWYL30iHg5w0WTDGHfubt5L1HBTr0atAehCeSqwNTqkU9rOmsNEmWf6Y' \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'

If the response code is HTTP/1.1 204 No Content, the deletion of the status update was successful.

Was this page helpful to you? Feel free to reach out via support@ohdear.app or on Twitter via @OhDearApp if you have any other questions. We'd love to help!