Import Leads From Senler.ru Through The API
The API loads subscribers from a linked Senler.ru channel as leads in Senler.io. You do not need to supply a list of external IDs. To start from the cabinet, use Import leads in channel settings; for your own integration, use the requests below.
Prepare The Channel And Authorization
- Connect a channel for VK, Telegram, or MAX in Senler.io.
- Link the corresponding Senler.ru channel. The Senler.ru connection must be valid; the platform bot token does not replace it.
- Obtain a user OAuth token with
subject=user. Starting an import requirescan_manage_leadsin the channel's project, reading the result requirescan_view_processes, and cancellation requirescan_manage_processes. The user must also have these permissions.
A project API key or project OAuth token cannot start this import: the operation runs on behalf of a user. Keep the OAuth token on your integration server.
Start The Import
Set channel_id to the channel's Senler.io UUID, not its numeric Senler.ru channel ID:
curl --fail-with-body \
"https://api.senler.io/api/processes/import-senler-leads" \
--header "Authorization: Bearer $USER_ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data "{\"channel_id\":\"$CHANNEL_ID\"}"
A 201 Created response contains a new or already active background process of type leads_import_senler. While the channel import is running, repeated and concurrent requests return the same id. Save its id. Creating the process does not mean the import is complete.
The import adds new profiles with their external ID and available first name, last name, username, avatar, subscription status, and blacklist flag from Senler.ru. An unknown subscription status in a source record is not treated as subscribed.
Existing leads in the same channel are skipped: their profile, subscription, and blacklist state are not overwritten. Conversation history, bot settings, subscriber groups, and Senler.ru variables are not transferred. The import does not send messages or start automations.
Check The Result
To recover the process after reloading or losing a response, call GET /api/processes/import-senler-leads/CHANNEL_ID. The response contains process with the last saved import for this channel, or null if none exists. This requires can_view_processes.
Request GET /api/processes/PROCESS_ID with the same authorization header:
pending,preparing,processing: the process has not finished;completed: the import has finished; check the counters inresult;failed: the import stopped with an error;cancelled: the import was cancelled.
While the total number of records is unknown, progress may be absent. A missing percentage does not mean the process has stopped.
The result is also available through GET /api/processes/PROCESS_ID/result. The result fields mean:
imported: leads added;skipped: leads that already existed;updated: always0, because this import does not update existing profiles;failed: records that could not be processed.
For errors, use the safe error_code rather than technical text:
senler_import_connection_required— refresh the Senler.ru connection and start again;senler_import_connection_changed— the channel or link has changed; start a new import from the intended channel;senler_import_source_unavailablewhile active — the request will retry automatically; withfailed, attempts are exhausted, so try importing later;senler_import_source_rejected— check the connection; if the rejection persists, contact support;senler_import_invalid_response— try importing later; if the error persists, contact support.
Check failed even when the status is completed: finishing the source list does not mean every record was added.
Stop Or Repeat The Import
DELETE /api/processes/PROCESS_ID cancels a process in pending, preparing, or processing. Leads already added remain. For a finished process, the same request deletes the log entry, not the leads.
A repeated POST returns the active import for the channel. After completion, cancellation, or failure, it creates a new import. To check progress, use the saved ID or the channel’s latest import endpoint.
A repeated import skips existing leads and can add new ones. It does not synchronize changed profiles. Do not change the linked Senler.ru channel during the import: the same process cannot continue with a different link.