Addresses

Create an address

Creates a new address in the organization.

Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

To use this endpoint, select Write Addresses under the Addresses category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>

post/addresses

Request

  • Base URL
    https://api.samsara.com
  • Auth
    HTTP bearer

Request body

addressTypesstring[]

Reporting location type associated with the address (used for ELD reporting purposes). Valid values: yard, shortHaul, workforceSite, riskZone, industrialSite, alertsOnly, agricultureSource, avoidanceZone, knownGPSJammingZone, authorizedZone, unauthorizedZone, vendor, inventory.

contactIdsstring[]

An array of Contact IDs associated with this Address.

externalIdsobject

The external IDs for the given object.

formattedAddressstring required

The full street address for this address/geofence, as it might be recognized by Google Maps.

latitudenumber double

Latitude of the address. Will be geocoded from formattedAddress if not provided.

longitudenumber double

Longitude of the address. Will be geocoded from formattedAddress if not provided.

namestring required

Name of the address.

notesstring

Notes about the address.

tagIdsstring[]

An array of IDs of tags to associate with this address.

Example request

{
  "addressTypes": [
    "yard"
  ],
  "contactIds": [
    "22408"
  ],
  "externalIds": {
    "maintenanceId": "250020",
    "payrollId": "ABFS18600"
  },
  "formattedAddress": "350 Rhode Island St, San Francisco, CA",
  "geofence": {
    "circle": {
      "latitude": 37.765363,
      "longitude": -122.4029238,
      "radiusMeters": 25
    },
    "polygon": {
      "vertices": [
        {
          "latitude": 37.765363,
          "longitude": -122.403098
        },
        {
          "latitude": 38.765363,
          "longitude": -122.403098
        },
        {
          "latitude": 37.765363,
          "longitude": -123.403098
        }
      ]
    },
    "settings": {
      "showAddresses": true
    }
  },
  "latitude": 37.765363,
  "longitude": -122.4029238,
  "name": "Samsara HQ",
  "notes": "Hours of operation: 8am - 6pm; Truck entrance on the Rhode Island street side.",
  "tagIds": [
    "3914"
  ]
}

Response

Newly created address object with ID.

Example response

{
  "data": {
    "addressTypes": [
      "yard"
    ],
    "contacts": [
      {
        "firstName": "Jane",
        "id": "22408",
        "lastName": "Jones"
      }
    ],
    "createdAtTime": "2019-05-18T20:27:35Z",
    "externalIds": {
      "maintenanceId": "250020",
      "payrollId": "ABFS18600"
    },
    "formattedAddress": "350 Rhode Island St, San Francisco, CA",
    "geofence": {
      "circle": {
        "latitude": 37.765363,
        "longitude": -122.4029238,
        "radiusMeters": 25
      },
      "polygon": {
        "vertices": [
          {
            "latitude": 37.765363,
            "longitude": -122.403098
          },
          {
            "latitude": 38.765363,
            "longitude": -122.403098
          },
          {
            "latitude": 37.765363,
            "longitude": -123.403098
          }
        ]
      }
    },
    "id": "22408",
    "latitude": 37.765363,
    "longitude": -122.4029238,
    "name": "Samsara HQ",
    "notes": "Hours of operation: 8am - 6pm; Truck entrance on the Rhode Island street side.",
    "tags": [
      {
        "id": "3914",
        "name": "East Coast",
        "parentTagId": "4815"
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.