Register a webhook
Early access. Tell us what you're building and we'll set you up. Contact us
api.lempile.com/api/v1/webhooksLempile calls request_url when something happens on an Instagram account. messaging: message_received, message_read, message_reaction, read from each account's inbox about every 10 minutes (not between 23:00 and 07:00 in the account's own time zone). account_status: the workspace's accounts, Instagram's included: connected, signed out, stopped by a security check, suspended, reconnected or removed (AccountStatus.message as Unipile, plus Lempile's status, previous_status and reason). The answer's secret signs every call (X-Lempile-Signature); it's shown this once.
Scope: accounts.write.
Authentication
X-API-KEY header·A Lempile API key, made in the dashboard under Access tokens.Request body
request_urlstring · urirequiredAn
https://address on the public internet (no IP address,localhostor internal name).sourcestringrequiredOne ofmessagingaccount_statuseventsarray of stringThe events to send. A
messagingwebhook withouteventsgetsmessage_receivedonly, as on Unipile. Anaccount_statuswebhook takes Unipile's names (creation_success,reconnected,ok,connecting,credentials,deleted) or Lempile's (account.status.disconnected…); withouteventsit gets all of them.account_idsarray of stringmessagingonly: the workspace's Instagram accounts, by their Lempile id. Without it, every Instagram account of the workspace.≤ 50 itemsformatstringmessagingonly.One ofjsonformDefaultjsondataarray of objectmessagingonly: the payload then holds only these keys, each under its newname.≤ 40 items›Show fieldsHide fields
keystringnamestring
enabledbooleanmessagingonly.DefaulttruenamestringYour name for it, sent as
webhook_name.headersarray of objectHeaders added to every call.
≤ 10 items›Show fieldsHide fields
keystringvaluestring
Responses
201Registered.
›
application/json
objectanyAlwaysWebhookCreatedwebhook_idstringsecretstringSigns every call. Shown this once: store it.
400errors/invalid_parameters: a field Lempile won't take; detail names it. Nothing was opened.
›
errors/invalid_parameters: a field Lempile won't take; detail names it. Nothing was opened.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringWhat happened, in words, and whether anything was done.
codestringOn a
429:too_fast,daily_limitorhourly_limit.retry_afterintegerSeconds to wait.
retry_atstring · date-time
401A missing or invalid API key answers { "error": "unauthorized", "message" }. errors/disconnected_account (problem JSON): Instagram signed the account out; connect it again.
›
{ "error": "unauthorized", "message" }. errors/disconnected_account (problem JSON): Instagram signed the account out; connect it again.application/json
errorstringrequiredmessagestring
402subscription_required (in error): the workspace has no active trial or subscription.
›
subscription_required (in error): the workspace has no active trial or subscription.application/json
errorstringrequiredmessagestring
403errors/insufficient_permissions (the key lacks the scope), errors/account_restricted (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or errors/action_required (the account waits for something done on Instagram itself; account_status and reason say what).
›
errors/insufficient_permissions (the key lacks the scope), errors/account_restricted (Instagram blocked the action, restricted the account or asks for a check: someone has to look at it on Instagram) or errors/action_required (the account waits for something done on Instagram itself; account_status and reason say what).application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringWhat happened, in words, and whether anything was done.
codestringOn a
429:too_fast,daily_limitorhourly_limit.retry_afterintegerSeconds to wait.
retry_atstring · date-time
Was this page helpful?