Locations
Create a Location
Changed onCreate a Location for a user. The Location will be created geographically close to the country code provided in the request body. If Location creation is not supported in the requested country code, the API will return a 422 error response with an error code of UnsupportedGeoRegionError.
post/locations
Request
- Base URLhttps://api.smartthings.com/v1
- AuthOAuth 2Implicithttps://auth-global.api.smartthings.comScopesw:locations:*
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
allowedstring
If set to true, the response may contain the allowed list property. Note that setting this to true may significantly slow the response time. If you are creating a location for your own account, then you know you will have all these permissions and can avoid the trouble of passing in this parameter.
Request body
Example request
{
"name": "Home",
"countryCode": "USA",
"latitude": 45.00708112,
"longitude": -93.11223629,
"regionRadius": 150,
"temperatureScale": "F",
"timeZoneId": "America/Chicago",
"locale": "en_US",
"parent": {
"type": "LOCATIONGROUP",
"id": "6ecb6c06-7319-49b1-8ebd-f97660efdd06"
}
}Response
Created successfully.
Example response
{
"locationId": "6b3d1909-1e1c-43ec-adc2-5f941de4fbf9",
"name": "Home",
"countryCode": "USA",
"latitude": 45.00708112,
"longitude": -93.11223629,
"regionRadius": 150,
"temperatureScale": "F",
"timeZoneId": "America/Chicago",
"locale": "en_US",
"parent": {
"type": "LOCATIONGROUP",
"id": "6ecb6c06-7319-49b1-8ebd-f97660efdd06"
},
"created": 1547920800
}Changes
- info
added the new optional
queryrequest parameterallowed
- info