Start a chat
Early access. Tell us what you're building and we'll set you up. Contact us
api.lempile.com/api/v1/chatsSends a first message to one person. When a chat with them already exists, the message goes there. Someone who doesn't follow the account gets a message request: until they accept, Instagram allows one message, text only. quote_id, linkedin, subject and video_message answer 400.
Paced per account: 3 minutes between new chats, 20 a day.
Scope: accounts.write.
Authentication
X-API-KEY header·A Lempile API key, made in the dashboard under Access tokens.Headers
Idempotency-Keystringrequired1–200 characters of
A-Z a-z 0-9 . _ : -, scoped to your workspace. The same key with the same request replays the first answer; see Write receipts. A dry run needs none.≤ 200 chars
Request body
account_idstringrequiredtextstringUp to 1,000 characters (Instagram's own limit). Needed unless there are files.
≤ 1000 charsdry_runbooleantrue: everything up to the last step, nothing sent:200withnot_sent: true. Not paced, no receipt. When the write is already so (already liked, already following),checksholds{ "check": "already", "already": true }.attendees_idsarray of stringrequiredOne person: their
provider_messaging_id(as Unipile asks),provider_id, username,@usernameor profile link. Two or more (a group):501.≥ 1 items · ≤ 1 items
account_idstringrequiredtextstringUp to 1,000 characters (Instagram's own limit). Needed unless there are files.
≤ 1000 charsattachmentsarray of string · binarymultipart/form-dataonly: JPEG or PNG pictures (8 MB each), MP4 or MOV videos (25 MB), voice notes as M4A, AAC or MP3 (10 MB). 10 files and 25 MB at most in all. Any other type:415.dry_runbooleantrue: everything up to the last step, nothing sent:200withnot_sent: true. Not paced, no receipt. When the write is already so (already liked, already following),checksholds{ "check": "already", "already": true }.attendees_idsarray of stringrequiredOne person: their
provider_messaging_id(as Unipile asks),provider_id, username,@usernameor profile link. Two or more (a group):501.≥ 1 items · ≤ 1 items
Responses
200A dry run: nothing typed or sent.
›
application/json
objectstringThe write's own dry-run object, for example
MessageDryRun.not_sentanyAlwaystruechecksarray of object
201Sent.
›
application/json
objectanyAlwaysChatStartedchat_idstringmessage_idstring
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
404errors/resource_not_found: no such account in this workspace, or no such chat, message, person or post.
›
errors/resource_not_found: no such account in this workspace, or no such chat, message, person or post.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
409errors/in_progress: the same key is still running, or its outcome isn't known yet.
›
errors/in_progress: the same key is still running, or its outcome isn't known yet.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
415errors/unsupported_media_type: a file Instagram doesn't take. Nothing was sent.
›
errors/unsupported_media_type: a file Instagram doesn't take. Nothing was sent.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
422errors/idempotency_key_reused, errors/invalid_recipient (no Instagram account by that name or id), errors/user_unreachable (Instagram won't let the account message this person) or errors/cant_send_message (a message request is waiting for their answer: until they accept, one text message only). Nothing was sent.
›
errors/idempotency_key_reused, errors/invalid_recipient (no Instagram account by that name or id), errors/user_unreachable (Instagram won't let the account message this person) or errors/cant_send_message (a message request is waiting for their answer: until they accept, one text message only). Nothing was sent.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
429errors/too_many_requests: the account's pace (code: too_fast, daily_limit or hourly_limit; wait until retry_at), or Instagram's own "Try again later" (retry_after: 86400: wait a day before writing from the account again). Nothing was done.
›
errors/too_many_requests: the account's pace (code: too_fast, daily_limit or hourly_limit; wait until retry_at), or Instagram's own "Try again later" (retry_after: 86400: wait a day before writing from the account again). Nothing was done.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
501errors/feature_not_implemented: a field or option Lempile doesn't do for Instagram (detail says which), or an account of another network. Nothing was done.
›
errors/feature_not_implemented: a field or option Lempile doesn't do for Instagram (detail says which), or an account of another network. Nothing was done.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
502errors/service_unavailable: the browser's answer was lost after the write started. Not sure: read the receipt before sending again.
›
errors/service_unavailable: the browser's answer was lost after the write started. Not sure: read the receipt before sending again.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
503errors/service_unavailable: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.
›
errors/service_unavailable: the account isn't ready yet, or its browser can't be reached right now. Nothing was done.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
504errors/request_timeout: Instagram didn't confirm within 140 seconds. Not sure: read the receipt before sending again.
›
errors/request_timeout: Instagram didn't confirm within 140 seconds. Not sure: read the receipt before sending again.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?