Accounts And Connecting
Connecting an Instagram account (dashboard, hosted link or API), Instagram's sign-in codes, reconnecting, and account statuses.
Early access. Tell us what you're building and we'll set you up. Contact us
An Instagram account in Lempile is one Instagram login, signed in once in its own browser, behind its own IP. No other account uses that IP. Lempile keeps the account signed in; you never handle its cookies.
List And Read Accounts#
GET /accounts lists the workspace's accounts, every network together. An
Instagram account has provider: "instagram".
GET /accounts/{account_id} answers Unipile's Account:
curl -sS "https://api.lempile.com/api/v1/accounts/$ACCOUNT_ID" \
-H "X-API-KEY: $LEMPILE_API_KEY"{
"object": "Account",
"type": "INSTAGRAM",
"id": "00000000-0000-4000-8000-0000000000c1",
"name": "janedemo",
"created_at": "2026-11-25T18:20:41.000Z",
"sources": [{ "id": "instagram_browser_session", "status": "OK" }]
}Neither route opens the account's browser.
sources[].status |
Meaning |
|---|---|
OK |
Signed in and ready. |
CONNECTING |
Signing in. |
CREDENTIALS |
Instagram signed the account out (a new password, or a session Instagram ended), asked for a check, or restricted the account. Connect it again, or look at it on Instagram. |
ERROR |
Lempile can't reach the account's browser or IP right now. |
GET /accounts/{id} also shows lifecycle: status (running,
connecting, disconnected, deleted), reason (such as signed_out,
checkpoint or restricted) and since. The account_status webhook sends
each change (Webhooks).
An account Instagram suspended or disabled shows restriction (why, and since
when) in GET /accounts, and stays restricted until a person clears it: every
call on it answers 403 errors/account_restricted, and a new sign-in is
refused. Appeal on Instagram, then write to support@lempile.com.
Three Ways To Connect#
- The dashboard: Accounts, then Instagram. You type the username and password, then Instagram's code when it asks for one.
- A hosted link (
POST /hosted/accounts/link): Lempile's own page does the same for someone else, for example a customer of yours. - The API (
POST /accounts): your own screens collect the username, the password and Instagram's code, and pass them on.
In all three, the sign-in runs in the account's own browser, from the account's own IP, and the person answers Instagram's own checks (a code, or an approval in the Instagram app).
Instagram is in early access. A workspace that isn't open for it yet gets
403 errors/feature_not_subscribed on POST /accounts,
POST /accounts/{account_id} and POST /hosted/accounts/link. Write to
support@lempile.com to join.
Connect With The API#
curl -sS -X POST "https://api.lempile.com/api/v1/accounts" \
-H "X-API-KEY: $LEMPILE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "provider": "INSTAGRAM", "username": "janedemo", "password": "…" }'Lempile answers within 60 seconds. Either the account is in:
{ "object": "AccountCreated", "account_id": "00000000-0000-4000-8000-0000000000c1" }or Instagram asks for something first (status 202):
{
"object": "Checkpoint",
"account_id": "00000000-0000-4000-8000-0000000000c1",
"checkpoint": {
"type": "OTP",
"source": "EMAIL",
"can_try_another_way": true
}
}checkpoint.type |
What Instagram wants |
|---|---|
OTP |
A code Instagram sent by EMAIL, SMS or WHATSAPP (source). |
2FA |
The account's two-factor code: from an authenticator app (source: "APP") or by SMS. |
IN_APP_VALIDATION |
Someone approves the sign-in in the Instagram app on the account's phone. number is the number to tap there, when Instagram shows one. Then read the account until it's OK. |
CONNECTING |
Instagram is still signing in after 60 seconds (a slow page, for example). Read GET /accounts/{account_id} until it's OK. A new POST /accounts meanwhile answers 425 errors/auth_in_progress, with the checkpoint when Instagram asked for one. |
username may also be the account's email or phone number. Other answers:
| Status | type |
When |
|---|---|---|
400 |
errors/missing_parameters, errors/invalid_parameters |
A field is missing or isn't valid. |
401 |
errors/invalid_credentials |
Instagram refused the username or password. |
403 |
errors/password_reset_required, errors/action_required |
Instagram wants a new password, or something done on Instagram itself. |
409 |
errors/already_exists |
The account is already connected in this workspace. |
429 |
errors/too_many_requests |
Instagram asks to wait (retry_after). |
503 |
errors/service_unavailable |
Lempile can't start the sign-in right now (no free IP for a new account, or its browser server is busy). Nothing was done. |
Only username and password sign in. A sessionid cookie answers 501:
Instagram ends a session that moves to a new device and IP.
Answer A Checkpoint#
curl -sS -X POST "https://api.lempile.com/api/v1/accounts/checkpoint" \
-H "X-API-KEY: $LEMPILE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "provider": "INSTAGRAM", "account_id": "'"$ACCOUNT_ID"'", "code": "482913" }'The answer is AccountCreated, or another Checkpoint when Instagram asks for
one more thing.
code |
|
|---|---|
| the code | The code Instagram sent. |
TRY_ANOTHER_WAY |
Presses Instagram's own "Try another way": another kind of check. 409 errors/checkpoint_switching_not_available when Instagram offers none. |
A wrong code answers 401 errors/invalid_checkpoint_solution: send the right
one. An OTP or 2FA answer must be the code's digits (4 to 8), else 400.
POST /accounts/checkpoint/resend (provider, account_id) asks Instagram to
send the code again, as its own "Send again" does:
{ "object": "CheckpointResend", "account_id": "00000000-0000-4000-8000-0000000000c1", "success": true }A sign-in waits 5 minutes for its checkpoints. After that, an answer gets
408 errors/request_timeout: start again with POST /accounts.
Hosted Links#
curl -sS -X POST "https://api.lempile.com/api/v1/hosted/accounts/link" \
-H "X-API-KEY: $LEMPILE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "create",
"providers": ["INSTAGRAM"],
"api_url": "https://api.lempile.com/api/v1",
"expiresOn": "2026-11-26T18:00:00.000Z"
}'{ "object": "HostedAuthUrl", "url": "https://lempile.com/connect/instagram?token=…" }- Whoever opens the link signs in on Lempile's page, with Instagram's code when it asks. The new account joins your key's workspace.
- A link lasts 24 hours at most. Treat it as a secret: anyone with it can connect an account to your workspace until it expires.
- To connect an existing account again, send
"type": "reconnect"and"reconnect_account": "<account_id>".
Reconnect#
When an account shows CREDENTIALS, sign it in again: in the dashboard, with a
reconnect link, or with POST /accounts/{account_id} and the same body as
POST /accounts. It answers AccountReconnected or a Checkpoint. The account
keeps its id and its IP.
Remove#
DELETE /accounts/{account_id} removes the account from Lempile.
Was this page helpful?