---
title: "Patch a location"
method: PATCH
path: "/locations/{locationId}"
tags: ["Locations"]
---

# Patch a location

`PATCH /locations/{locationId}`

## Request

- Base URL: `https://api.smartthings.com/v1`
- URL: `https://api.smartthings.com/v1/locations/{locationId}`
- Auth: OAuth 2
  - Implicit: `https://auth-global.api.smartthings.com`
  - Scopes: `w:locations:*`
- TypeScript: <https://skmtc.dev/smartthings/apis/smartthings-api/docs/locations/:locationId/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update or unset one or more fields of a specified Location.  If, for a given value, both `toNull=true` and a `value` are provided, the response will be a `422`.

## Request body

- PatchLocationRequest
  - `latitude` object: Settings for the geographic latitude.
    - `value` number: the new value
    - `toNull` boolean: if true, value will be cleared (unset)
  - `longitude` object: Settings for the geographic longitude.
    - `value` number: the new value
    - `toNull` boolean: if true, value will be cleared (unset)
  - `regionRadius` object: Settings for the radius in meters around the latitude and longitude defining the location.
    - `value` integer: the new value
    - `toNull` boolean: if true, value will be cleared (unset)

## Response `200`

A Location.

- UpdateLocationResponse
  - `locationId` string, required: A unique location identifier. This is not guaranteed to be a valid UUID.
  - `name` string, required: A name given for the location (eg. Home)
  - `countryCode` string, required: An ISO Alpha-3 country code. (i.e. GBR, USA)
  - `latitude` number: A geographical latitude.
  - `longitude` number: A geographical longitude.
  - `regionRadius` integer: The radius in meters around latitude and longitude which defines this location.
  - `temperatureScale` string: The desired temperature scale used within location. Value can be F or C.
  - `timeZoneId` string: A valid Java Time Zone ID for the location. This can be specified in the create or update request, or it can be generated based on the latitude and longitude.
  - `locale` string: We expect a POSIX locale but we also accept an IETF BCP 47 language tag.
  - `backgroundImage` string: Not currently in use.
  - `additionalProperties` object: Additional information about the location that allows SmartThings to further define your location.
  - `parent` LocationParent: The parent of a Location. Intended to be used only in MFU contexts.
    - `type` 'LOCATIONGROUP' | 'ACCOUNT': The type of the Location's parent.
    - `id` string, ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$: The ID of the parent
  - `created` string, date-time: The timestamp of when a location was created in UTC.
  - `lastModified` string, date-time: The timestamp of when a location was last updated in UTC.

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `422`: Unprocessable Entity
- `429`: Too many requests
- `default`: Unexpected error

## Changes

- **2023-11-27** `e8dd260a33ec`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/smartthings/apis/smartthings-api/changes/locations/:locationId/patch.md)

---

[API](https://skmtc.dev/smartthings/apis/smartthings-api.md) - [All operations](https://skmtc.dev/smartthings/apis/smartthings-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smartthings/apis/smartthings-api/revisions/2788a4236800?raw)
