Google Sheet Syncs API
A Google Sheet sync keeps one tab of a Google spreadsheet and one lead list or campaign in step, both ways. Each row is a lead, matched by a key column (email or LinkedIn URL). You choose which column is which lead field and which way each column flows. A column mapped to Status carries the lead status — a row set to “Stopped” (or a value you map to it) stops all outreach to that person in every campaign.Before you start
- Google Sheets must be connected in the app (Settings › Integrations › Google Sheets).
- Seleqt only has access to spreadsheets the connected Google account picked in Seleqt (Google’s
drive.filepermission). Pick the spreadsheet once in the app (with the Google picker, e.g. when setting up a sync or an export). After that, the API can create and manage syncs for it with itsspreadsheet_id(the long ID in the spreadsheet’s URL:docs.google.com/spreadsheets/d/<spreadsheet_id>/edit). A spreadsheet that was never picked fails with “Seleqt can’t open this spreadsheet any more”.
Available Endpoints
- GET /public/sheet-syncs/ - List the syncs of the workspace, a lead list or a campaign
- POST /public/sheet-syncs/ - Connect a tab (runs the first sync right away)
- POST /public/sheet-syncs/preview/ - What a sync would do, without writing anything
- GET /public/sheet-syncs/fields/ - The lead fields a column can map to
- GET /public/sheet-syncs/:id/ - One sync
- PATCH /public/sheet-syncs/:id/ - Change its settings, pause or resume it
- DELETE /public/sheet-syncs/:id/ - Disconnect (the Sheet and the leads stay)
- POST /public/sheet-syncs/:id/sync-now/ - Run it now
- GET /public/sheet-syncs/:id/logs/ - Its log
How a sync works
- Runs: every 5 minutes, plus on demand with sync now.
- Matching: each row is a lead by its key column. Columns are found by their header text (in
header_row), so renaming the tab, reordering or inserting columns doesn’t break anything. A mapped column that is gone is skipped and reported. Blank rows and rows without a key are skipped; when a key repeats, only its first row is synced. - Sheet → Seleqt (
in/both): a cell that changed since the last run updates the lead. - Seleqt → Sheet (
out/both): a lead value that changed since the last run is written to its cell. Write-only fields (company, last reply, campaign status, …) always follow the lead. - Changed in both places: the Sheet wins, and the log keeps the Seleqt value it replaced.
- First run for a row: nothing is overwritten on either side; only empty cells and empty lead fields are filled. A Status that stops outreach still applies.
- Empty values never clear the other side. The one exception is
next_action/next_action_date: when the lead has no pending step, the cell is cleared, but only while it still holds the value the sync wrote there (anything typed in the Sheet stays). - The key column is never overwritten from the Sheet. When the key changes in Seleqt, the row is still found and gets the new value.
- New rows → new leads when
create_leadsis on, at most 500 per run (the rest follow on the next runs). In a campaign, new leads then follow the campaign’s “Automatically launch new leads” setting. - New leads → new rows when
append_rowsis on, at most 2000 per run. - Deleted rows never delete leads: the lead stays in Seleqt (logged once) and isn’t added back to the Sheet.
- A sync reads up to 20,000 rows and columns up to
ZZ.
The sync object
Mappings
Each mapping is{ "column": "<header>", "field": "<lead field>", "direction": "both" | "in" | "out" }.
field: a lead field from GET /public/sheet-syncs/fields/ —first_name,last_name,email,phone_number,job_title,linkedin_profile_url,location,headline,about,lead_status, or a custom field ascustom_fields.<name>; write-only fieldsfull_name,company.name,company.website_url,company.industry,campaign_status,next_action,next_action_date,last_reply,replied_at,score.direction:both(default),in(Sheet → Seleqt only) orout(Seleqt → Sheet only).- Saved mappings are cleaned: a column is used at most once; write-only fields are always
out(aninmapping of one is dropped); the field used as the key is alwaysout.
Next action
next_action is the lead’s next pending step in its campaign, the same one the campaign’s lead table shows: the step’s name, else its type (LinkedIn invite, Email, Checking if invite accepted, …). next_action_date is when that step is scheduled, as YYYY-MM-DD HH:MM in UTC. Both are write-only and are refreshed on every run.
Status values
A column mapped tolead_status reads and writes lead statuses. A Sheet value matches a status when it is:
- a key of
status_values(up to 100 entries, values up to 100 characters), or - the status code or label (
STOPPED,Meeting booked, …), or - one of the built-in words: active, in progress, contacted, in sequence →
ACTIVE; replied, responded →REPLIED; interested, hot →INTERESTED; meeting booked, meeting scheduled, meeting →MEETING_BOOKED; not interested →NOT_INTERESTED; bounced →BOUNCED; unsubscribed, opted out →UNSUBSCRIBED; stopped, stop, do not contact, dnc, closed lost, lost →STOPPED.
_ and -. A value that matches nothing is skipped and reported in last_stats.status_unknown. When Seleqt writes a status to the Sheet, it writes the first status_values key mapped to that status, else the status label.
A status from the Sheet that stops outreach stops the person in every campaign. Changing it back in the Sheet does not restart anything — outreach is resumed in the app or with the lead status endpoints. Changes from a sync are recorded with source SHEET.
Last run stats
When a run fails
The error is saved inlast_error and logged; the sync keeps running every 5 minutes unless noted.
GET /api/v1/public/sheet-syncs/
List Google Sheet syncs, newest first. Auth:X-API-Key
Query Parameters
Without either, every sync in the workspace is returned.
