Introduction
Pipes are composable enrichment functions. Use pipes to find email addresses, phone numbers, or trigger automations like Slack messages.
Making requests
This request enriches one input object. The pipe people:workemail:waterfall@1
adds a field called work_email to your input objects. You can find all available enrichments in the pipe catalog.
const result = await fetch("https://api.pipe0.com/v1/pipes/run", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
config: {
environemnt: "production",
},
pipes: [
{
pipe_id: "people:workemail:waterfall@1"
},
],
input: [
{
id: 1,
name: "John Doe",
company_website_url: "https://pipe0.com"
}
]
})
});The result will look something like this:
[
{
"id": 1,
"name": "John Doe",
"company_website_url": "https://pipe0.com",
"work_email": "john@pipe0.com"
}
]The response will contain more information than displayed here. Learn how to work with response objects.
Getting the task result
The request to POST https://api.pipe0.com/v1/pipes/run will create an enrichment task.
To get the result of the task, poll the GET https://api.pipe0.com/v1/pipes/check/{task_id} endpoint until the task status is
completed.
const result = await fetch("https://api.pipe0.com/v1/pipes/check/${taskId}", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
});Getting the result without polling
Instead of creating your task with the endpoint POST https://api.pipe0.com/v1/pipes/run use the endpoint POST https://api.pipe0.com/v1/pipes/run/sync.
Use the same payload for both endpoints. The /sync endpoint will try to return the completed result in one round-trip.
Read more about the trade-offs between async vs sync requests here.