Developer reference
ReliefGrid API
ReliefGrid uses JSON REST routes. Authenticated data is scoped to the signed-in organization. Every mutating route requires a same-origin request; authenticated routes also check the caller’s session and role. Validation errors return 400, missing access returns 401 or 403, and invalid state transitions return 409.
POST /api/facilities/{facilityId}/booking-link
Create or rotate a scoped 30-day public dock booking link; rotating revokes its predecessor.
Access: Signed-in organization Owner/Admin; same-origin.
GET / POST /api/book
Read the linked distribution center’s public booking details or book a 30-minute door appointment without an account. The bearer token is sent in the x-reliefgrid-booking-token header; booking URLs keep it in the browser fragment.
Access: Active facility booking link; POST is same-origin.
GET /api/workspace
Read organization-scoped facilities, incidents, shipments, events, team, and setup data.
Access: Signed-in organization member.
POST /api/workspace
Run workspace actions including shipment creation, carrier selection, sequential status advancement, dispatcher delivery records, and delivery exception events.
Access: Signed-in member; action-specific role checks; same-origin.
GET / POST /api/operations
Read and write organization-scoped operations records. Record-book entries are hash-chained.
Access: Signed-in member; writes require action roles and same-origin.
GET /api/workspace/audit
Read organization administration audit events.
Access: Signed-in organization Owner/Admin.
POST /api/record-book/corrections
Append a correction that references an existing entry. The source entry is not changed.
Access: Signed-in Owner/Admin/Dispatcher; same-origin.
POST / DELETE /api/shipments/{shipmentId}/driver-link
Issue or revoke a seven-day no-login driver progress link.
Access: Signed-in Owner/Admin/Dispatcher; same-origin.
GET / POST /api/driver
Read shipment progress or append the next driver progress event. Send the link token in the x-reliefgrid-driver-token header; newly issued links keep it in the browser fragment. A driver link cannot confirm receipt.
Access: Active driver link.
POST /api/shipments/{shipmentId}/receiver-link
Issue a seven-day receiver confirmation link for an Arrived shipment.
Access: Signed-in Owner/Admin/Dispatcher; same-origin.
GET / POST /api/receiver
Read limited delivery details or confirm receipt as the receiver with name, method, quantity, and timestamp. Send the link token in the x-reliefgrid-receiver-token header; newly issued links keep it in the browser fragment.
Access: Active receiver link; POST is same-origin.
GET /api/check-in
Resolve a facility for the no-login driver check-in flow. The code is not sent in the URL path or query.
Access: Facility code in x-reliefgrid-check-in-code header; new no-login links keep it in URL fragment.
POST /api/check-in
Start a facility visit or record its departure. A visit token expires after 12 hours.
Access: Active facility code or visit token; same-origin.
POST /api/facilities/{facilityId}/check-in-code
Rotate a facility code. The 256-bit code is returned once and expires after 30 days.
Access: Signed-in organization Owner/Admin; same-origin.
POST /api/reports/{incidentId}/pdf
Generate an incident PDF with the generation time and verification hash.
Access: Signed-in organization member; same-origin.
POST /api/csv-export
Export an authorized, organization-scoped CSV snapshot.
Access: Signed-in organization member; source authorization.
GET / POST /api/coordination/shares
List share links or create a read-only link scoped to one incident. The token is returned once, expires after 30 days, and is stored as a hash.
Access: Signed-in organization Owner/Admin; writes are same-origin.
DELETE /api/coordination/shares/{shareId}
Revoke an incident link. Revoked and expired links cannot read or export.
Access: Signed-in organization Owner/Admin; same-origin.
GET /coordination#token
Open the read-only Coordination View for that incident only.
Access: Active incident share token; token stays in URL fragment.
GET /api/coordination/share
Read shipments, delivery status, referenced facilities, and open exceptions for one incident.
Access: Active incident share token in x-reliefgrid-share-token header.
GET /api/coordination/share/pdf and /csv
Export delivery records, event times, receiver status, all incident exceptions, record-book hashes, generation time, and a verification hash.
Access: Active incident share token in x-reliefgrid-share-token header.
GET / PUT / POST /api/coordination/webhook
Read attempt history, set or clear the HTTPS endpoint, rotate the signing secret, or replay a failed event. Mutations are same-origin.
Access: Signed-in member for history; Owner/Admin/Dispatcher to configure, rotate, and replay.
GET / POST / PATCH /api/coordination/exceptions
Read, open, or resolve an incident exception. Open and resolution are appended to the record book.
Access: Signed-in member to read; Owner/Admin/Dispatcher to write; same-origin writes.
POST /api/account/mfa
Begin TOTP enrollment, complete enrollment, or verify a TOTP challenge.
Access: Signed-in account.
Shipment statuses and actions
Shipment creation requires a carrier selected by the organization. The saved status is Carrier selected. A manager can select a carrier for a Requested shipment; only the organization’s own carrier records are accepted. A missing carrier returns 404, and an already-advanced shipment returns 409.
Owner, Admin, or Dispatcher can advance the normal path one step at a time: Carrier selected → Pickup scheduled → Picked up → En route → Arrived. A driver link can append progress through Arrived, but cannot select a carrier or confirm receipt. An invalid or concurrent transition returns 409. Delivery confirmation is available only from Arrived through the receiver link. A dispatcher’s evidence action appends the exact label “recorded by dispatcher — not receiver-confirmed”, keeps the status at Arrived, and does not send shipment.received.
Owner, Admin, or Dispatcher can append one of Rejected, Partial, Damaged, Rerouted, Returned, Cancelled, or Disputed as a new event with its supplied note. These status events are stored in the shipment timeline and record book; prior events remain. Delivery confirmed, Rejected, Returned, and Cancelled are terminal. Attempting an invalid transition returns 409.
Each shipment stores contents, quantity, quantity units, and the organization’s reference ID. Receiver confirmation stores the receiver-entered name, selected method (signed at delivery, phone confirmation, or paper receipt), received quantity, notes, and confirmation time. Driver reports are labeled and projected separately from receiver confirmation.
Webhook schema and signature
The JSON body has id (a unique random event ID), type, occurredAt (UTC ISO timestamp), incidentId, resourceId, and data (an object whose values are strings, numbers, booleans, or null). Event types are shipment.created, shipment.dispatched, shipment.arrived, shipment.received, exception.opened, and exception.resolved. The HTTP header x-reliefgrid-event-id repeats body id.
Each organization has its own random 256-bit signing secret, stored encrypted. Owners, Admins, or Dispatchers can generate or rotate it in Coordination controls or with POST /api/coordination/webhook and action rotate_secret. The secret is returned once; copy it then. ReliefGrid computes HMAC-SHA-256 over the exact UTF-8 request body bytes and sends x-reliefgrid-signature: sha256=<lowercase hex digest>. Verify the unmodified raw body before parsing JSON.
Signed example
Sample secret (not for production): rg_sample_secret_001_not_for_production
{"id":"evt_sample_01","type":"shipment.received","occurredAt":"2026-11-29T15:00:00.000Z","incidentId":"sample_incident_01","resourceId":"sample_shipment_01","data":{"receiverConfirmed":true,"quantityReceived":20,"confirmedAt":"2026-11-29T15:00:00.000Z"}}Expected header: x-reliefgrid-signature: sha256=67a4b0e28e02e642f3f6a9249492279ab38fc434bafd20832e3112f4eb58e809
Retry behavior: attempt 1 is immediate; on failure, later attempts run after 1 hour, 6 hours, and 24 hours. There are 4 attempts per delivery cycle. The database outbox stores the event, endpoint and encrypted signing-secret snapshot so retries survive restarts and keep the original body and key. The scheduled worker checks hourly and also honors each due time. The attempt log exposes event ID, attempt number, result, response status and safe error summary. A final failed event can be replayed by a manager; replay starts a new four-attempt cycle with the same event ID and original payload. The endpoint must return any 2xx response for success.
Token lifetimes, use records, and lockout
- Driver progress links: 7 days; an Owner, Admin, or Dispatcher can revoke the current link or replace it with a new one.
- Receiver confirmation links: 7 days; successful confirmation makes the link unusable.
- Facility check-in codes: 30 days; code entry locks after 5 wrong guesses within a 15-minute window, for 15 minutes.
- Facility dock booking links: 30 days; Owner/Admin rotation revokes the previous link.
- Facility visit departure tokens: 12 hours.
- Incident share links: 30 days and revocable by the sharing organization.
- Organization invitations: 7 days.
Link and code values are random 256-bit base64url tokens. Facility codes, driver links, receiver links, visit tokens, and share links are stored as SHA-256 hashes. Issuance and every attempted use of driver, receiver, facility check-in, facility visit, facility booking, and incident-share tokens are recorded with token type, action, outcome, time, and target when known; logs store only the token hash, never the raw token. Check-in throttling uses a keyed fingerprint of the forwarded client address and user-agent, not the submitted code.
Public dock booking
An Owner or Admin can create a no-login booking link for a distribution center. Its token appears after the # in /book URLs and is sent to the fixed /api/book endpoint in the x-reliefgrid-booking-token header, so the token is not sent with the page request. It contains a random 256-bit token, expires after 30 days, and rotation revokes the prior link. The public page reveals only that facility’s name and dock-door labels. A visitor can book a future 30-minute door slot before the link expires by entering a load label and local time; overlapping appointments on that door return 409. Each open and booking attempt is logged against the token hash. The created appointment appears on the facility door board and in the organization audit log.
Partner sharing and audit records
Newly created partner share links put the random bearer token after the # in /coordination URLs. The viewer sends it in the x-reliefgrid-share-token header to fixed read and export routes, so the token is not sent in the request URL. A partner share link grants read-only access to exactly one incident: its shipment records, delivery events, facilities referenced by those shipments, and open exceptions. It does not create membership or expose another incident. The Coordination View has filters and no mutation action. PDF and CSV exports include open and resolved exceptions, shipment timelines, receiver status, the relevant record-book entries, generation timestamp, and verification hash. The link expires after 30 days and an Owner or Admin can revoke it; later page, API, or export requests are rejected. Each link access and failed token use is logged by hash.
The organization audit log records share creation and revocation, webhook endpoint changes, signing-secret rotation, webhook replay, facility booking-link rotation, public dock appointments, proof exports, and appended record corrections. Token-use logs separately record hashed link and check-in attempts. Record-book rows form a SHA-256 chain: the canonical entry fields and previous entry hash produce each entry hash. Corrections append a new entry containing correctsEntryId; no correction overwrites or deletes its source entry.
Multi-factor authentication
Any signed-in account can enroll an authenticator app using TOTP: 6 digits, 30-second periods, SHA-1, with a one-step clock window. Owner and Admin pages require enrollment and a verified TOTP challenge. A verified session grant lasts 10 minutes. Public dock booking by link and driver check-in remain no-login flows.
Product boundaries
ReliefGrid tracks and proves deliveries. It does not select, rank, recommend, assign, or book carriers, negotiate rates, arrange transportation, or handle freight payments. It is not a federal production system. Incident records and delivery events are not EOC-platform tools.