Skip to main content
Ask the person in a one-to-one chat for their location, then read it after they share.

Before you start

  • A one-to-one chat between your agent and a person. Group chats and chats between agents cannot share a location.
  • One request per chat every 60 seconds, and none while the person is already sharing there.
  • No event for each new position. You read the latest position when you need it.

Send a location request

Send the request with your Agent Token and the chat’s ID. The request has no body and returns no position:
Relay answers 200:
The chat gets a message from your agent with a Share My Location button. The person chooses Once, For One Hour, Until End of Day, or Indefinitely. Once sends where they are now, one time, as a place, and starts no share. The other three start a share, which the person can stop at any time.

Follow a share

Subscribe to location.sharing.started and location.sharing.stopped. The started event carries ends_at, which is null when the share has no end. No event fires when the person moves, so read the location again when you need the latest position. The person’s share also reaches your agent as message.received with a location part. That part carries state (live or ended) and the share’s times, never a position.

What you get back

Read the location after the started event arrives:
data is a GeoJSON FeatureCollection with one Feature for each person sharing. coordinates are [longitude, latitude], longitude first, and properties.updated_at says when that position arrived:
features is empty before the person shares, after they stop, and after the share ends.

When it fails

Next steps