Create an API key
- Open Integrations › API keys (owners and admins).
- Name the key, choose an expiry and its scope: read, or software to also start installs and decide app requests.
- 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_…"| GET | Returns |
|---|---|
/v1/organization | Your organization, plan and device count |
/v1/devices | Devices. Filters: status (active, revoked, all), group_id, online, search |
/v1/devices/{id} | One device with its health facts and open alert count |
/v1/alerts | Alerts. Filters: status (active, open, acknowledged, resolved, all), device_id, since |
/v1/assets | Assets. Filters: status, search |
/v1/assets/{id} | One asset |
/v1/groups | Groups 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 revoked403: the organization is not active, or API access is turned off for it429: more than 300 requests in a minute for this key; wait forRetry-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.
| Event | Sent when |
|---|---|
device.enrolled | A device enrolled, or re-enrolled |
device.revoked | A device was revoked and stopped checking in |
device.deleted | A device was deleted |
device.offline | A device stopped checking in |
device.online | An offline device checked in again |
alert.opened | An alert opened on a device |
alert.acknowledged | Someone acknowledged an alert |
alert.resolved | An alert resolved |
asset.created | An asset was added |
asset.updated | An asset changed |
asset.deleted | An asset was moved to the trash |
software.requested | Someone asked for an app (it needs approval) |
software.request.decided | An app request was approved or declined |
software.finished | An 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.