Log LinkedIn Activity API
Log a single LinkedIn outbound touch (a connection request or a direct message) as a scored behavioral event in kenbun and, when the lead matches a HubSpot contact, as a note on that contact's HubSpot timeline. This is the manual counterpart to the kenbun Chrome extension's automatic LinkedIn capture, and produces an identical event.
For the feature overview and the in-extension experience, see LinkedIn Activity Logging.
POST /linkedin/activity
Log one LinkedIn outbound touch. The server acknowledges with 202 Accepted and processes scoring (and the HubSpot timeline note) asynchronously.
When to Use This
- Build your own logger: Record LinkedIn outreach from a custom tool or script.
- Backfill activity: Log a touch after the fact when it wasn't captured automatically.
- Reliable fallback: Capture outbound activity without depending on automatic page detection.
Authentication
Required: Yes. Use a Personal Access Token (Bearer) or a Service Account (HTTP Basic Auth). An active Organizational Unit must be set. See API Access.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
activity_type | string | Yes | The touch type. One of connection_request_sent or message_sent. |
linkedin_url | string | Yes | The recipient's LinkedIn profile URL. Raw or canonical form is accepted; it is standardized server-side. |
recipient_name | string | No | Display name of the recipient. Used to make the HubSpot note read naturally. |
body | string | No | The message text. Included in the HubSpot note only when provided, and intended for consent-gated use. |
idempotency_key | string | No | A stable key that prevents duplicate logging across retries. Generated automatically when omitted. |
log_to_hubspot | boolean | No | Whether to write the touch to HubSpot as a timeline note. Defaults to true. Set false to score in kenbun only. |
Log a connection request:
{
"activity_type": "connection_request_sent",
"linkedin_url": "https://www.linkedin.com/in/jane-doe",
"recipient_name": "Jane Doe"
}
Log a message, kenbun only (no HubSpot note):
{
"activity_type": "message_sent",
"linkedin_url": "https://linkedin.com/in/bob-smith",
"recipient_name": "Bob Smith",
"log_to_hubspot": false
}
Response
202 Accepted
The touch has been logged and queued for scoring.
| Field | Type | Description |
|---|---|---|
message | string | Confirmation message (e.g., "activity logged") |
lead_id | string | The kenbun lead the touch was matched to or created for |
event_type | string | The resulting event type: LinkedIn Connection Request Sent or LinkedIn Message Sent |
{
"message": "activity logged",
"lead_id": "550e8400-e29b-41d4-a716-446655440000",
"event_type": "LinkedIn Connection Request Sent"
}
Example
curl -X POST "https://api.kenbun.io/linkedin/activity" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"activity_type": "connection_request_sent",
"linkedin_url": "https://www.linkedin.com/in/jane-doe",
"recipient_name": "Jane Doe"
}'
Common Errors
| Status | Meaning | Solution |
|---|---|---|
| 400 | Bad Request | Active OU not set, or activity_type / linkedin_url is missing or invalid |
| 401 | Unauthorized | Check your authentication credentials |
| 500 | Server Error | The touch could not be queued; retry later or contact support if it persists |
Notes
- The organization and OU are determined from your authentication context. Do not send
unit_idin the request body; it is set automatically by your account context. linkedin_urlis standardized server-side (lowercase, no scheme,www, query string, or trailing slash) so the same person always resolves to the same lead.- Both LinkedIn event types are registered automatically on first use. Assign point values to them under Configure → Scoring (Engagement); kenbun does not set weights for you.
- HubSpot matching is indirect: kenbun resolves the lead first, then finds the HubSpot contact by the lead's email. A LinkedIn-only lead with no email is scored in kenbun but skipped for HubSpot.
- Duplicate touches are deduplicated automatically, so retries never create a second HubSpot note.
Related Endpoints
- Ingest — The shared event ingestion endpoint used by automatic capture
- Events — List and query logged events
- Lead Lookup by Alias — Resolve a lead by its LinkedIn profile URL
See Also
- LinkedIn Activity Logging — Feature overview and extension setup
- HubSpot Integration — Connect HubSpot for timeline notes