Imports API reference

Bring campaigns and leads in from another sender. 2 operations.

For AI agents: the docs index is at /llms.txt, and every page is also served as markdown at its URL plus .md.

#Operations

Authenticate as described in Authentication. Every operation below is generated from the OpenAPI document.

Method and pathScopeWhat it does
POST /v1/import/instantlywriteImport from Instantly
POST /v1/import/smartlead-csvwriteImport a Smartlead lead export

#POST /v1/import/instantly

Reads your campaigns, leads and blocklist from Instantly with your Instantly API key (used for this request only, never stored) and creates them here: campaigns as DRAFTS with their sequence, leads (people on your suppression list and new leads beyond your plan's contact cap are skipped and counted), and the blocklist as suppression entries. Reads everything first and writes only if every read succeeded, so a vendor error changes nothing. Mailbox passwords cannot be imported: reconnect every mailbox and add it to each campaign. Limits per import: 25 campaigns, 5000 leads, 5000 blocklist entries; anything beyond is listed in truncated.

Scope: write. A read key gets 403 forbidden. Success: HTTP 200.

Request body

Send JSON with Content-Type: application/json. The body is required.

FieldTypeRequiredDescription
api_keystringyesAn Instantly API v2 key. Used for this request only. 1 to 500 characters.
Request example
{
  "api_key": "abc123"
}

Response

FieldTypeRequiredDescription
campaignsarray of objectyesNo further constraints.
campaigns[].external_idstringyesNo further constraints.
campaigns[].idstringyesNo further constraints.
campaigns[].namestringyesNo further constraints.
campaigns[].steps_importedintegeryesNo further constraints.
campaigns[].warningsarray of stringyesNo further constraints.
leadsobjectyesNo further constraints.
leads.createdintegeryesNo further constraints.
leads.updatedintegeryesNo further constraints.
leads.rejectedintegeryesRows that are not usable, for example an invalid address.
leads.skipped_suppressedintegeryesOn your suppression list: not imported.
leads.skipped_over_plan_capintegeryesNew leads that would exceed the plan's active contact cap: not imported.
suppressionobjectyesNo further constraints.
suppression.createdintegeryesNo further constraints.
suppression.rejectedintegeryesNo further constraints.
truncatedarray of stringyesWhat was cut at the per-import limit, so you can import in parts.
mailboxesstringyesMailboxes are not importable: reconnect them.
webhooksstringyesNo further constraints.
Response example, HTTP 200
{
  "campaigns": [
    {
      "external_id": "id_8f3a2c1d",
      "id": "id_8f3a2c1d",
      "name": "Example",
      "steps_imported": 1,
      "warnings": [
        "abc123"
      ]
    }
  ],
  "leads": {
    "created": 1,
    "updated": 1,
    "rejected": 1,
    "skipped_suppressed": 1,
    "skipped_over_plan_cap": 1
  },
  "suppression": {
    "created": 1,
    "rejected": 1
  },
  "truncated": [
    "abc123"
  ],
  "mailboxes": "abc123",
  "webhooks": "abc123"
}

Errors

invalid_input, unauthorized, forbidden, payload_too_large, rate_limited, internal_error, provider_unavailable. Every error uses the single format.

Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Over the limit the answer is 429 rate_limited with Retry-After. See Rate limits.

Examples

cURL
curl -X POST "https://api.coldagentai.com/v1/import/instantly" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "abc123"
}'
JavaScript (fetch)
const res = await fetch(`https://api.coldagentai.com/v1/import/instantly`, {
  method: 'POST',
  body: JSON.stringify({
    "api_key": "abc123"
  }),
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}`, 'Content-Type': 'application/json' },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();

#POST /v1/import/smartlead-csv

Imports a Smartlead (or generic) lead CSV into a campaign you own. Send the CSV text as the request body and name the campaign in campaign_id. Handles a byte-order mark, quoted fields, CRLF and duplicate headers; at most 1000 rows. Cells that start with = + - or @ are kept as text and listed in flagged_cells. People on your suppression list and new leads beyond your plan's contact cap are skipped and counted. Smartlead has no API import here: export the CSV from Smartlead and send it.

Scope: write. A read key gets 403 forbidden. Success: HTTP 200.

Query parameters

FieldTypeRequiredDescription
campaign_idstringyesThe campaign to add the leads to. 1 to 100 characters
layout"smartlead" or "generic"nodefault "smartlead"

Request body

Send the body as text/plain. The body is required.

Request example
abc123

Response

FieldTypeRequiredDescription
layout"smartlead" or "generic"yesNo further constraints.
rows_readintegeryesNo further constraints.
leadsobjectyesNo further constraints.
leads.createdintegeryesNo further constraints.
leads.updatedintegeryesNo further constraints.
leads.rejectedintegeryesRows that are not usable, for example an invalid address.
leads.skipped_suppressedintegeryesOn your suppression list: not imported.
leads.skipped_over_plan_capintegeryesNew leads that would exceed the plan's active contact cap: not imported.
rejected_rowsarray of objectyesNo further constraints.
rejected_rows[].lineinteger or nullyesNo further constraints.
rejected_rows[].emailstring or nullyesNo further constraints.
rejected_rows[].reasonstringyesNo further constraints.
flagged_cellsarray of objectyesNo further constraints.
flagged_cells[].lineintegeryesNo further constraints.
flagged_cells[].columnstringyesNo further constraints.
flagged_cells[].reasonstringyesNo further constraints.
warningsarray of stringyesNo further constraints.
mailboxesstringyesNo further constraints.
Response example, HTTP 200
{
  "layout": "smartlead",
  "rows_read": 1,
  "leads": {
    "created": 1,
    "updated": 1,
    "rejected": 1,
    "skipped_suppressed": 1,
    "skipped_over_plan_cap": 1
  },
  "rejected_rows": [
    {
      "line": 1,
      "email": "maya@example.com",
      "reason": "abc123"
    }
  ],
  "flagged_cells": [
    {
      "line": 1,
      "column": "abc123",
      "reason": "abc123"
    }
  ],
  "warnings": [
    "abc123"
  ],
  "mailboxes": "abc123"
}

Errors

invalid_input, unauthorized, forbidden, unknown_product, payload_too_large, rate_limited, internal_error. Every error uses the single format.

Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Over the limit the answer is 429 rate_limited with Retry-After. See Rate limits.

Examples

cURL
curl -X POST "https://api.coldagentai.com/v1/import/smartlead-csv?campaign_id=id_8f3a2c1d" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY" \
  -H "Content-Type: text/plain" \
  -d 'abc123'
JavaScript (fetch)
const res = await fetch(`https://api.coldagentai.com/v1/import/smartlead-csv?campaign_id=id_8f3a2c1d`, {
  method: 'POST',
  body: "abc123",
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}`, 'Content-Type': 'text/plain' },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();
Imports