Locations

Create a location.

This endpoint creates a single location when provided a valid layer_id in the JSON body. Locations must also have either a valid address or latitude and longitude. When adding custom_attributes, if the custom_attribute does not already exist on the layer (based on name), you can set the create_or_update_custom_attributes in the main body of the JSON or create_or_update_custom_attribute in the nested attribute object to create or ignore it. Without this flag, new custom_attributes will return an error. Example request:

curl --location 'https://api.mapulus.com/api/v1/locations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your-token>' \
--data '{
  "lat": -27.4704528,
  "lon": 153.0260341,
  "label": null,
  "title": "Head Office",
  "address": "Brisbane, Australia",
  "external_id": null,
  "travel_contour": true,
  "contour_mode": "driving",
  "contour_metric": "minutes",
  "contour_style": "polygons",
  "contour_minutes": "15",
  "layer_id": "<layer-id>",
  "create_or_update_custom_attributes": true,
  "custom_attributes": [
    {
      "object": "custom_attribute",
      "name": "Location Type",
      "value": "Public Store",
      "create_or_update_custom_attribute": false
    }
  ]
}'
post/api/v1/locations

Request

  • Base URL: https://api.mapulus.com
  • URL: https://api.mapulus.com/api/v1/locations
  • Auth: HTTP bearer

Request body

objectstring
latnumber float nullable
lonnumber float nullable
labelstring nullable
titlestring nullable
addressstring nullable
external_idstring nullable
travel_contourboolean nullable
contour_modestring nullable
contour_metricstring nullable
contour_stylestring nullable
contour_minutesstring nullable
layer_idstring uuid required
create_or_update_custom_attributesboolean

Example request

{
  "object": "location",
  "lat": -27.4704528,
  "lon": 153.0260341,
  "title": "Head Office",
  "address": "Brisbane, Australia",
  "contour_mode": "driving",
  "contour_metric": "minutes",
  "contour_style": "polygons",
  "contour_minutes": "15",
  "create_or_update_custom_attributes": true,
  "custom_attributes": [
    {
      "object": "custom_attribute",
      "name": "Location Type",
      "value": "Public Store"
    }
  ]
}

Response

Success: Creates a single location.

objectstring required
idstring uuid required
latnumber float nullable required
lonnumber float nullable required
labelstring nullable
titlestring nullable
addressstring nullable
external_idstring nullable
geocoding_errorboolean nullable
geocoding_error_typestring nullable
created_atstring date-time required
updated_atstring date-time required
travel_contourboolean nullable
contour_modestring nullable
contour_metricstring nullable
contour_stylestring nullable
contour_minutesstring nullable
map_idstring uuid required
layer_idstring uuid required

Example response

{
  "object": "location",
  "lat": -27.4704528,
  "lon": 153.0260341,
  "title": "Head Office",
  "address": "Brisbane, Australia",
  "contour_mode": "driving",
  "contour_metric": "minutes",
  "contour_style": "polygons",
  "contour_minutes": "15",
  "custom_attributes": [
    {
      "object": "custom_attribute",
      "name": "Location Type",
      "value": "Public Store"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.