Skip to main content
This is the simplest high-value Clay developer flow:
  1. Use Searches to find companies, people, or jobs.
  2. Pass the results into a routine.
  3. Use Clay-managed functions to enrich the records.
For example, you might search for heads of sales at B2B SaaS companies, then run a Clay-managed function to find work emails. Create a search, then fetch the first page of results.
SEARCH_ID=$(curl --request POST \
  --url https://api.clay.com/public/v0/searches \
  --header "Content-Type: application/json" \
  --header "clay-api-key: $CLAY_API_KEY" \
  --data '{
    "source_type": "people",
    "query": "Heads of sales at B2B SaaS companies in New York"
  }' | jq -r '.search_id')

curl --request POST \
  --url "https://api.clay.com/public/v0/searches/$SEARCH_ID/next" \
  --header "Content-Type: application/json" \
  --header "clay-api-key: $CLAY_API_KEY" \
  --data '{ "limit": 10 }'

2. Choose a function

Use a Clay-managed function when Clay already provides the enrichment you need, such as finding emails, phone numbers, company data, technology data, funding, or job openings.

Clay-managed functions

Learn when to use Clay-provided functions.

3. Run the function

Run the function routine on the records you want to enrich.
echo '{"items":[{"id":"person-1","inputs":{"domain":"example.com","full_name":"Ada Lovelace"}}]}' \
  | clay routines runs start function:t_abc123 --input -
Then fetch the result:
clay routines runs get run_abc123

Next steps

Searches

Learn the search flow in more detail.

Batch runs

Run the same routine across many records.