Samsara’s Address feature lets you define locations of interest with configurable geofences, enabling data collection to optimize operations and manage your fleet efficiently. You can use the full set of address APIs and address related webhook events to synchronize address information both ways between your system and Samsara. All Addresses contain the following fields:Documentation Index
Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
| Field | Description |
|---|---|
formattedAddress | The street address. Example: 1990 Alameda Street, San Francisco, CA 94103 |
geofence | Either a circular or a polygonal geofence. |
name | A user-provided name. |
For a general introduction to using the Samsara REST API, see the Getting Started guide.
Creating an Address
Use the Create an address API to create an Address. You can also listen forAddressCreated webhook notifications that are sent when new addresses are created.
Circular geofence
Here’s a sample request body to create an Address with a circular geofence:1990 Alameda Street, San Francisco, CA 94103 with a circular geofence that has a radius of 250 meters. This Address will be called “Samsara”.
Samsara will geocode the formattedAddress, so no latitude/longitude coordinates are required for circular geofences. See Retrieving an Address and Latitude/Longitude Overrides for details on retrieving and working with coordinates.
Example response:
id field. This is the Samsara-provided unique identifier for the Address and can be used to retrieve the Address or use with other API endpoints. Addresses also support External IDs. See the External IDs guide for details on how to include external IDs upon creation of an Address.
Polygonal geofence
Here’s a sample request body to create an Address with a polygonal geofence:formattedAddress into the latitude/longitude fields at the top level of the object.
Notice that the above Address now contains an id field. This is the Samsara-provided unique identifier for the Address and can be used to retrieve the Address or use with other API endpoints. Addresses also support External IDs.
Latitude/Longitude Overrides
All Addresses must include aformattedAddress which is geocoded to derive the latitude and longitude fields at the top level of the object. You may override these values for circular geofences by including latitude and longitude values in the request:
formattedAddress.
You may include the latitude/longitude overrides within either the top-level object or within the
circle object. The latitude/longitude overrides in the top-level object will take precedence if both are provided.Inexact Addresses
Samsara does not support inexact addresses. TheformattedAddress field is always required, and Samsara always attempts to geocode it to assign the Address to a physical location.
Use a best guess if the location does not have a formattedAddress.
Consider creating a circular Address with latitude/longitude provided in the override fields and include a placeholder for the formattedAddress:
latitude/longitude and set “Best Guess” as the formattedAddress in the Address object.
External IDs
Addresses support External IDs — custom identifiers provided by you. See the External IDs guide for details on how to include external IDs in Addresses.Retrieving Addresses
A Single Address
Use the Retrieve an address endpoint to get a single Address object by its Samsara ID or external ID:- Samsara ID:
GET /addresses/12042269 - External ID:
GET /addresses/routing:abc123
Listing Addresses
Use the List all addresses endpoint to list all Addresses in your organization. The response will include a list of Addresses. See the Pagination guide on how to paginate through the results, and the Filtering guide on how to filter results.Updating Addresses
Use the Update an address API to update an Address. Fields omitted from the request body are not changed. Listen forAddressUpdated webhook notifications to know when an address is updated in Samsara.
Example request to change the size of a geofence radius for an address:
Deleting an Address
Use the Delete an address endpoint to delete an Address. This cannot be undone. External IDs can be used in the URL path of the DELETE endpoint. You can listen forAddressDeleted webhook notifications to know when an address is deleted in Samsara.