Skip to content

13.3Make your first request

Every call, except the screenshot link (13.8), is an HTTP POST request with a JSON body (text in the form {"name": "value"}). Send two headers with every call:

  • Authorization: Bearer <your key>
  • Content-Type: application/json

First save your key and the base address in your shell. Then list your monitors:

List your monitors
bash
export OBSRVLY_KEY=obs_...
export API=https://www.obsrvly.com/api/gw

curl -s "$API/monitor/obsrvly.v1.MonitorConfigService/ListMonitors" \
  -H "Authorization: Bearer $OBSRVLY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit": 50}'

The answer is JSON. Every example in this chapter uses $OBSRVLY_KEY and $API in the same way.

How to write a request body#

  • Write field names in camelCase, such as intervalSeconds. The snake_case form, such as interval_seconds, also works.
  • Write fixed values in full, such as CHECK_TYPE_URL, CHECK_STATUS_DOWN or ASSERTION_OP_EQ.
  • Send binary fields, such as a request body for your monitor, as base64 (binary data written as text).
  • Send {} for a call that needs no fields.
  • Write times in RFC 3339 form (a standard date and time format), such as "2026-10-12T08:14:10Z".

How to read an answer#

  • Fields that are 0, false or empty are left out of the answer. Treat a missing field as 0, false or empty.
  • Times are RFC 3339 strings.
  • Every answer has an X-Request-Id header, such as req_ followed by 12 characters. Failed answers have one too. Quote it when you ask us for help.

Calls that need no key#

ListRegions, ListDnsRecordTypes and DiscoverMonitors work without a key. So do the three public status page calls (13.9).

If your first request fails#

You seeCauseWhat to do
unauthenticated (401), authentication requiredThe key is missing, mistyped or revoked.Check the Authorization header. It must be Bearer and the full key.
invalid_argument (400), unknown field "active" in UpdateMonitorRequestA field name is misspelled. Here the field is activated.Fix the field name and send again.
404, plain text unknown serviceThe <area> part of the address is wrong.Check the address against the table in 13.1.
413, request body too largeThe body is over 4 MiB.Send a smaller body.

Last updated