Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Emailable

Scalekit connector
Open markdown

The Emailable connector lets your AI agent act in each user's Emailable account. Each user connects their own Emailable access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 4 tools.

Tools
4
What they doRead · write · destructive
2 · 2 · 02 read2 write0 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Emailable connection

    In AgentKit > Connections, create an Emailable connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'emailable'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Emailable:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'emailable_account_get',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Emailable credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • emailable_account_getGet the Emailable account's owner email and available verification credits.Read-only

    Get Account

    Get the Emailable account's owner email and available verification credits. Returns owner_email and available_credits. Use emailable_account_get to check the balance before a verification or batch.

    Inputs

    This tool takes no inputs.

  • emailable_batch_getGet the status and, once finished, the results of an Emailable batch.Read-only

    Get Batch Verification

    Get the status and, once finished, the results of an Emailable batch. While running, returns message, processed and total. When finished, returns id, total_counts by state (with processed and total), reason_counts, and either emails (per-address results, for batches of up to 1,000) or download_file (a link to a zipped CSV, for larger batches). Per-address results are kept for 30 days and download links for 5 days. Use emailable_batch_get to poll a batch started with emailable_batch_create. Set partial to see results so far for a small batch. Requires the batch id returned by emailable_batch_create.

    Inputs

    batch_idstringrequired
    ID of the batch, returned as id by emailable_batch_create. Example: 5cf6dd30093f96d2ac34bb0a.
    partialboolean
    Set true to include results so far while the batch is still verifying. Only for batches of up to 1,000 emails. Defaults to false. Example: true.
    simulatestring
    With a test key only, simulate a batch state or error. Example: verifying.one of generic_errorimportingverifyingpaused
  • emailable_batch_createStart verifying a batch of up to 50,000 email addresses in the background and spend one credit per address (test keys spend none).Write

    Create Batch Verification

    Start verifying a batch of up to 50,000 email addresses in the background and spend one credit per address (test keys spend none). Returns id (the batch ID) and message. Results are not in the response. Use emailable_batch_create to verify a list. Use emailable_email_verify for one address. Poll emailable_batch_get with the returned id, or pass callback_url to receive the results when the batch finishes.

    Inputs

    emailsarrayrequired
    The email addresses to verify, up to 50,000. Example: ["tim@smith.com", "john@smith.com"].
    callback_urlstring
    URL that Emailable sends the batch results to with an HTTP POST when the batch finishes. The body matches emailable_batch_get's output. It must answer 200, or Emailable retries hourly for up to 3 days. Example: http://example.com/callback.
    response_fieldsarray
    Limit the fields returned for each email in the results to these. All fields are returned when omitted. Example: ["email", "state", "reason"].
    retriesboolean
    Set false to turn off automatic retries for some mail-server responses. That is faster but may return more unknown results. Defaults to true. Example: false.
    simulatestring
    With a test key only, simulate an API response instead of creating a batch. Example: insufficient_credits_error.one of generic_errorinsufficient_credits_errorpayment_error
  • emailable_email_verifyVerify one email address in real time and spend one Emailable credit (test keys spend none).Write

    Verify Email

    Verify one email address in real time and spend one Emailable credit (test keys spend none). Returns state (deliverable, undeliverable, risky or unknown), reason, score, role, free, disposable, accept_all, mailbox_full, no_reply, did_you_mean, domain, mx_record, smtp_provider, user, tag, possible first, last and full name, gender and duration. If verification is still running after the timeout, Emailable answers with status 249 and a message to send the same request again; retrying within 5 minutes costs no extra credit. Use emailable_email_verify for one address at a time, such as at sign-up. Use emailable_batch_create for a list.

    • Idempotent

    Inputs

    emailstringrequired
    The email address to verify. Example: john@smith.com.
    accept_allboolean
    Set true to run an accept-all (catch-all) check on the domain. It adds a lot of response time. Defaults to false. Example: true.
    smtpboolean
    Set false to skip the SMTP check. That is much faster but significantly less accurate. Defaults to true. Example: false.
    timeoutinteger
    Seconds to wait for a result, 2 to 10. Defaults to 5. Use 8 or less to stay within the tool-call time limit; on a timeout Emailable returns status 249 and you can retry. Example: 5.