Perform a search from multiple item types
GET {{baseUrl}}/itemSearch?term=<string>&item_types=<string>&fields=<string>&search_for_related_items=<boolean>&exact_match=<boolean>&include_fields=<string>&limit=<integer>&cursor=<string>
Performs a search from your choice of item types and fields.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
term | string | (Required) The search term to look for. Minimum 2 characters (or 1 if using exact_match ). Please note that the search term has to be URL encoded. | |
item_types | string | A comma-separated string array. The type of items to perform the search from. Defaults to all. | |
fields | string | A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>custom_fields , notes , title </td></tr> <tr><td>Person</td><td>custom_fields , email , name , notes , phone </td></tr> <tr><td>Organization</td><td>address , custom_fields , name , notes </td></tr> <tr><td>Product</td><td>code , custom_fields , name </td></tr> <tr><td>Lead</td><td>custom_fields , notes , email , organization_name , person_name , phone , title </td></tr> <tr><td>File</td><td>name </td></tr> <tr><td>Mail attachment</td><td>name </td></tr> <tr><td>Project</td><td> custom_fields , notes , title , description </td></tr> </table> <br> Only the following custom field types are searchable: address , varchar , text , varchar_auto , double , monetary and phone . Read more about searching by custom fields <a href="https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields" target="_blank" rel="noopener noreferrer">here</a>.<br/> When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use search_for_related_items . | |
search_for_related_items | string | When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization | |
exact_match | string | When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. | |
include_fields | string | A comma-separated string array. Supports including optional fields in the results which are not provided by default. | |
limit | string | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. | |
cursor | string | For pagination, the marker (an opaque string value) representing the first item on the next page |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string |
RESPONSES
status: OK
{"success":true,"data":{"items":[{"result_score":1.22724,"item":{"id":42,"type":"deal","title":"Sample Deal","value":53883,"currency":"USD","status":"open","visible_to":3,"owner":{"id":69},"stage":{"id":3,"name":"Demo Scheduled"},"person":{"id":6,"name":"Sample Person"},"organization":{"id":9,"name":"Sample Organization","address":"Dabas, Hungary"},"custom_fields":["Sample text"],"notes":["Sample note"]}},{"result_score":0.31335002,"item":{"id":9,"type":"organization","name":"Sample Organization","address":"Dabas, Hungary","visible_to":3,"owner":{"id":69},"custom_fields":[],"notes":[]}},{"result_score":0.29955,"item":{"id":6,"type":"person","name":"Sample Person","phones":["555123123","+372 (55) 123468","0231632772"],"emails":["primary@email.com","secondary@email.com"],"visible_to":1,"owner":{"id":69},"organization":{"id":9,"name":"Sample Organization","address":"Dabas, Hungary"},"custom_fields":["Custom Field Text"],"notes":["Person note"]}},{"result_score":0.0093,"item":{"id":4,"type":"mail_attachment","name":"Sample mail attachment.txt","url":"/files/4/download"}},{"result_score":0.0093,"item":{"id":3,"type":"file","name":"Sample file attachment.txt","url":"/files/3/download","deal":{"id":42,"title":"Sample Deal"},"person":{"id":6,"name":"Sample Person"},"organization":{"id":9,"name":"Sample Organization","address":"Dabas, Hungary"}}},{"result_score":0.0011999999,"item":{"id":1,"type":"product","name":"Sample Product","code":"product-code","visible_to":3,"owner":{"id":69},"custom_fields":[]}}],"related_items":[{"result_score":0,"item":{"id":2,"type":"deal","title":"Other deal","value":100,"currency":"USD","status":"open","visible_to":3,"owner":{"id":1},"stage":{"id":1,"name":"Lead In"},"person":{"id":1,"name":"Sample Person"}}}]},"additional_data":{"next_cursor":"eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ"}}