Skip to content

location

Deprecated

This endpoint will stop working on 1 August 2027. Migrate to POST /v1/sites in the new API; the migration guide has the recommended order of work and the important model differences.

Legacy /rest/contact/location was an upsert by locationRef and accepted an optional attributes section. The new API splits this into POST /v1/sites (create) and PATCH /v1/sites/{id} (update); custom site attributes are not part of the v1 sites payload.

Open POST /v1/sites in the new API →

View legacy reference

/rest/contact/location


POST

This API adds or updates a Location and its attributes. 

  • attribute section is optional
  • if attribute is not present on site type, ignore

acceptable request representations:

  • application/json

  • ignoreUsageTypeOnUpdate : this is a non mandatory field which is used to determine whether the usageTypeId field is updated should the site already exist in Oneserve. If set to 1 it won't override the current usage type on the existing site, if set to 0 or not provided it will update it.

          { "clientRef":"ddhs",            "locationRef":"abc123",
            "groupId":"23",
            "ignoreUsageTypeOnUpdate":"1",            "usageTypeId":"34",
            "regionId":"3",
            "typeId":"9",
            "name":"Allen Ave, 12",
            "address1":"12 Allen Ave",
            "address2":"Eastleigh",
            "address3":"Oxon",
            "address4":"",
            "postCode":"DF8 89H",
            "statusId":"2",
            "area":"North",
            "considerations":"cat",            "deleted":"True"            "attributes" : [              { "name" : "Number of Windows",                "value" : "5" },              { "name" : "Colour",                "value" : "Red" }              
            ]          }

available response representations:
  • 200 - application/json

{
    "result" : "success or fail",
    "result_msg" : "error message"
}

Field specification details:

Rest API Field Specification - Location
Rest API Field Specification - Location


See the Contact API matrix for the full list of endpoints in this category.