Ping Happens API

Authentication

Client accounts (the ones created through Create account on the site) authenticate with a JSON Web Token. Log in or register to receive one:

POST/api/client-auth/register

Create a client account

FieldTypeNotes
userstringEmail address, must be unique
namestringDisplay name
passwordstring8+ characters, at least one letter and one number

Response: { token, client: { id, user } }

POST/api/client-auth

Log in

FieldType
userstring
passwordstring

Response: { token, client: { id, user } }

Send the token on every request that follows: Authorization: Bearer <token>. It expires 2 hours after login. It is also bound to the exact User-Agent header your client sent when logging in — send that same User-Agent value on every subsequent request, or the token will be rejected.

Ownership & visibility

  • You can always read and write your own services and rules.
  • You can never read or write another client's data through the API, even data belonging to a service marked public — public services are for the public status page on the website, not for anonymous or third-party API access. Fetch them from the site itself, or authenticate as the owner.
  • Administrators (staff accounts with the admin role) can read and write any client's data.

Client profile & services

GET/api/client-services/{clientId}

Get a client's profile and services

Returns the client's profile and the list of their services, with a check-status summary for each. Only the account owner or an admin receives every service and the account email; anyone else gets neither.

Services

POST/api/services

Create a service

FieldTypeNotes
userIdstringYour client ID
userstringYour account email
resourcestringService display name
publicbooleanDefaults to false. See Ownership & visibility
rulearrayOne or more rule objects (can be empty)
GET/api/services/{id}

Get a service

Returns the service, its rules, and up to 300 recent check results per rule. A rule's configuration (headers, payload, action) is only included for the owner or an admin.

PATCH/api/services/{id}

Rename a service

FieldType
resourcestring
DELETE/api/services/{id}

Delete a service

Also deletes the service's check history. This cannot be undone.

Rules

POST/api/services/{id}/rules

Add a rule to a service

Body: a rule object.

PATCH/api/services/{id}/rules/{ruleId}

Update a rule

Body: any subset of a rule object's fields.

DELETE/api/services/{id}/rules/{ruleId}

Delete a rule

Removes the rule. Its past check history is kept with the service.

Rule object

FieldTypeNotes
urlstringTarget URL to check, required
methodstringGET | POST | PUT | DELETE
cronstringCron expression, defaults to every 5 minutes
activebooleanDefaults to true
attemptsByAccessnumberRetries per check, 1–3
attemptsDelaynumberDelay between retries in ms, 1–5000
authstringOptional bearer token sent to the target. Write-only — never returned; omit to leave an existing one unchanged
headersarray of { name, value }Extra request headers
payloadobjectJSON request body, for non-GET methods
actionobject or nullOptional webhook, fired when a check's status code matches. Shape: { url, statusCode: number[], headers?, auth? }

Errors

StatusMeaning
400The request body failed validation. The response body includes an error message.
401Missing, invalid, or insufficient credentials for this resource.
404Not found — also returned instead of 401 for a private resource you don't own, so its existence isn't revealed.
500Unexpected server error.