Data/Locations/v2/Create
This endpoint was deprecated on 29th September 2025. Please use the latest version.
Creates a new location within a specified Layer. Optionally sets the classification, and adds custom field values.
URL: /data/locations/v2/create
Method: POST
Method Parameters
Name |
Type |
Required |
Description |
|
|
|
The API key for your organisation. |
|
|
|
The object detailing the specified values. See Model Object Properties. |
Model Object Properties
Name |
Type |
Required |
Description |
layerKey |
|
|
The API key matching the Layer in which the record is to be stored. |
|
|
|
The unique key for the record. If this matches an existing record in the Layer specified by the layerKey parameter value, the request will be automatically dealt with by the edit method with the following parameters being passed through:
|
name |
string |
Yes |
The value for the Location’s Name. |
|
|
|
Optional. The postcode in which the new Location is to be positioned. Must be provided if coordinates are null. |
|
|
|
Optional. See Coordinate Object Properties. The coordinates in which the new Location is to be positioned. Must be provided if the postcode is null. |
|
|
|
Optional. The Key of the Classification to be assigned to the new Location on creation. |
|
object array |
No |
Optional. [Deprecated] |
|
|
|
Optional. [Deprecated] |
|
|
|
Optional. See DataField Object Properties. A collection of objects providing values that are stored within DataFields. |
* Whilst postcode and coordinates are both optional properties, at least one must be provided in order to determine a position. If both are provided, the position will be determined using the coordinates.
Coordinate Object Properties
Name |
Type |
Required |
Description |
|
|
|
The value for the Latitude. Ranges from -90.0 to +90.0. |
|
|
|
The value for the Longitude. Ranges from -180.0 to +180.0. |
Relationship Object Properties
This is deprecated. Do not use.
Name |
Type |
Required |
Description |
|
|
|
The unique key of another record to create a relationship with. |
|
|
|
The API key matching the Layer in which the record specified by this objects uniqueKey property value is stored. |
DataField Object Properties
Name |
Type |
Required |
Description |
|
|
|
The API key matching the DataField in which to store the value. |
|
|
|
The value to store in the DataField. Maximum value length of 100 characters. If the DataField is of Text type, values longer than 100 characters will be truncated. If the DataField is of Number type, the minimum value is -9,999,999,999,999.999999 and the maximum value is 9,999,999,999,999.999999. Values less or greater than this will result in an error. If the DataField is of YesNo type, acceptable values are:
Other values will result in a "No" value being stored. If the DataField is of Date type, values should be passed using the YYYY-MM-DD format. |
Response
The following responses may be returned in addition to the standard ones specified under Common Information.
Code |
Error Message |
Notes |
|
The request for the following DataField Key(s) could not be met: { key }, { key }, { key } |
Indicates partial success. The request was carried out successfully for all Keys provided with the exception of the Keys returned in the error message. For any keys returned, either:
|
The request for the following DataField Key and Value combinations could not be met: [{"key":"","value":""}] |
Indicates partial success. The request was carried out successfully for all Keys provided with the exception of the Keys returned in the error message. For any keys returned, either:
|
|
Note: You may receive more than one of the above response messages indicating partial success. | ||
400 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If you wish to use the postcode parameter to position a location, you must have specified a Geocoding layer on the Layer specified by the layerKey parameter value. |
|
|
|
|
|
|
Example call
URL: https://api.vision-mapping.com/data/locations/v2/create?apiKey=INSERT_YOUR_KEY_HERE
Body:
{
layerKey: "abc",
uniqueKey: "abc",
name: "abc",
postcode: null,
coordinates: {
latitudeY: 0.1,
longitudeX: 0.1
},
classificationKey: "abc",
relationships: [
{
uniqueKey: "abc",
layerKey: "abc"
}
],
dataFilterKeys: [
"abc",
"abc1",
"abc2"
],
dataFields: [
{
key: "abc",
value: "abc"
}
]
}
Example response
Response: 200 OK
Message:
"The request for the following Filter Key(s) could not be met: abc1, abc2".