Skip to main content

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

FieldTypeRequiredDescription
activity_typestringYesThe touch type. One of connection_request_sent or message_sent.
linkedin_urlstringYesThe recipient's LinkedIn profile URL. Raw or canonical form is accepted; it is standardized server-side.
recipient_namestringNoDisplay name of the recipient. Used to make the HubSpot note read naturally.
bodystringNoThe message text. Included in the HubSpot note only when provided, and intended for consent-gated use.
idempotency_keystringNoA stable key that prevents duplicate logging across retries. Generated automatically when omitted.
log_to_hubspotbooleanNoWhether 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.

FieldTypeDescription
messagestringConfirmation message (e.g., "activity logged")
lead_idstringThe kenbun lead the touch was matched to or created for
event_typestringThe 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

StatusMeaningSolution
400Bad RequestActive OU not set, or activity_type / linkedin_url is missing or invalid
401UnauthorizedCheck your authentication credentials
500Server ErrorThe 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_id in the request body; it is set automatically by your account context.
  • linkedin_url is 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.
  • 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