ProducerSync API: Webhook Events

The ProducerSync API publishes webhook events to notify your system when producer compliance data is ready or when your monitored population changes. Use these events to drive efficient daily synchronization without polling.

For instructions on how to register an endpoint, verify delivery, and validate signatures, see the Webhooks Quick Start Guide.

Available Events

Event TypeWhen It FiresCommon Use Cases
producersync.updates_availableAfter NIPR completes daily updates and AgentSync processes themTrigger API calls to pull the latest producer compliance data
producersync.npn.activatedA producer is added to your monitored populationStart onboarding workflows, run initial compliance checks
producersync.npn.deactivatedA producer is removed from your monitored populationRemove from active monitoring, trigger offboarding actions

Subscribe to the high-level producersync group to receive all three, or subscribe to individual event types.

💡 activated and deactivated events fire immediately — they're triggered by changes to your account's subscription list, not by NIPR's daily cycle. updates_available is tied to the daily NIPR update process.

Event Schema

{
  "id": "evt_12345",
  "type": "producersync.updates_available",
  "timestamp": "2025-07-24T22:51:05.206Z",
  "data": {}
}
FieldTypeDescription
idstringUnique identifier for this event. Repeated on retries — use for deduplication.
typestringThe specific event type
timestampstring (ISO 8601)UTC time the event was generated
dataobjectEvent-specific payload (see examples below)

Example Payloads

producersync.updates_available

Fires once per day after AgentSync processes the NIPR data refresh. Use data.runDate as the value for the updatedSince parameter in your subsequent API calls.

{
  "id": "whe_000012345",
  "type": "producersync.updates_available",
  "timestamp": "2025-07-24T22:51:05.206Z",
  "data": {
    "runDate": "2025-07-24"
  }
}

Recommended response:

import requests

def handle_updates_available(event, access_token):
    run_date = event["data"]["runDate"]
    # Use run_date as updatedSince to fetch only changed records
    response = requests.get(
        f"https://api.agentsync.io/v2/licenses?updatedSince={run_date}",
        headers={"Authorization": f"Bearer {access_token}"}
    )
    licenses = response.json().get("embedded", {}).get("licenses", [])
    # ... process and persist

producersync.npn.activated

{
  "id": "whe_123454321",
  "type": "producersync.npn.activated",
  "timestamp": "2025-07-25T15:53:01.579Z",
  "data": {
    "npn": "15645555",
    "activatedAt": "2025-07-25T15:53:01.579Z"
  }
}

producersync.npn.deactivated

{
  "id": "whe_123454322",
  "type": "producersync.npn.deactivated",
  "timestamp": "2025-07-25T15:53:01.579Z",
  "data": {
    "npn": "15645555",
    "deactivatedAt": "2025-07-25T15:53:01.579Z"
  }
}
  1. Receive producersync.updates_available — this is your trigger to start processing
  2. Extract data.runDate from the event payload
  3. Call API endpoints with updatedSince=<runDate> — this ensures you only fetch records that changed
  4. Process and persist the updated records in your system

This pattern replaces scheduled polling jobs and ensures you process data as soon as it's available.

See the ProducerSync API Quick Start Guide for the full sync workflow with code examples.

Processing Recommendations

  • Use id for deduplication — if an event is retried, the id stays the same
  • Respond within 5 seconds — offload heavy processing to a queue or background job
  • Validate signatures — verify the webhook-signature header before processing
  • Log all receipts — log the full event payload and id for troubleshooting and replay

See Webhooks Quick Start Guide for signature validation details.