Create a stream
curl --request POST \
--url https://api.example.com/api/v2/streamsimport requests
url = "https://api.example.com/api/v2/streams"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v2/streams', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v2/streams",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v2/streams"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v2/streams")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/streams")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyStreams (campaigns)
Create a stream
One-shot create: accounts + segments + schedule + delivery in one call
POST
/
api
/
v2
/
streams
Create a stream
curl --request POST \
--url https://api.example.com/api/v2/streamsimport requests
url = "https://api.example.com/api/v2/streams"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v2/streams', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v2/streams",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v2/streams"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v2/streams")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/streams")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyCreates a new campaign (stream) in one call. Resolves new handles via ScrapeBadger (upserting tracked accounts + incrementing Stripe quantity), creates inline segments if provided, wires pairs through the segment-cap chokepoint.
Each pair specifies an account (by
OR
Body
| Field | Type | Description |
|---|---|---|
name | string (optional) | Campaign name. If omitted, the server derives one from the resolved pairs: "{segment} · @{handle}" for a single account, "{segment} · N accounts" for several. |
pairs | array | Up to 50 (account, segment) pairs |
syncTimes | array | ["HH:MM"] slots (15-min boundaries). Default: one hash-distributed slot. |
timezone | string | IANA timezone. Default: user’s default or "UTC". |
autoEnrichLinkedin | boolean | Auto-enrich LinkedIn URL on new leads. Default false. |
autoEnrichEmail | boolean | Auto-enrich email on new leads. Default false. |
emailMode | enum | "verified" or "any". Default "any". |
emailDigestOverride | enum | "after_every_sync", "daily", "weekly", "off" |
telegramOverride | boolean | Override team-default Telegram digest setting |
deliveryDestination | enum | "leads_only" or "leads_plus_webhook" |
webhookUrl | string | URL for webhook delivery (when deliveryDestination = "leads_plus_webhook") |
csvEmailRecipients | object | {to, cc?, format} for “email me a CSV after every run” |
accountId OR accountHandle) AND a segment (by segmentId OR inline segment):
{
"accountId": 7,
"segmentId": 12
}
{
"accountHandle": "yongfook",
"accountTier": "starter",
"segment": {
"description": "AI founders building developer tools",
"appliedSearchFilters": { "job_role": ["Founder", "CEO"] }
}
}
Response
{
"id": 42,
"accounts": [
{ "handle": "yongfook", "accountId": 7, "accountCreated": true, "billingDelta": "stripe_quantity_incremented" }
],
"segments": [
{ "segmentId": 12, "segmentCreated": true }
]
}
Error codes
| Code | HTTP | When |
|---|---|---|
handle_not_found | 404 | X handle didn’t resolve |
handle_protected | 422 | Handle is a private account |
handle_lookup_failed | 503 | X lookup service down |
free_account_limit | 403 | Free user adding 2nd account |
subscription_required | 403 | Paid user with lapsed sub |
stream_cap_exceeded | 400 | Tier cap of automated streams per account exceeded |
stream_multi_segment | 400 | Pairs span more than one segment (a stream targets exactly one segment) |
orphan_label | 400 | Inline segment had labels with no canonical match |
Auth
Bearer or session cookie.⌘I