How about capturing the `detect` result into a variable, the last piece of hash fetching is easy to miss. Also, the return value of the `detect` could be `nil`, so we should guard against that.
Something like:

```ruby
primary_email = @response['contact']['email_addresses'].detect{ |address| address['type'] == 'primary' }
primary_email && primary_email['address']
```