Searching for person by email does not work, ruby


Using the new search endpoints (never tried the old search points though, began using your API a week ago), it works with names but not with emails. What am I doing wrong?

Here’s the method (Ruby)

def self.gem(email)
   url = URI("{Rails.configuration.pipedrive_api_key}&fields=email&term=#{email}?")
   http =, url.port)
   http.use_ssl = true
   http.verify_mode = OpenSSL::SSL::VERIFY_NONE
   request =
   request["Accept"] = "application/json"
   request["Content-Type"] = 'application/json'
   response = http.request(request)
   hash_response = JSON.parse(response.body)
   p hash_response

Result from running (asterisks added for privacy):


{"success"=>true, "data"=>{"items"=>[]}, "additional_data"=>{"pagination"=>{"start"=>0, "limit"=>100, "more_items_in_collection"=>false}}}

If I search for a name, and replace the corresponding line with

url = URI("{Rails.configuration.pipedrive_api_key}&fields=name&term=#{name}?")

running (added *s for privacy):

Pipedrive.gem('J***e K****l')" 


{"success"=>true, "data"=>{"items"=>[{"result_score"=>0.29955, "item"=>{"id"=>***, "type"=>"person", "name"=>"J***e K****l", "phones"=>[], "emails"=>["j*k@levi********"], "visible_to"=>3, "owner"=>{"id"=>1******5}, "organization"=>{"id"=>1*7, "name"=>"L********ay", "address"=>nil}, "custom_fields"=>[], "notes"=>[]}}]}, "additional_data"=>{"pagination"=>{"start"=>0, "limit"=>100, "more_items_in_collection"=>false}}}

Where is my mistake?


Have you had a chance to test on the API Reference page to see if it works there for you?

Also, one of our developers noticed it might be the question mark you’ve got at the end here.

Just tried the api reference and I was missing the


But now it works! Thanks!

Questions? Reply or pick the time that works best for a 15 minute talk here:

Anto from