Locations
Update selected fields
Change selected fields and clear values without resending the location.
PATCH
Requires
JavaScript examples run in Node.js 22 or later; PHP examples require PHP 8.2 or later with cURL. Both read
You do not need to resend the name, city, hours, filters, or other saved information. See Create a location for public field names.
Short or full weekday names are accepted. Values are strings such as
Supplied keys are added or updated; omitted keys keep their attachments. A key with a null value removes that attachment.
location:update and project API access. Send a JSON object containing only the fields you want to change. Omitted inputs and attachments keep their saved values; generated addresses can refresh when address components change, as described below.
Returns 200 and the updated location.
Run write requests with the cURL, JavaScript or PHP examples. They change real location data; use a location you created for testing.
string
required
The public project ID.
string
required
The public location ID belonging to the project.
string | null
Change the phone, or send null to clear it.
string
If supplied, a nonempty string of at most 255 characters.
string
If supplied, a nonempty string of at most 255 characters.
boolean
Show or hide the location.
false is valid; null is not.object | null
Update selected weekdays, send
{} to preserve hours, or null to remove the schedule.object | null
Merge named custom fields. Null values remove attachments.
object | null
Merge named calls to action. Null values remove attachments.
array | string | null
Replace the filter list;
[] or null clears it.STOREROCKET_TOKEN from your environment. See the quickstart for setup.
Test an update
- Read your test location with
includeHours=1and record its phone, name, city and hours. - Replace
PROJECT_ID,LOCATION_IDandYOUR_TOKENin the cURL example. JavaScript and PHP useSTOREROCKET_TOKENfrom the quickstart. - Run the example. Expect
200withdata.phoneset to555-0101. - Read the same location again with
includeHours=1. The phone has changed; the omitted name, city and hours are unchanged.
includeHours=1 or the matching include flag. Expect the result shown in each table. Restore any values you want to keep after testing.
Opening hours
Update just Monday without changing other days:09:00-17:00, closed, or null. If a schedule does not yet exist, omitted days stay unset.
Hours are an object, not an array. Avoid conflicting short and full names for the same day. Removing a schedule from a location does not delete a reusable hours template.
Custom fields and calls to action
{} does nothing. Null for the whole object clears every attachment of that kind from this location.
Filters, markers, types, and cover
A supplied marker ID, location-type name, or stored cover image must belong to this project. An invalid selection returns
422 and saves nothing.
Other fields and generated values
Send null to clear nullable text fields, including phone, email, website, and social profiles.name, city, and visible cannot be null. Zero coordinates and false visibility are valid.
Use public field names. Internal fields such as project_id and location_type_id are ignored. socials is a response field; send the individual profile fields.
Changing address components refreshes an automatically generated address or display_address. A custom combined address is preserved when omitted. Send "address": null to regenerate it from saved components; clearing a slug can generate one from the location.
PATCH touching address/coordinate fields queues geocoding only if a coordinate is missing. Other PATCH requests do not trigger geocoding. The immediate response may precede a queued geocode result.
Atomic validation
Invalid input returns422 with message and errors; no portion of that update is saved. See errors.
This endpoint accepts application/json; its object/array/null behavior is the StoreRocket contract described here.