PointrusHelp centerBilling and developers

API and webhooks

Read devices, alerts, assets and groups with an API key, and receive signed events at your own HTTPS endpoint.

Updated

All help articles

Billing and developers

Plans and billingAPI and webhooks

Create an API key

  1. Open Integrations › API keys (owners and admins).
  2. Name the key, choose an expiry and its scope: read, or software to also start installs and decide app requests.
  3. Copy the key. It starts with ptk_ and is shown only once; Pointrus keeps only a hash of it.

A key reads one organization. An organization can have up to 25 keys; revoke one in the same place.

Make a request

curl https://app.pointrus.io/api/v1/devices?online=false \
  -H "Authorization: Bearer ptk_…"
GETReturns
/v1/organizationYour organization, plan and device count
/v1/devicesDevices. Filters: status (active, revoked, all), group_id, online, search
/v1/devices/{id}One device with its health facts and open alert count
/v1/alertsAlerts. Filters: status (active, open, acknowledged, resolved, all), device_id, since
/v1/assetsAssets. Filters: status, search
/v1/assets/{id}One asset
/v1/groupsGroups with their device counts

Lists take limit (default 100, at most 500) and offset, and return data, total, limit, offset and has_more. Times are ISO 8601 in UTC.

Errors and limits

  • 401: the key is missing, invalid, expired or revoked
  • 403: the organization is not active, or API access is turned off for it
  • 429: more than 300 requests in a minute for this key; wait for Retry-After (60 seconds)

Webhooks

Add an endpoint in Integrations › Webhooks: a public HTTPS address (redirects are not followed) and the events it should receive, or all of them. An organization can have up to 10 endpoints.

EventSent when
device.enrolledA device enrolled, or re-enrolled
device.revokedA device was revoked and stopped checking in
device.deletedA device was deleted
device.offlineA device stopped checking in
device.onlineAn offline device checked in again
alert.openedAn alert opened on a device
alert.acknowledgedSomeone acknowledged an alert
alert.resolvedAn alert resolved
asset.createdAn asset was added
asset.updatedAn asset changed
asset.deletedAn asset was moved to the trash
software.requestedSomeone asked for an app (it needs approval)
software.request.decidedAn app request was approved or declined
software.finishedAn install, update or uninstall finished on a device

Each delivery is a JSON POST with id, type, created_at, organization and data, and the headers Pointrus-Event, Pointrus-Event-Id and Pointrus-Delivery.

Verify the signature

Every delivery carries Pointrus-Signature: t=<unix seconds>,v1=<hex>, where v1 is HMAC-SHA256 with your endpoint’s secret over <t>.<raw body>. Check it against the raw body, before parsing, and reject old timestamps:

import hmac, hashlib

def verify(secret: str, header: str, body: bytes) -> bool:
    parts = dict(p.split("=", 1) for p in header.split(","))
    signed = parts["t"].encode() + b"." + body
    expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, parts["v1"])

Retries

Answer with any 2xx status within 10 seconds. Failed deliveries are retried with backoff, from 1 minute up to 12 hours, 7 attempts in all; an endpoint that keeps failing is paused. Use Pointrus-Event-Id to ignore a delivery you have already handled.

The full reference, with every field and the software and portal endpoints, is at app.pointrus.io/developers.html.

Still stuck?

Signed in? Open Help & support in the console and attach a screenshot. Or email [email protected]. The team that builds Pointrus answers.