Connect a Google Workspace mailbox
- Create an OAuth session with
{"provider":"google"}. If Google Workspace restricts app access, an administrator adds Coldy in Google Admin → API controls → App access control. Search for the app usingworkspace_setup.client_idfrom the response and allow access for the relevant organizational unit. - Give the mailbox owner the
authorization_url. The owner opens it in a browser and grants access. The link is valid for 10 minutes. Create a new session if it expires during setup. - Poll the session status with the same API key. Save
account_idwhen the status isconnected. Readerror_codewhen it isfailed, or create a new session when it isexpired. To reconnect, passreconnect_account_idand choose the same Google mailbox. Coldy preserves itsaccount_id.
Prepare and select leads
- Create a list and add columns. Save the
list_idandcolumn_idvalues. When importing a CSV, map headers to column IDs usingcolumn_mapping. When appending JSON rows, use column IDs as keys for cell values. - Read list rows with JSON encoded in the
filtersquery parameter and text insearch. Passnext_cursorwith the same filters, search, and sort to read the next page. Update cells usingrow_idand column IDs. Locked columns, formulas, and email verification results are read-only. - Delete selected rows to clean up a list. You can check your selection by reading the rows first. Deleting the last rows preserves the list structure. CSV export returns the CSV in JSON and uses the same pagination.
- To verify email addresses separately, start an email verification batch, check its status, and get the results. This operation is billed per unique valid address and is available independently of a list transfer.
Transfer selected rows to a draft campaign
In the transfer preview, send campaign_id, select explicit row_ids or use filters and search, and provide column_mapping. Map exactly one column to email. For a variable such as {{sector}}, map the Sector column to custom_field. Built-in variable names are reserved.
This example selects rows with a nonempty email. Replace the UUIDs with your campaign and column IDs.
{
"campaign_id": "7b59e918-1730-472d-a05a-8139ed9f8caa",
"selection": {
"filters": {
"has_email": {
"field": "18fbe20f-7876-4459-aa70-9b91cb43539e",
"operator": "not_empty"
}
}
},
"column_mapping": {
"18fbe20f-7876-4459-aa70-9b91cb43539e": "email",
"2f5bac49-a2e6-4ac4-9fb7-0455116d00a8": "custom_field"
}
}
Review the counts for eligible, duplicate, invalid, and excluded email addresses. Then confirm the transfer with campaign_id and snapshot_id. The snapshot is valid for 60 minutes. If the selection changes, create a fresh preview. Confirming the same snapshot again returns the original import_id.
Poll the import status until it reaches completed or failed. The transfer adds leads to a campaign in Draft. Launching the campaign is a separate request.
Check the email and launch the campaign
- Specify senders in
account_idswhen updating the campaign. This field sets the entire collection of linked accounts. List the linked accounts and choose a connectedaccount_id. - List template variables. Built-in variables are available immediately. Custom fields come from leads already saved in the campaign. If a field is empty for every imported lead, it may not appear in the response yet.
- Preview a sequence step with a
lead_idandaccount_id. Readmissing_variablesfor missing values for that pair andinvalid_template_fieldsfor syntax errors in the subject or body. You can send a test email to one explicit recipient. Check that mailbox before retrying after a timeout. - Check readiness for blockers and warnings. For example,
UNKNOWN_VARIABLESmeans the name is unavailable,INVALID_VARIABLE_SYNTAXidentifies malformed braces, andNO_ELIGIBLE_LEADSmeans the campaign has no eligible leads to send to.
| Scenario | Launch method |
|---|---|
| Import leads before launch | Use checked activation. It checks readiness again just before activation. Read details.readiness if the endpoint returns 409. |
| Add leads gradually | Use standard activation after configuring the first step and a sender. Then add leads in batches. If the campaign reaches Completed between batches, call standard activation again after adding the next batch. |