provider Contacts API - Recipients POST
/contactdb/recipients/search @utdk/sendgrid
/contactdb/recipients/search Search recipients
<p>
Search using segment conditions without actually creating a segment.
Body contains a JSON object with <code>conditions</code>, a list of conditions as described below, and an optional <code>list_id</code>, which is a valid list ID for a list to limit the search on.
</p>
<p>
Valid operators for create and update depend on the type of the field for which you are searching.
</p>
<ul>
<li>Dates:
<ul>
<li>"eq", "ne", "lt" (before), "gt" (after)
<ul>
<li>You may use MM/DD/YYYY for day granularity or an epoch for second granularity.</li>
</ul>
</li>
<li>"empty", "not_empty"</li>
<li>"is within"
<ul>
<li>You may use an <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601 date format</a> or the # of days.</li>
</ul>
</li>
</ul>
</li>
<li>Text: "contains", "eq" (is - matches the full field), "ne" (is not - matches any field where the entire field is not the condition value), "empty", "not_empty"</li>
<li>Numbers: "eq", "lt", "gt", "empty", "not_empty"</li>
<li>Email Clicks and Opens: "eq" (opened), "ne" (not opened)</li>
</ul>
<p>
Field values must all be a string.
</p>
<p>
Search conditions using "eq" or "ne" for email clicks and opens should provide a "field" of either <code>clicks.campaign_identifier</code> or <code>opens.campaign_identifier</code>.
The condition value should be a string containing the id of a completed campaign.
</p>
<p>
Search conditions list may contain multiple conditions, joined by an "and" or "or" in the "and_or" field.
The first condition in the conditions list must have an empty "and_or", and subsequent conditions must all specify an "and_or".
</p>
Try it
Authentication
Configure credentials for Email Activity (beta)
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.
Saved automatically to browser storage.
Code snippet
Updates live as you fill in the form above.
TypeScript
import sendgrid from '@utdk/sendgrid';
await sendgrid.postContactdbRecipientsSearch()