Skip to main content
GET
/
v2
/
webhooks
/
{webhook_id}
/
events
Poll Events
curl --request GET \
  --url https://api.example.com/v2/webhooks/{webhook_id}/events \
  --header 'x-api-key: <x-api-key>'
{
  "success": true,
  "data": {
    "items": [
      {
        "event_id": "6789abcdef0123456789ab01",
        "event": {
          "account_id": "69c127c37cae0494dd827286",
          "account_name": "My Account",
          "event": {
            "type": "message",
            "sender_name": "John Doe",
            "message_text": "Hello!",
            "sender_profile": "https://www.linkedin.com/in/johndoe"
          },
          "timestamp": "2025-01-15T10:31:00Z"
        },
        "created_at": "2025-01-15T10:31:00.123Z"
      }
    ]
  },
  "metadata": {
    "action": "poll_webhook_events",
    "credits_consumed": 0,
    "timestamp": "2025-01-15T10:35:00.000000"
  }
}
Fetch stored events for a hosted webhook. Use this as an alternative to the SSE stream when you prefer polling over a persistent connection.
This endpoint is only available for hosted webhooks (created without a url). Events are stored for 24 hours then automatically deleted.

Header Parameters

x-api-key
string
required
Your API key

Path Parameters

webhook_id
string
required
The unique identifier of the webhook

Query Parameters

since
string
ISO 8601 datetime to fetch events after. Only events created after this timestamp are returned.Example: 2025-01-15T10:30:00Z
limit
integer
default:"50"
Maximum number of events to return. Between 1 and 200.

Response

success
boolean
Whether the request was successful
data
object
{
  "success": true,
  "data": {
    "items": [
      {
        "event_id": "6789abcdef0123456789ab01",
        "event": {
          "account_id": "69c127c37cae0494dd827286",
          "account_name": "My Account",
          "event": {
            "type": "message",
            "sender_name": "John Doe",
            "message_text": "Hello!",
            "sender_profile": "https://www.linkedin.com/in/johndoe"
          },
          "timestamp": "2025-01-15T10:31:00Z"
        },
        "created_at": "2025-01-15T10:31:00.123Z"
      }
    ]
  },
  "metadata": {
    "action": "poll_webhook_events",
    "credits_consumed": 0,
    "timestamp": "2025-01-15T10:35:00.000000"
  }
}

Polling Pattern

let lastPollTime = new Date().toISOString();

setInterval(async () => {
  const res = await fetch(
    `https://api.linkupapi.com/v2/webhooks/${webhookId}/events?since=${lastPollTime}&limit=100`,
    { headers: { 'x-api-key': 'YOUR_API_KEY' } }
  );
  const { data } = await res.json();

  for (const item of data.items) {
    console.log('Event:', item.event);
    lastPollTime = item.created_at; // move cursor forward
  }
}, 10000); // poll every 10 seconds

Notes

  • Events are stored for 24 hours (TTL) then automatically deleted
  • Polling does not consume additional credits beyond the monitoring cost
  • Use the since parameter to avoid re-processing events
  • For real-time delivery, prefer the SSE Stream endpoint