Skip to content

Update Location Stay

PATCH
/users/{user_id}/location-stays/{stay_id}
curl --request PATCH \
--url https://example.com/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/location-stays/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Content-Type: application/json' \
--data '{ "place_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Correct a single auto-detected visit’s place. Stamps the chosen place’s name/source onto this stay (or clears it back to the identify queue when place_id is null).

Note on durability: stays inside the job’s recent rolling window are deleted + recomputed on the next run, which re-resolves the place geometrically. So a lasting correction also depends on the chosen place actually being nearest to this spot — the client creates/moves a place at the visit’s centroid so the geometry agrees. Older (frozen) stays keep this stamp indefinitely.

user_id
required
User Id
string format: uuid
stay_id
required
Stay Id
string format: uuid
Media typeapplication/json
StayUpdate

Reassign a single dwell to a place (or clear it). place_id=null un-labels the visit, returning it to the identify queue.

object
place_id
Any of:
string format: uuid
Examplegenerated
{
"place_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Successful Response

Media typeapplication/json
StayRead

A derived dwell cluster — where the user stayed and for how long.

object
arrived_at
required
Arrived At
string format: date-time
departed_at
required
Departed At
string format: date-time
duration_minutes
required
Duration Minutes
number
id
Any of:
string format: uuid
lat
required
Lat
number
lng
required
Lng
number
place_name
Any of:
string
place_source
Any of:
string
sample_count
required
Sample Count
integer
Examplegenerated
{
"arrived_at": "2026-04-15T12:00:00Z",
"departed_at": "2026-04-15T12:00:00Z",
"duration_minutes": 1,
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"lat": 1,
"lng": 1,
"place_name": "example",
"place_source": "example",
"sample_count": 1
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}