> ## 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.

# Best Practices & Polling

> Optimize your monitor setup for reliability, performance, and efficient delivery.

## Real-Time Frequency

The `frequency_minute` parameter controls how often your monitor scans.

| Setting | Behavior | Use Case |
| - | - | - |
| **`0` (default)** | **Real-time** — signals are detected and delivered as they appear | Most monitors — fastest possible delivery |
| `1 - 60` | Fixed interval in minutes | When you want predictable cadence |
| `60 - 1440` | Hourly to daily | Digest-style summaries, lower priority signals |

> [!TIP]
>
> With `frequency_minute: 0`, Pubrio detects and delivers signals as they appear — no polling, no delay.

***

## Retry Configuration

When a webhook delivery fails, retries help recover automatically.

| Parameter | Range | Default | Recommendation |
| - | - | - | - |
| `max_retry_per_trigger` | 0 - 3 | 1 | Set to 2-3 for critical monitors |
| `retry_delay_second` | 1 - 5 | 1 | Use 3-5 seconds to allow transient issues to resolve |

> [!NOTE]
>
> Retries re-deliver the same payload — they do not re-run the signal detection or incur additional search credits.

***

## Process Retry

The [Process Retry](https://docs.pubrio.com/en/api-reference/endpoint/monitors/process_retry.md) endpoint lets you re-attempt a specific failed delivery. Key benefits:

* **No charge for failures** — you are not charged credits when a delivery fails. Credits are only consumed on successful delivery.
* **Troubleshooting** — retry a failed log entry to diagnose webhook issues without creating new triggers.
* **Original destination option** — use `is_use_original_destination` to retry with the destination snapshot from the original log, useful when you have updated your webhook URL since the failure.

Find failed deliveries via [Statistic Logs](https://docs.pubrio.com/en/api-reference/endpoint/monitors/statistics_logs.md) and retry them individually.

***

## Failure Handling

The `max_failure_trigger` parameter (range: 1-10, default: 5) controls how many consecutive delivery failures are allowed before the monitor automatically pauses.

**Recommended approach:**

1. Set `notification_email` to receive alerts when failures occur
2. Keep `max_failure_trigger` at 3-5 for production monitors
3. Use [Statistic Logs](https://docs.pubrio.com/en/api-reference/endpoint/monitors/statistics_logs.md) to diagnose failures — check `error_message` and `response_status_code`
4. After fixing the issue, reactivate via [Update Monitor](https://docs.pubrio.com/en/api-reference/endpoint/monitors/update.md)
5. Use [Process Retry](https://docs.pubrio.com/en/api-reference/endpoint/monitors/process_retry.md) to re-attempt specific failed deliveries

***

## Polling with Statistics Endpoints

While webhooks handle real-time delivery, the statistics endpoints provide monitoring, debugging, and audit capabilities.

### Overview polling

Use [Monitor Statistics](https://docs.pubrio.com/en/api-reference/endpoint/monitors/statistics.md) for a dashboard-level health check:

```bash cURL theme={null}
curl -X POST https://api.pubrio.com/monitors/statistics \
  -H "Content-Type: application/json" \
  -H "pubrio-api-key: YOUR_API_KEY" \
  -d '{ "profile_id": 1 }'
```

Returns aggregate metrics: total monitors, triggers today vs yesterday, success rates, and comparison rates.

### Log-based polling

Use [Statistic Logs](https://docs.pubrio.com/en/api-reference/endpoint/monitors/statistics_logs.md) to review trigger history:

```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": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "page": 1,
    "per_page": 10
  }'
```

Each log entry includes status, credit usage, signal/company/people counts, processing time, and error details.

> [!TIP]
>
> Combine webhook delivery with periodic log polling for maximum reliability: webhooks handle real-time processing, while log polling catches any missed deliveries and provides an audit trail.

***

## Scaling Recommendations

> [accordion] Focused monitors vs. broad filters
>
> **Prefer focused monitors over overly broad ones.** A monitor tracking "AI jobs at US enterprise companies" is easier to debug than "all jobs everywhere." Focused monitors also let you route different signal types to different webhook endpoints.

> [accordion] Webhook endpoint reliability
>
> Your webhook endpoint should:
>
> * Respond within 30 seconds
> * Return `200` immediately and process data asynchronously
> * Handle duplicate payloads gracefully (idempotency)
> * Log all incoming payloads for debugging

> [accordion] Managing many monitors
>
> Use [Get Monitor List](https://docs.pubrio.com/en/api-reference/endpoint/monitors/monitors.md) with filtering:
>
> * Filter by `detection_mode` and `destination_type`
> * Sort by `last_modified` or `last_trigger_at`
> * Search by name with `search_term`
>
> Use [Monitor Statistics](https://docs.pubrio.com/en/api-reference/endpoint/monitors/statistics.md) to spot underperforming monitors quickly.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.