GeoSeal Business API

Connect your own systems: read photos, alerts and sites, and get new ones as they happen.

API keys

An owner or admin makes a key in the dashboard, under Settings, API and webhooks. It is shown once; we keep only a fingerprint of it. Keys only read: nothing can be changed through them. Revoke a key there and it stops at once.

curl https://geoseal.app/api/v1/company/photos \
  -H "Authorization: Bearer gsk_…"

Up to 60 requests a minute from one address. Times are UTC milliseconds.

What you can read

  • GET /api/v1/company/photos?since=<receivedAt>&limit=100: photos in the order they arrived, oldest first. Pass the next value as since for the next page; it is null on the last.
  • GET /api/v1/company/photos/<recordId>: one photo, with photoUrl and thumbUrl links valid for 10 minutes.
  • GET /api/v1/company/alerts?since=<createdAt>&limit=100: alerts in the order they were raised.
  • GET /api/v1/company/sites: sites, their shapes, schedules and checkpoints.

A photo carries when it was taken (by geoseal.app's clock where the phone allowed it) and received, the member, site and checkpoint, the position, address, notes, any incident, its flags and whether it is the sealed photo. Anyone can check a photo file at geoseal.app/verify.

Webhooks

Add an https address in the same place, and GeoSeal posts to it when a photo arrives (photo.received) and when an alert is raised (alert.created). The body is JSON: {"event", "id", "createdAtUtcMillis", "companyId", "data"}, where data is the photo or the alert as the API shows it.

Answer with any 2xx status. Otherwise GeoSeal tries again, waiting longer each time, for about a day. The same delivery can arrive twice, so use id to ignore repeats. Addresses inside private networks are refused, and redirects are not followed.

Check that a webhook came from GeoSeal

Each request has a header GeoSeal-Signature: t=<unix seconds>,v1=<signature>. The signature is the hex HMAC-SHA256 of t + "." + the raw body, keyed with the webhook's secret, which is shown once when you add the webhook. Refuse a request whose signature differs, or whose t is more than 5 minutes old.

import crypto from 'node:crypto';

function fromGeoSeal(rawBody, header, secret) {
  const [, t, v1] = /^t=(\d+),v1=([0-9a-f]{64})$/.exec(header ?? '') ?? [];
  if (!t || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
  return crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
}

Privacy

What you read or receive is your company's own data about its team, as the privacy policy describes. Once it reaches your systems, keeping it safe and deleting it on time is up to your company.