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.
Overview
This guide is intended for partners integrating with the Impel Notification Service (INS). It describes how to implement a webhook endpoint that receives real-time lead activity and message notifications from Impel’s Lead Nurture application.
How It Works
When Impel’s Lead Nurture application records a new activity or message for a lead, INS delivers a JSON event payload via HTTP POST to your registered webhook endpoint. Your endpoint should process the event and return an appropriate HTTP status code.
Glossary
The following terms are used throughout this document:
| Term | Definition |
|---|---|
| INS | Impel Notification Service |
| CRM | Customer Relationship Management |
| CRM Activity | An activity for a lead. Activity types include: outbound_call, appointment, note, phone_call_task. |
| CRM Message | A message communication sent to or received from a lead. |
| Client Key | A unique identifier for a dealer client entity within the Impel system. |
| Lead ID | A unique identifier for a lead within the Impel system. |
| Consumer ID | A unique identifier for a consumer within the Impel system. |
Webhook Implementation
1. Endpoint Setup
Create an HTTP POST endpoint that:
- Accepts a JSON request body
- Validates the client_id and api_key header parameters
- Returns the appropriate HTTP status code (see API Responses section)
Example base URL:
2. Authentication
Impel authenticates each outbound request using two HTTP header parameters. Your endpoint must validate both values on every incoming request:
| Header Parameter | Description |
|---|---|
| client_id | Identifies the client making the request. |
| api_key | Secret key used to authenticate the request. Coordinate the value with your Impel integration contact. |
Payload Reference
All events share a set of common fields. Event-specific fields are documented separately for each event type below.
Common Fields
| Field | Type | Description | Values |
|---|---|---|---|
| event_name | String | The name of the event type. | Activity Created | Message Created |
| event_id | String | Unique identifier for each event generated by INS. Useful for troubleshooting and deduplication. | UUID |
| created_ts | Datetime | UTC timestamp of when the event was created. | ISO 8601 (UTC) |
| client_key | String | Uniquely identifies the dealer client entity in the Impel system. | — |
| lead_id | Integer | Uniquely identifies a lead in the Impel system. | — |
| consumer_id | Integer | Uniquely identifies a consumer in the Impel system. | — |
- Event: Message Created
Delivered when Impel records a new inbound or outbound message for a lead.
Example Payload
| { |
|---|
| "event_id": "12cabc89-72e5-4250-9c49-b8137a008bf9", |
| "created_ts": "2024-09-05T11:42:51Z", |
| "event_name": "Message Created", |
| "lead_id": 12345, |
| "consumer_id": 12345, |
| "message_id": 12345, |
| "client_key": "C0012345", |
| "direction": "inbound", |
| "channel_type": "sms", |
| "sent_by": "ai" |
| } |
Message-Specific Fields
| Field | Type | Description | Values |
|---|---|---|---|
| message_id | Integer | Uniquely identifies the message in the Impel system. | — |
| direction | String | Indicates whether the message was received by or sent from Impel. | inbound | outbound |
| channel_type | String | The communication channel over which the message was transmitted. | email | sms |
| sent_by | String | The entity that transmitted the message. | human | ai |
| Note Details for retrieving full message content via API are not yet available. Please contact your Impel integration contact for more information. |
|---|
- Event: Activity Created
Delivered when Impel records a new activity for a lead.
Example Payload
| { |
|---|
| "event_id": "12cabc89-72e5-4250-9c49-b8137a008bf9", |
| "created_ts": "2024-09-05T11:42:51Z", |
| "event_name": "Activity Created", |
| "lead_id": 12345, |
| "consumer_id": 12345, |
| "activity_id": 12345, |
| "client_key": "C0012345", |
| "activity_type": "appointment" |
| } |
Activity-Specific Fields
| Field | Type | Description | Values |
|---|---|---|---|
| activity_id | Integer | Uniquely identifies the activity for the given lead_id. Use this value to call the GET Activities endpoint. | — |
| activity_type | String | The type of activity recorded in the Impel system. | outbound_call | note | appointment | phone_call_task |
Handling Payload Data
After receiving an event notification, use the identifiers in the payload to fetch full record details from Impel’s REST API:
| Event Type | Identifier Field | Impel API Endpoint |
|---|---|---|
| Activity Created | activity_id | GET /activities/{activity_id}/event |
| * | lead_id | GET /leads/{lead_id} |
For full API documentation, schemas, and authentication details for these endpoints, refer to Impel’s Swagger documentation.
API Responses
Your webhook endpoint must return one of the following HTTP status codes in response to each request from INS:
| HTTP Code | Status | Description |
|---|---|---|
| 200 | Success | The webhook received the JSON payload successfully. |
| 400 | Bad Request | A required property in the JSON payload is missing or invalid. Implement this if you are validating the payload against a schema (optional). |
| 500 | Internal Server Error | The webhook did not receive the data or encountered an unexpected error. |
Testing & Go-Live
Provide Two Endpoint URLs
Impel recommends providing separate URLs for test and production environments:
| Environment | Example URL |
|---|---|
| Test | https://sandbox.yourcrm.com/impel-webhook |
| Production | https://www.yourcrm.com/impel-webhook |
Once your test endpoint is ready, share both URLs with your Impel integration contact. Impel and your team will collaborate to run end-to-end tests against the test URL before activating the production endpoint.
Logging Recommendations
To support efficient troubleshooting, Impel recommends that your webhook implementation log the following for every request:
- The full request payload, including the event_id
- The HTTP response code returned by your endpoint
- Any internal errors or exceptions encountered during processing
Retaining logs with event_id values allows Impel’s support team to correlate specific delivery attempts when investigating issues.
For integration support, contact your Impel integration representative.