Skip to content
Docs

Create a webhook

POSTdirect.lempile.com/api/v1/webhooks

Registers a URL for one source's events. The webhook belongs to the key's workspace: only that workspace's accounts send to it. The poller starts reading the accounts it covers within a minute.

Authentication

X-API-KEY header·A Lempile Direct key, one per workspace, made in Lempile's dashboard.

Request body

  • request_urlstringrequired

    Where events are POSTed: https (http only to 127.0.0.1 or localhost).

  • sourcestringrequired
    One ofmessagingusersaccount_status
  • namestring

    200 characters at most; sent as webhook_name in messaging and users payloads.

  • formatstring
    One ofjsonformDefaultjson
  • headersarray of WebhookHeader

    Up to 20 headers sent with every delivery (your secret goes here). Values are kept encrypted and never shown again.

    ›Show fields
    • keystringrequired
    • valuestringrequired
  • eventsarray of string

    Default: every event of the source.

  • account_idsarray of string

    Only these accounts. Default (empty): every account of the key's workspace. Another workspace's account named here never sends.

  • dataarray of WebhookDataKey

    Send only these keys, renamed (messaging and users only).

    ›Show fields
    • keystringrequired

      A key of the payload (see each source's payload).

    • namestringrequired

      The name it's sent under.

  • enabledboolean
    Defaulttrue

Responses

201

Created

›

application/json

  • objectstringrequired
    AlwaysWebhookCreated
  • webhook_idstringrequired
400

A required parameter missing (errors/missing_parameters), or one that isn't valid (errors/invalid_parameters, errors/invalid_url, errors/content_too_large).

›

application/json

  • titlestringrequired

    A short title, e.g. Too many requests.

  • detailstringrequired

    What happened, in plain words. Never an account's data.

  • typestringrequired

    Unipile's error type: errors/<kind>. Branch on this, not on detail.

  • statusintegerrequired

    The HTTP status again.

  • retry_afterinteger

    Seconds to wait before trying this account again. Only on 429; the Retry-After header carries the same value.

401

errors/missing_credentials: the X-API-KEY header is missing, wrong or revoked. errors/disconnected_account: LinkedIn signed the account out (or asks it for a security check); reconnect it.

›

application/json

  • titlestringrequired

    A short title, e.g. Too many requests.

  • detailstringrequired

    What happened, in plain words. Never an account's data.

  • typestringrequired

    Unipile's error type: errors/<kind>. Branch on this, not on detail.

  • statusintegerrequired

    The HTTP status again.

  • retry_afterinteger

    Seconds to wait before trying this account again. Only on 429; the Retry-After header carries the same value.

Was this page helpful?