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

idinteger
Unique site ID.
accountIdinteger
ID of the account this site belongs to.
titlestring or null

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

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

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

timezonestring or null

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

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

Errors

400
Bad Request Error
401
Unauthorized Error