Use this endpoint to locate contacts.
The request body's query
field accepts valid SGQL for searching for a contact.
Because contact emails are stored in lower case, using SGQL to search by email address requires the provided email address to be in lower case. The SGQL lower()
function can be used for this.
Only the first 50 contacts that meet the search criteria will be returned.
If the query takes longer than 20 seconds, a 408 Request Timeout
status will be returned.
Formatting the created_at
and updated_at
values as Unix timestamps is deprecated. Instead, they are returned as ISO format as string.
Bearer <<YOUR_API_KEY_HERE>>
application/json
An SGQL search string or other pattern.
The total number of contacts matched.
1const client = require('@sendgrid/client');2client.setApiKey(process.env.SENDGRID_API_KEY);34const data = {5"query": "email LIKE 'ENTER_COMPLETE_OR_PARTIAL_EMAIL_ADDRESS_HERE%' AND CONTAINS(list_ids, 'YOUR_LIST_IDs')"6};78const request = {9url: `/v3/marketing/contacts/search`,10method: 'POST',11body: data12}1314client.request(request)15.then(([response, body]) => {16console.log(response.statusCode);17console.log(response.body);18})19.catch(error => {20console.error(error);21});