Connect a Google Workspace mailbox

  1. 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 using workspace_setup.client_id from the response and allow access for the relevant organizational unit.
  2. 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.
  3. Poll the session status with the same API key. Save account_id when the status is connected. Read error_code when it is failed, or create a new session when it is expired. To reconnect, pass reconnect_account_id and choose the same Google mailbox. Coldy preserves its account_id.

Prepare and select leads

  1. Create a list and add columns. Save the list_id and column_id values. When importing a CSV, map headers to column IDs using column_mapping. When appending JSON rows, use column IDs as keys for cell values.
  2. Read list rows with JSON encoded in the filters query parameter and text in search. Pass next_cursor with the same filters, search, and sort to read the next page. Update cells using row_id and column IDs. Locked columns, formulas, and email verification results are read-only.
  3. 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.
  4. 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

  1. Specify senders in account_ids when updating the campaign. This field sets the entire collection of linked accounts. List the linked accounts and choose a connected account_id.
  2. 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.
  3. Preview a sequence step with a lead_id and account_id. Read missing_variables for missing values for that pair and invalid_template_fields for 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.
  4. Check readiness for blockers and warnings. For example, UNKNOWN_VARIABLES means the name is unavailable, INVALID_VARIABLE_SYNTAX identifies malformed braces, and NO_ELIGIBLE_LEADS means the campaign has no eligible leads to send to.
ScenarioLaunch method
Import leads before launchUse checked activation. It checks readiness again just before activation. Read details.readiness if the endpoint returns 409.
Add leads graduallyUse 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.