Developer Portal

Lead activity notifications

How partners subscribed to the Impel Notification Service (INS) build a webhook endpoint to receive lead and activity notifications.

Activity vs. messaging events

Lead activity notifications (INS) deliver two kinds of events:

  • Activity events — activity generated on a lead by Impel's AI applications.
  • Messaging events — outbound messages to the consumer, sent only by Impel's Sales AI and Lead Nurture agents.

Glossary

  • INS: Impel Notification Service
  • CRM: Customer Relationship Management
  • CRM Activity: An activity for a lead. An activity can be of the following types: outbound_call, appointment, note, phone_call_task.

Overview

This document is specific to CRM lead and activity notifications and is designed to help partners develop a webhook endpoint to receive these notifications.

This guide offers a detailed overview of how vendors subscribed to the INS can integrate with Impel’s service. It outlines the steps, technical requirements, and best practices for successful integration.

How Does INS Work?

When Impel’s Sales AI application records a new lead or a new activity for a lead, the INS sends a JSON event to the vendor’s subscribed webhook.

Webhook Implementation and Best Practices

Setting Up the Base URL

Impel recommends creating an HTTP POST endpoint. This endpoint should be an URL that accepts the provided JSON body and returns the specified status codes (see “API Responses” section below).

Ex. www.mycrm.com/impel-webhook

Authentication Type

Impel recommends that the endpoint authenticate each request using an API key, as Impel will call the POST endpoint with the following header parameters:

  • client_id
  • api_key

Message Format

The notification message will include a JSON payload. Example:

{
  "message": "Activity Created",
  "activity_id": 12345,
  "activity_type": "note",
  "lead_id": 12345,
  "dealer_id": "example-dealer-id",
  "event_id": "1feb24fa-c468-41af-9e23-0a41cb7747f7",
  "identified_events": [
    "Lead Engaged"
  ]
}
FieldTypeDescription
messageStringDescribes the event type. Set as "Activity Created" for this event type.
activity_idIntegerUniquely identifies an activity for the given lead_id. Use this parameter to call the GET Activities endpoint (see Swagger for API details).
activity_typeString EnumName of activity in Impel's system. Possible values: outbound_call, note, appointment, phone_call_task.
lead_idIntegerUniquely identifies a lead in Impel's system.
dealer_idStringUniquely identifies a dealer in Impel's system.
event_idStringUnique ID for each event generated by INS. Useful for troubleshooting.
identified_eventsList of String EnumsIncluded for note activity type. Intent classification of the conversation following the latest user message. Possible values: Action: schedule appointment, Action: unsubscribe, Requires human takeover, Follow up, Lead Engaged.

Handling the Payload Data

The activity JSON notification event includes an activity_id, which the vendor can use to call Impel’s activity endpoint ( GET Endpoint - /activities/{activity_id} )

The lead JSON notification event includes an lead_id, which the vendor can use to call Impel’s lead endpoint ( GET Endpoint - /leads/{lead_id} )

For details about these endpoints, see Impel’s Swagger documentation.

API Responses

The vendor’s webhook should return the following responses.

Error IdDescription
200Success. The webhook received the JSON data.
400This indicates a Bad Request. For example, this error can occur if a required property in the JSON is missing. This is optional to implement. The vendor should implement this if they are validating the JSON payload against a particular schema.
500Internal Server Error. This indicates that the webhook did not receive the data. or experienced an unexpected error.

Providing the URL and Testing the Webhook

Impel recommends that the vendor provide two URLs, one for a test environment and one for production. Once the endpoint is ready, please communicate the URLs to your Impel contact.

Impel and the vendor will collaborate to test the webhook using the test URL.

Logging

Impel recommends that the webhook should log of requests (including the event_id) and responses, as this will help with troubleshooting any issues.

On this page