Import up to 10,000 readers with a source declaration
On this page
POST
/v1/importscreate_import| Risk | bulk |
| Authentication | API key or OAuth access token |
| Scopes | subscribers:write_confirmed |
| Idempotency | required: send an Idempotency-Key header |
| Dry run | yes: add dry_run=true to the query |
| Success status | 200 |
| Response type | application/json |
What it does#
- Use when: You move a list you collected yourself; you declare where it came from and confirm they agreed.
- Do not use when: the list was purchased or scraped (refused), or for a single reader (call upsert_subscriber).
- Side effects: Creates confirmed subscribers; Records consent events with your attestation; Stores an import assessment.
- Reversible: No.
- Required scope: subscribers:write_confirmed.
- Idempotency: required (Idempotency-Key header).
- Typical next step: call get_import for the assessment.
Scopes#
subscribers:write_confirmed: Add subscribers as already confirmed. You declare where the readers came from and attest to their consent.
Side effects#
- Creates confirmed subscribers
- Records consent events with your attestation
- Stores an import assessment
Request#
Path parameters#
None.
Query parameters#
None.
Every mutation also accepts dry_run=true: it runs every check and returns {"dry_run": true, "would": {...}} without writing anything.
Body (application/json)#
| Field | Type | Required | Description |
|---|---|---|---|
rows | array of object, max 10000 items | yes | |
rows[].email | string, max 254 characters | yes | |
rows[].name | string, max 400 characters | no | |
rows[].tags | array of string, max 50 characters, max 20 items | no | |
list_ids | array of string, max 50 items | no | |
declaration | object | yes | |
declaration.origin | one of "mailchimp", "mailerlite", "kit", "beehiiv", "substack", "ghost", "bookfunnel", "storyorigin", "own_site", "in_person", "other" | yes | |
declaration.collected | one of "signup_form", "reader_magnet", "store_or_checkout", "in_person", "purchased_or_rented", "scraped_or_appended", "other" | yes | |
declaration.lastMailed | one of "under_3_months", "3_to_12_months", "12_to_24_months", "over_24_months", "never" | yes | |
declaration.optInUrls | array of string (uri), max 2048 characters, max 5 items | no | |
declaration.note | string, max 1000 characters | no | |
attestation_accepted | exactly true | yes | You confirm these readers asked to hear from you; the attestation text is stored with each consent event |
Response#
| Field | Type | Required | Description |
|---|---|---|---|
import_id | string | no | |
imported | integer, min -9007199254740991, max 9007199254740991 | yes | |
existing | integer, min -9007199254740991, max 9007199254740991 | yes | |
skipped | integer, min -9007199254740991, max 9007199254740991 | yes | |
rejected | object | yes | |
rejected.invalid | integer, min -9007199254740991, max 9007199254740991 | yes | |
rejected.suppressed | integer, min -9007199254740991, max 9007199254740991 | yes | |
decision | one of "clean", "risky", "refuse" | no | |
signals | array of string | no |
Examples#
import#
Request:
curl -X POST 'https://api.seemly.com/v1/imports' \
-H "Authorization: Bearer $SEEMLY_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"rows": [
{
"email": "[email protected]",
"name": "Sam"
}
],
"declaration": {
"origin": "own_site",
"collected": "signup_form",
"lastMailed": "under_3_months"
},
"attestation_accepted": true
}'const response = await fetch("https://api.seemly.com/v1/imports", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SEEMLY_API_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
"rows": [
{
"email": "[email protected]",
"name": "Sam"
}
],
"declaration": {
"origin": "own_site",
"collected": "signup_form",
"lastMailed": "under_3_months"
},
"attestation_accepted": true
}),
});
const result = await response.json();
console.log(response.status, result);import os
import uuid
import requests
response = requests.post(
"https://api.seemly.com/v1/imports",
headers={
"Authorization": f"Bearer {os.environ['SEEMLY_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"rows": [
{
"email": "[email protected]",
"name": "Sam",
},
],
"declaration": {
"origin": "own_site",
"collected": "signup_form",
"lastMailed": "under_3_months",
},
"attestation_accepted": True,
},
)
print(response.status_code, response.json())Response: 200:
{
"import_id": "imp_0123456789abcdefghjkmnpq",
"imported": 1,
"existing": 0,
"skipped": 0,
"rejected": {
"invalid": 0,
"suppressed": 0
},
"decision": "clean",
"signals": []
}Errors#
Every error is an application/problem+json body with a code, a fix sentence and next_actions. See reading a problem response.