Create Site

Create a new site record belonging to an account. Required fields: - `accountId`: The account this site belongs to. - `fullAddress` or `geoLocation`: At least one must be provided. The backend geocodes `fullAddress` to derive coordinates. If a site with the same address already exists for the same account, the existing site is returned instead of creating a duplicate (`200` instead of `201`).

Authentication

x-api-keystring
API Key authentication via header

Request

This endpoint expects an object.
accountIdintegerRequired
ID of the account this site belongs to.
fullAddressstringOptional

Full address string. Either fullAddress or geoLocation must be provided.

geoLocationstringOptional

Latitude/longitude as “lat,lng”. Either fullAddress or geoLocation must be provided.

titlestringOptional<=255 characters

Human-readable label for the site.

streetstringOptional
citystringOptional
statestringOptional
zipcodestringOptional

Response

Duplicate site found — existing site returned

idintegerOptional
Unique site ID.
accountIdintegerOptional
ID of the account this site belongs to.
titlestring or nullOptional

Human-readable label for the site (e.g. “Main Office”).

fullAddressstring or nullOptional
Full formatted address string.
streetstring or nullOptional
citystring or nullOptional
statestring or nullOptional
zipcodestring or nullOptional
geoLocationstring or nullOptional

Latitude/longitude as “lat,lng” (e.g. “37.7749,-122.4194”).

timezonestring or nullOptional

IANA timezone string (e.g. “America/Los_Angeles”).

createdAtstring or nullOptionalformat: "date-time"
updatedAtstring or nullOptionalformat: "date-time"

Errors

400
Bad Request Error
401
Unauthorized Error