> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pubrio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Example: Tracking Job Postings

> Complete walkthroughs for monitoring job postings using company_first and signal_first detection modes — with copyable code.

This guide walks through two real-world scenarios. Every code block is ready to copy, paste, and run — just replace `YOUR_API_KEY` with your actual key.

<Tabs>
  <Tab title="Company First: Track OpenAI">
    ## Scenario: Monitor when OpenAI posts new jobs

    You want to know immediately when OpenAI posts job openings — and automatically get contact details for their engineering leadership.

    ### Create the monitor

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.pubrio.com/monitors/create \
        -H "Content-Type: application/json" \
        -H "pubrio-api-key: YOUR_API_KEY" \
        -d '{
          "name": "OpenAI Job Tracker",
          "detection_mode": "company_first",
          "signal_types": ["jobs"],
          "signal_filters": [
            {
              "signal_type": "jobs",
              "filters": {
                "locations": ["US"]
              }
            }
          ],
          "companies": [
            "67c4696b-b7b0-46b5-b2af-9f434543661e"
          ],
          "is_company_enrichment": true,
          "is_people_enrichment": true,
          "people_enrichment_configs": [
            {
              "max_people_to_return": 5,
              "people_contact_types": ["email-work"],
              "filters": {
                "management_levels": ["director", "vp"],
                "departments": ["master_engineering"]
              }
            }
          ],
          "destination_type": "webhook",
          "destination_config": {
            "webhook_url": "https://usewebhook.com/YOUR_WEBHOOK_ID",
            "headers": {
              "Authorization": "Bearer your-secret-token"
            }
          },
          "max_records_per_trigger": 5,
          "profile_id": 1
        }'
      ```

      ```python Python theme={null}
      import requests

      response = requests.post(
          "https://api.pubrio.com/monitors/create",
          headers={
              "Content-Type": "application/json",
              "pubrio-api-key": "YOUR_API_KEY"
          },
          json={
              "name": "OpenAI Job Tracker",
              "detection_mode": "company_first",
              "signal_types": ["jobs"],
              "signal_filters": [
                  {
                      "signal_type": "jobs",
                      "filters": {
                          "locations": ["US"]
                      }
                  }
              ],
              "companies": [
                  "67c4696b-b7b0-46b5-b2af-9f434543661e"
              ],
              "is_company_enrichment": True,
              "is_people_enrichment": True,
              "people_enrichment_configs": [
                  {
                      "max_people_to_return": 5,
                      "people_contact_types": ["email-work"],
                      "filters": {
                          "management_levels": ["director", "vp"],
                          "departments": ["master_engineering"]
                      }
                  }
              ],
              "destination_type": "webhook",
              "destination_config": {
                  "webhook_url": "https://usewebhook.com/YOUR_WEBHOOK_ID",
                  "headers": {
                      "Authorization": "Bearer your-secret-token"
                  }
              },
              "max_records_per_trigger": 5,
              "profile_id": 1
          }
      )

      data = response.json()
      print(f"Monitor created: {data['data']['monitor_id']}")
      print(f"Signature: {data['data']['signature']}")
      ```

      ```javascript Node.js theme={null}
      const response = await fetch("https://api.pubrio.com/monitors/create", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "pubrio-api-key": "YOUR_API_KEY"
        },
        body: JSON.stringify({
          name: "OpenAI Job Tracker",
          detection_mode: "company_first",
          signal_types: ["jobs"],
          signal_filters: [
            {
              signal_type: "jobs",
              filters: {
                locations: ["US"]
              }
            }
          ],
          companies: [
            "67c4696b-b7b0-46b5-b2af-9f434543661e"
          ],
          is_company_enrichment: true,
          is_people_enrichment: true,
          people_enrichment_configs: [
            {
              max_people_to_return: 5,
              people_contact_types: ["email-work"],
              filters: {
                management_levels: ["director", "vp"],
                departments: ["master_engineering"]
              }
            }
          ],
          destination_type: "webhook",
          destination_config: {
            webhook_url: "https://usewebhook.com/YOUR_WEBHOOK_ID",
            headers: {
              Authorization: "Bearer your-secret-token"
            }
          },
          max_records_per_trigger: 5,
          profile_id: 1
        })
      });

      const data = await response.json();
      console.log("Monitor created:", data.data.monitor_id);
      console.log("Signature:", data.data.signature);
      ```
    </CodeGroup>

    **What this does:**

    * Monitors OpenAI (`companies: ["67c4696b-..."]`) for new US-based job postings
    * Enriches company data and finds up to 5 Director/VP-level Engineering contacts
    * Delivers up to 5 records per trigger to your webhook
    * All other settings use sensible defaults (real-time frequency, 500 daily cap, etc.)

    <Note>
      For `company_first` mode, you typically only need `companies` (or `domains` / `linkedin_urls`) and signal filters. `company_filters` is optional — it adds a second filtering layer when you want to combine a watch list with broader company criteria.
    </Note>

    ### Test it immediately

    Do not wait for the scheduled scan — trigger a manual run to verify everything works. Include `tried_at` with a past timestamp to ensure there is data available (using the current time may return 0 results if no new signals have appeared yet):

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.pubrio.com/monitors/process/try \
        -H "Content-Type: application/json" \
        -H "pubrio-api-key: YOUR_API_KEY" \
        -d '{
          "monitor_id": "YOUR_MONITOR_ID",
          "tried_at": "2026-01-01T00:00:00.000Z",
          "profile_id": 1
        }'
      ```
    </CodeGroup>

    <Info>
      Manual triggers consume credits just like scheduled triggers. Use `tried_at` with a recent past date to get a representative sample of results for testing.
    </Info>

    ### Check the results

    After a few seconds, check your webhook URL at [usewebhook.com](https://usewebhook.com) to see the payload. You can also verify via the logs:

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.pubrio.com/monitors/statistics/logs \
        -H "Content-Type: application/json" \
        -H "pubrio-api-key: YOUR_API_KEY" \
        -d '{
          "profile_id": 1,
          "monitor_id": "YOUR_MONITOR_ID",
          "page": 1,
          "per_page": 5
        }'
      ```
    </CodeGroup>

    Each log entry shows the status, signal/company/people counts, credit usage, and processing time.
  </Tab>

  <Tab title="Signal First: Discover AI Hiring">
    ## Scenario: Discover companies hiring for AI/ML roles

    You want to find companies actively building AI teams — regardless of whether you have tracked them before. This is a prospecting use case.

    ### Create the monitor

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.pubrio.com/monitors/create \
        -H "Content-Type: application/json" \
        -H "pubrio-api-key: YOUR_API_KEY" \
        -d '{
          "name": "AI Hiring Discovery",
          "detection_mode": "signal_first",
          "signal_types": ["jobs"],
          "signal_filters": [
            {
              "signal_type": "jobs",
              "filters": {
                "titles": ["Machine Learning", "AI Engineer", "Data Scientist"],
                "locations": ["US"]
              }
            }
          ],
          "company_filters": {
            "employees": [[201, 500], [501, 1000], [1001, 5000]]
          },
          "is_company_enrichment": true,
          "is_people_enrichment": true,
          "people_enrichment_configs": [
            {
              "max_people_to_return": 3,
              "people_contact_types": ["email-work"],
              "filters": {
                "management_levels": ["founder", "c_suite", "vp"]
              }
            }
          ],
          "destination_type": "webhook",
          "destination_config": {
            "webhook_url": "https://usewebhook.com/YOUR_WEBHOOK_ID",
            "body": {
              "pipeline": "ai-prospecting"
            }
          },
          "max_records_per_trigger": 10,
          "profile_id": 1
        }'
      ```

      ```python Python theme={null}
      import requests

      response = requests.post(
          "https://api.pubrio.com/monitors/create",
          headers={
              "Content-Type": "application/json",
              "pubrio-api-key": "YOUR_API_KEY"
          },
          json={
              "name": "AI Hiring Discovery",
              "detection_mode": "signal_first",
              "signal_types": ["jobs"],
              "signal_filters": [
                  {
                      "signal_type": "jobs",
                      "filters": {
                          "titles": ["Machine Learning", "AI Engineer", "Data Scientist"],
                          "locations": ["US"]
                      }
                  }
              ],
              "company_filters": {
                  "employees": [[201, 500], [501, 1000], [1001, 5000]]
              },
              "is_company_enrichment": True,
              "is_people_enrichment": True,
              "people_enrichment_configs": [
                  {
                      "max_people_to_return": 3,
                      "people_contact_types": ["email-work"],
                      "filters": {
                          "management_levels": ["founder", "c_suite", "vp"]
                      }
                  }
              ],
              "destination_type": "webhook",
              "destination_config": {
                  "webhook_url": "https://usewebhook.com/YOUR_WEBHOOK_ID",
                  "body": {
                      "pipeline": "ai-prospecting"
                  }
              },
              "max_records_per_trigger": 10,
              "profile_id": 1
          }
      )

      data = response.json()
      print(f"Monitor created: {data['data']['monitor_id']}")
      ```
    </CodeGroup>

    **What this does:**

    * Scans for AI/ML job postings across the US
    * **Global company filters** narrow results to mid-size companies (201-5,000 employees) — this is the power of combining signals with company criteria
    * Enriches companies and finds up to 3 founder/C-suite/VP contacts
    * Adds a custom `pipeline` field to payloads for routing in your webhook handler
    * Real-time frequency by default

    ### Test it immediately

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.pubrio.com/monitors/process/try \
        -H "Content-Type: application/json" \
        -H "pubrio-api-key: YOUR_API_KEY" \
        -d '{
          "monitor_id": "YOUR_MONITOR_ID",
          "tried_at": "2026-01-01T00:00:00.000Z",
          "profile_id": 1
        }'
      ```
    </CodeGroup>

    <Info>
      Manual triggers consume credits. Use `tried_at` with a recent past date to get representative data for testing — using the current time may return 0 results if no new signals have appeared in that instant.
    </Info>

    ### What you receive

    Check [usewebhook.com](https://usewebhook.com) — you will see a `signal_first` payload with signals as the primary structure. Notice the custom `pipeline` field at the root from your `destination_config.body`:

    ```json theme={null}
    {
      "monitor": { ... },
      "metadata": {
        "total_signals": 5,
        "total_companies": 4,
        "total_people": 10
      },
      "triggered_at": "2026-04-06T14:30:00.000Z",
      "signals": [
        {
          "signal_type": "jobs",
          "signal": { ... },
          "companies": [
            {
              "company_name": "...",
              "domain": "...",
              "company_size": 800,
              "people": [...],
              ...
            }
          ]
        },
        ...
      ],
      "pipeline": "ai-prospecting"
    }
    ```
  </Tab>
</Tabs>

***

## Retrying a Failed Delivery

If a specific trigger failed (e.g., your webhook was temporarily down), retry it without re-running the entire scan:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.pubrio.com/monitors/process/retry \
    -H "Content-Type: application/json" \
    -H "pubrio-api-key: YOUR_API_KEY" \
    -d '{
      "monitor_id": "YOUR_MONITOR_ID",
      "monitor_log_id": "THE_FAILED_LOG_ID",
      "profile_id": 1
    }'
  ```
</CodeGroup>

Find the `monitor_log_id` by querying [Statistic Logs](/en/api-reference/endpoint/monitors/statistics_logs) and filtering for entries with `"status": "failed"`.

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Best Practices" icon="star" href="/en/developer-guides/best-practices">
    Frequency, credits, retries, and scaling.
  </Card>

  <Card title="Webhook Setup" icon="plug" href="/en/developer-guides/setting-up-webhooks">
    Detailed webhook configuration and signature verification.
  </Card>
</CardGroup>
