Org/site CRUD.
Create a new org, plus its first admin user, in one call
Public - no token required. A brand-new org has to be creatable with zero prior credentials; there's no other admin who could have authorized it. Rate-limited per source IP at the gateway (5/min) since it's the one mutating route this API exposes without a token.
Create a new org, plus its first admin user, in one call › Request Body
nameadmin_emailadmin_passwordCreate a new org, plus its first admin user, in one call › Responses
Created.
idnameadmin_user_idCreate a site under the caller's own org
admin-only. org_id is the caller's own org, taken from their token - not a request field.
Create a site under the caller's own org › Request Body
nametopic_prefixesTopic prefixes this site owns (e.g. fbf/hospital-a): its points and equipment are the ones under them. Once any site has a prefix, reads are scoped to the caller's sites. Must not overlap another org's prefixes.
Create a site under the caller's own org › Responses
Created.
idorg_idnametopic_prefixesbroker_accounts_updatedThe site's edge-node broker accounts re-applied with the new prefixes.
broker_errorSet when the prefixes were saved but the MQTT broker couldn't be updated; the site's edge nodes keep their old permissions until the next change.
Replace the topic prefixes a site owns
The users in the caller's own org
admin-only. Never includes password hashes.
The users in the caller's own org › Responses
Users, by email.
idemailrolecreated_atsite_idsdisabledCan't log in until enabled again.
display_nameHow the person signs; null when unset
Add a user to the caller's own org
admin-only. org_id is the caller's own org, taken from their token. For a brand-new org's first user, use POST /orgs instead - this endpoint needs an existing admin to call it.
Add a user to the caller's own org › Request Body
emailTrimmed and lower-cased.
passwordroledisplay_nameHow the person signs, e.g. Jacob Nash (Cx waivers name them by it)
site_idsLimit the user to these sites (from GET /sites). Omit or empty for the whole org.
Add a user to the caller's own org › Responses
Created.
idorg_idemailroledisplay_namesite_idsChange a user's role, sites or display name, or disable/enable them
admin-only, own org only. Role and sites are carried in the user's session token, so their sessions end and they log in again (a display_name change alone leaves them signed in); disabling also ends them, and a disabled user's login (password or Haystack SCRAM) fails exactly like a wrong password. You can't change your own role or disable yourself, and the org's last active admin can't be demoted or disabled.
path Parameters
user_idChange a user's role, sites or display name, or disable/enable them › Request Body
rolesite_idsEmpty = the whole org.
disableddisplay_nameHow the person signs, e.g. Jacob Nash; null or blank clears it
Change a user's role, sites or display name, or disable/enable them › Responses
Updated.
idrolesite_idsdisableddisplay_name
