# Sending Pings To TelemHQ

Source HTML: https://telemhq.com/docs/integration

TelemHQ tracks scheduled jobs, ad hoc jobs, AI pipelines, workers, scripts, and data syncs with one HTTP request.

## Ping URL

Each tracker has a unique ping URL:

```text
https://telemhq.com/ping/YOUR_TRACKING_TOKEN
```

Send a `POST` request after your job runs. A browser `GET` request to a ping URL returns endpoint instructions. `POST` requests record runs.

## Simple Heartbeat

```bash
curl -X POST https://telemhq.com/ping/YOUR_TRACKING_TOKEN
```

## JSON Payload

Payloads are optional, but they turn a heartbeat into a useful run log. Send structured JSON to track metrics such as duration, records processed, token usage, cost, errors, or custom fields.

```bash
curl -X POST https://telemhq.com/ping/YOUR_TRACKING_TOKEN \
  -H "Content-Type: application/json" \
  -d '{
    "status": "success",
    "duration": 1500,
    "records_processed": 450,
    "errors": 0
  }'
```

## Node.js Example

```js
await fetch("https://telemhq.com/ping/YOUR_TRACKING_TOKEN", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    status: "success",
    duration: 1500,
    records_processed: 450,
    errors: 0
  })
});
```

## Python Example

```python
import requests

requests.post(
    "https://telemhq.com/ping/YOUR_TRACKING_TOKEN",
    json={
        "status": "success",
        "duration": 1500,
        "records_processed": 450,
        "errors": 0,
    },
    timeout=15,
)
```

## Payload Assertions

Payload assertions can mark a tracker as failing even when the process exits successfully. They are useful for AI jobs and data jobs that technically complete but produce bad output.

Examples:

- `status = success`
- `records_processed > 0`
- `errors = 0`
- `cost_usd <= 5`
- `eval_score >= 0.8`

Supported assertion operators include equals, not equals, greater than, greater or equal, less than, less or equal, one-of, and regex.

## Related Guides

- OpenAI pipeline tracking: https://telemhq.com/docs/openai
- OpenAI job monitoring quickstart: https://telemhq.com/docs/openai-job-monitoring
- Codex usage tracking: https://telemhq.com/docs/codex
- Claude pipeline tracking: https://telemhq.com/docs/claude
- Outgoing webhooks: https://telemhq.com/docs/webhooks
