Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.leadpipe.com/llms.txt

Use this file to discover all available pages before exploring further.

Full workflow example

API_KEY="sk_your_key_here"
BASE="https://api.aws53.cloud"

# Step 1: Find topics about CRM
curl "$BASE/v1/intent/topics/search?q=CRM&type=b2b&limit=10"

# Step 2: Validate the config before previewing or saving
curl -X POST "$BASE/v1/intent/audiences/validate" \
  -H "x-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "topicIds": [117801, 102391],
    "minScore": 70,
    "maxScore": 99,
    "filters": {
      "role.seniority": {
        "values": ["director", "vp", "c_suite"]
      },
      "company.revenueRanges": {
        "values": ["10 million to 25 million", "25 million to 50 million"]
      },
      "contact.hasBusinessEmail": true
    }
  }'

# Step 3: Preview audience size and sample rows
curl -X POST "$BASE/v1/intent/audiences/preview" \
  -H "x-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "topicIds": [117801, 102391],
    "minScore": 70,
    "maxScore": 99,
    "filters": {
      "role.seniority": {
        "values": ["director", "vp", "c_suite"]
      },
      "company.revenueRanges": {
        "values": ["10 million to 25 million", "25 million to 50 million"]
      },
      "contact.hasBusinessEmail": true
    }
  }'

# Step 4: Save the audience
AUDIENCE_ID=$(curl -s -X POST "$BASE/v1/intent/audiences" \
  -H "x-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CRM Decision Makers",
    "status": "active",
    "config": {
      "topicIds": [117801, 102391],
      "minScore": 70,
      "maxScore": 99,
      "filters": {
        "role.seniority": {
          "values": ["director", "vp", "c_suite"]
        },
        "company.revenueRanges": {
          "values": ["10 million to 25 million", "25 million to 50 million"]
        },
        "contact.hasBusinessEmail": true
      }
    }
  }' | jq -r '.data.id')

# Step 5: Queue a manual run
RUN_ID=$(curl -s -X POST "$BASE/v1/intent/audiences/$AUDIENCE_ID/runs" \
  -H "x-api-key: $API_KEY" \
  -H "Idempotency-Key: crm-run-001" \
  -H "Content-Type: application/json" \
  -d '{"runType":"manual"}' | jq -r '.data.id')

# Step 6: Poll until results are ready
while true; do
  HTTP_STATUS=$(curl -s -o /tmp/orbit-results.json -w "%{http_code}" \
    "$BASE/v1/intent/audiences/$AUDIENCE_ID/runs/$RUN_ID/results?limit=100&offset=0" \
    -H "x-api-key: $API_KEY")

  if [ "$HTTP_STATUS" = "200" ]; then
    break
  fi

  echo "Run is not complete yet. Waiting 5s."
  sleep 5
done

jq '.data.results[:3]' /tmp/orbit-results.json

# Step 7: Export CSV directly
curl -L "$BASE/v1/intent/audiences/$AUDIENCE_ID/runs/$RUN_ID/export.csv" \
  -H "x-api-key: $API_KEY" \
  -o crm_decision_makers.csv

Stored export example

Use stored exports when you need a reusable signed download URL.
EXPORT_ID=$(curl -s -X POST "$BASE/v1/intent/audiences/$AUDIENCE_ID/runs/$RUN_ID/exports" \
  -H "x-api-key: $API_KEY" | jq -r '.data.export.id')

curl "$BASE/v1/intent/audiences/$AUDIENCE_ID/runs/$RUN_ID/exports/$EXPORT_ID" \
  -H "x-api-key: $API_KEY"

Practical notes

  • Active audiences can refresh through scheduled daily runs.
  • Each run is a separate snapshot with its own runId.
  • Public run creation supports runType: "manual"; daily runs are worker-owned.
  • minScore below 50 is accepted but normalized to 50.
  • Use Idempotency-Key when queueing a manual run from retrying clients.