Skip to main content

Webhooks

Test your webhook endpoint to verify it can receive notifications from meter.

Test webhook delivery

Send a sample webhook payload to verify your endpoint is configured correctly.
POST /api/webhooks/test

Request body

{
  "webhook_url": "https://your-app.com/webhooks/meter"
}
FieldTypeRequiredDescription
webhook_urlstringYesThe webhook URL to test

Response

{
  "success": true,
  "status_code": 200,
  "message": "Webhook delivered successfully"
}
FieldTypeDescription
successbooleanWhether the webhook was delivered successfully (2xx response)
status_codeintegerHTTP status code returned by your endpoint (0 if request failed)
messagestringHuman-readable result message

Example

curl -X POST https://api.meter.sh/api/webhooks/test \
  -H "Content-Type: application/json" \
  -d '{
    "webhook_url": "https://my-app.com/webhook"
  }'

Test payload format

The test endpoint sends a payload matching the format of real webhook notifications:
{
  "job_id": "660e8400-e29b-41d4-a716-446655440000",
  "schedule_id": "880e8400-e29b-41d4-a716-446655440000",
  "status": "completed",
  "results": [
    {"title": "Sample Product A", "price": "$19.99"},
    {"title": "Sample Product B", "price": "$29.99"}
  ],
  "item_count": 2,
  "has_changes": true,
  "content_hash": "7f3d9a2b4c1e5f8a9b0c1d2e3f4a5b6c",
  "completed_at": "2025-01-15T10:30:12Z"
}
FieldTypeDescription
job_idUUIDID of the scrape job
schedule_idUUIDID of the schedule that triggered the job
statusstringJob status (completed or failed)
resultsarrayExtracted data from the page
item_countintegerNumber of items extracted
has_changesbooleanWhether content changed since last run
content_hashstringHash of the extracted content
completed_atdatetimeWhen the job completed

Error responses

StatusDescription
400Invalid request (missing webhook_url)
422Invalid URL format

Next steps