Can't update contact location via API | Community
Skip to main content

Can’t seem to get any contact location data to stick in my requests. What am I doing wrong here? Note that the request does not fail with any sort of validation error but the values do not get updated.

For example, here’s the body on an update: 

{"signed_up_at":1753192392,"external_id":5668,"location":{"type":"location","country":"United States","country_code":"US","city":"San Diego"}}

And the response body I get:

{"type"=>"contact",
"id"=>"redacted",
"workspace_id"=>"redacted",
"external_id"=>"5668",
"role"=>"user",
"email"=>"redacted",
"phone"=>nil,
"name"=>"redacted",
"avatar"=>nil,
"owner_id"=>nil,
"social_profiles"=>{"type"=>"list", "data"=>=]},
"has_hard_bounced"=>false,
"marked_email_as_spam"=>false,
"unsubscribed_from_emails"=>false,
"created_at"=>1753796921,
"updated_at"=>1753797193,
"signed_up_at"=>1753192392,
"last_seen_at"=>nil,
"last_replied_at"=>nil,
"last_contacted_at"=>nil,
"last_email_opened_at"=>nil,
"last_email_clicked_at"=>nil,
"language_override"=>nil,
"browser"=>nil,
"browser_version"=>nil,
"browser_language"=>nil,
"os"=>nil,
"location"=>{"type"=>"location", "country"=>nil, "region"=>nil, "city"=>nil, "country_code"=>nil, "continent_code"=>nil},
"android_app_name"=>nil,
"android_app_version"=>nil,
"android_device"=>nil,
"android_os_version"=>nil,
"android_sdk_version"=>nil,
"android_last_seen_at"=>nil,

 

Hi ​@matt-inkind, I ve managed to check your issue against our codebase and, I can see why the location data isn't sticking - the Intercom API doesn't support manually setting location fields directly.

The Issue

The `location` object you're sending in your request body isn't being processed because Intercom's contact API doesn't accept manual location data. The location fields in the response remain null because the system expects location information to come from a different source.

The Solution

Instead of trying to set location data manually, you need to provide an IP address that corresponds to the location you want. Intercom automatically derives location data from IP addresses using geolocation services.

Change your request from this:

{
"signed_up_at": 1753192392,
"external_id": 5668,
"location": {
"type": "location",
"country": "United States",
"country_code": "US",
"city": "San Diego"
}
}

To this:

{
  "signed_up_at": 1753192392,
  "external_id": 5668,
  "last_seen_ip": "IP_ADDRESS_FROM_SAN_DIEGO"
}

Why This Works

Intercom's location system is designed around automatic geolocation rather than manual input. When you provide a last_seen_ip field:

1. Automatic Lookup: Intercom uses the IP address to automatically determine the user's geographic location
2. Comprehensive Data: This populates not just country and city, but also region, country codes, continent codes, and coordinates
3. Data Integrity: It ensures location data is consistent and follows standard geographic databases

Alternative Approach

If you don't have access to appropriate IP addresses, you can store location information as custom attributes:

{
  "signed_up_at": 1753192392,
  "external_id": 5668,
  "custom_attributes": {
    "manual_country": "United States",
    "manual_city": "San Diego", 
    "manual_country_code": "US"
  }
}

 

While this won't populate the standard location object in the response, it will store the location data in a way you can access and use for segmentation and filtering.

Key Takeaway

Intercom treats location as derived data rather than directly settable data. The system is designed to automatically populate location fields based on IP geolocation rather than accepting manual location input through the API.


This doesn’t seem to work either. Neither on create nor update.

POST /contacts

{"email":":redacted]","role":"user","name":":redacted]","signed_up_at":1662490176,"last_seen_ip":"74.192.182.231","last_seen_at":1753478151,"external_id":2078}