← Email List Cleaner
Your token

Email List Cleaner API

Reading the list, removing duplicates, the format check, typo fixes, test and throwaway domains, the reasons and every download run free in the browser and need no API. The API is for the one metered step: send the addresses that could not be repaired (and valid ones whose domain looks mistyped), and get back, as JSON, one decision per address: fix (with the corrected address), drop or keep, each with a reason id. The page builds this input for you and checks every fix before it is used.

Base URL: https://api.skillsafe.ai/v1/app-api. Every response is {"data": ...} or {"error": {"code", "message"}}; read error.code and error.message rather than the HTTP status alone.

The task field

This app has one task. Always send "task": "fix".

taskWhat it doesReply
fixDecides, for each address sent, whether it can be repaired without guessing (fix), cannot (drop), or is fine as typed (keep).One JSON object

Input fields

Every field is a string; items and page_facts hold JSON text. task, items and page_facts are required.

FieldMeaning
task"fix"
itemsJSON list of {id, typed, issue, context?, looks_like?}, at most 40. issue is the format problem (no_at, many_at, empty_domain, space, double_dot, domain_no_dot and so on) or looks_mistyped with looks_like naming the domain it may have meant. context is the line or row it came from.
page_facts{addresses_kept, domains_in_list: [{domain, count}]}: the domains already in the clean list.
clipped_noteEmpty, or a sentence saying only some addresses were sent.

The reply

job.output.output is text holding one JSON object: items, a list of {id, action, fixed?, reason} in the order sent. action is fix (reasons typo_domain, typo_ending, missing_ending, stray_character, joined_from_context, wrong_separator), drop (cannot_tell_domain, space_inside, not_an_address, placeholder) or keep (real_domain, cannot_tell_provider, for looks_mistyped items only). Before using a fix, check it as the page does: it is a valid address, the part before the @ only lost stray characters, and the domain is the typed one, a big mail provider's or one already in your list, close to what was typed. If the balance ran low, truncated is true and the object may stop early; the page keeps every item that arrived whole.

Worked example

Input (input.json), from the page's "Messy pasted list" example:

{
  "task": "fix",
  "items": "[{\"id\":\"e7\",\"typed\":\"frank@@yahoo.com\",\"issue\":\"many_at\"},{\"id\":\"e11\",\"typed\":\"ivan@company\",\"issue\":\"domain_no_dot\"},{\"id\":\"e13\",\"typed\":\"kai.lee@\",\"issue\":\"empty_domain\",\"context\":\"kai.lee@ gmail.com\"}]",
  "page_facts": "{\"addresses_kept\":9,\"domains_in_list\":[{\"domain\":\"gmail.com\",\"count\":3},{\"domain\":\"brightside-bakery.com\",\"count\":1},{\"domain\":\"hey.com\",\"count\":1},{\"domain\":\"hotmail.com\",\"count\":1},{\"domain\":\"icloud.com\",\"count\":1},{\"domain\":\"outlook.com\",\"count\":1},{\"domain\":\"yahoo.com\",\"count\":1}]}",
  "clipped_note": ""
}

Reply:

{"items":[{"id":"e7","action":"fix","fixed":"frank@yahoo.com","reason":"stray_character"},{"id":"e11","action":"drop","reason":"cannot_tell_domain"},{"id":"e13","action":"fix","fixed":"kai.lee@gmail.com","reason":"joined_from_context"}]}

Errors

HTTPWhat to do
401The token is missing, expired or a guest token on a run. Get a personal token on the token page.
402The balance is below what the run reserves. Top up at skillsafe.ai/account/billing.
400The body is not a JSON object of the fields above, or a required field is missing or empty.
429Wait and retry with the same Idempotency-Key.

Step 1 — a tiny client helper

One function that sends JSON and unwraps the {data, error} envelope.

BASE="https://api.skillsafe.ai/v1/app-api"
TOKEN="paste-your-token-here"   # from https://email-list-cleaner.skillsafe.ai/tokens.html
api() { # api METHOD PATH [JSON-BODY]
  curl -s -X "$1" "$BASE$2" -H "Content-Type: application/json" \
    ${TOKEN:+-H "Authorization: Bearer $TOKEN"} ${3:+--data "$3"}
}

Step 2 — a token

A guest token is enough for /me and /estimate. A run is metered, so it needs your personal token: sign in on the token page and copy it.

# a guest token (enough for /me and /estimate); a run needs your personal token from /tokens.html
TOKEN=$(curl -s -X POST "$BASE/guest" -H "Content-Type: application/json" -d '{"slug":"email-list-cleaner"}' | jq -r '.data.token')

Step 3 — who am I, and my balance

subject_type is guest or user; credits is the balance (1 credit = $0.0001).

api GET /me | jq '.data | {subject_type, credits}' 

Step 4 — price a run for free

/estimate charges nothing and starts no job. hold_credits is the amount reserved while a run is in flight, not the price; the run is charged what it uses.

# input.json: the run input object - {"task": "fix", "items": "[{\"id\":\"e7\",\"typed\":\"frank@@yahoo.com\",\"issue\":\"many_at\"},{\"id\":\"e11\",\"typed\":\"ivan@company\",\"issue\":\"domain_no_dot\"},{\"id\":\"e13\",\"typed\":\"kai.lee@\",\"issue\":\"empty_domain\",\"context\":\"kai.lee@ gmail.com\"}]", "page_facts": "{...}", "clipped_note": ""}
api POST /estimate "$(cat input.json)" | jq '.data | {hold_credits, min_credits, model, model_alias, markup_bps, warnings}' 

Step 5 — run it and wait for the job

Send an Idempotency-Key derived from the input: a retry with the same key is never billed twice.

KEY="email-list-cleaner:fix:$(shasum -a 256 input.json | cut -c1-16):a1"
JOB=$(curl -s -X POST "$BASE/run" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: $KEY" --data @input.json | jq -r '.data.job_id')
while :; do
  J=$(api GET "/jobs/$JOB"); S=$(echo "$J" | jq -r '.data.status')
  case "$S" in succeeded|failed|cancelled) break;; esac; sleep 2
done
echo "$J" | jq -r '.data.output.output' > reply.json   # one JSON object: items
echo "$J" | jq '.data | {charged_credits, truncated}' 

Step 6 — or stream it

/run-stream sends Server-Sent Events while the job runs and the finished job at the end.

# Server-Sent Events: tick/delta events while the job runs, then a final event with the job
curl -N -s -X POST "$BASE/run-stream" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: email-list-cleaner:fix:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json