Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Courier

Scalekit connector
Open markdown

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

Tools
58
What they doRead · write · destructive
24 · 24 · 1024 read24 write10 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 Courier connection

    In AgentKit > Connections, create a Courier 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 = 'courier'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Courier:', 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: 'courier_audiences_list',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Courier 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
  • courier_audience_getReturn one audience with its name, description, and the filter and AND or OR operator that decide which users belong to it.Read-only

    Get an Audience

    Return one audience with its name, description, and the filter and AND or OR operator that decide which users belong to it. Returns an object with id, name, description, operator, filter, created_at, updated_at. Use this when you have the ID. Use courier_audiences_list to find one. Needs audience_id from courier_audiences_list.

    Inputs

    audience_idstringrequired
    A unique identifier representing the audience_id. Example: vip-customers
  • courier_audience_members_listReturn the users currently matching an audience filter, with paging.Read-only

    List Audience members

    Return the users currently matching an audience filter, with paging. Returns items, an array of items with added_at, audience_id, audience_version, member_id, reason, plus paging. Needs audience_id from courier_audiences_list.

    Inputs

    audience_idstringrequired
    A unique identifier representing the audience id. Example: vip-customers
    cursorstring
    A unique identifier that allows for fetching the next set of members. Example: eyJpZCI6IjEyMyJ9
  • courier_audiences_listReturn the audiences in the workspace with paging.Read-only

    List all Audiences

    Return the audiences in the workspace with paging. Returns items, an array of items with id, name, description, operator, filter, created_at, updated_at, plus paging. Use this to browse. Use courier_audience_get when you already have the ID.

    Inputs

    cursorstring
    A unique identifier that allows for fetching the next set of audiences. Example: eyJpZCI6IjEyMyJ9
  • courier_automation_run_steps_listList the per-step state of one Automation run, in full — this endpoint is not paginated.Read-only

    List steps for an Automation run

    List the per-step state of one Automation run, in full — this endpoint is not paginated. Returns an object with steps. Needs id from courier_automation_runs_list.

    Inputs

    idstringrequired
    A unique identifier representing the Automation run. Example: user-123
  • courier_automation_runs_listList runs of the workspace's v2 Automations, newest first, filtered by status, Template, or date range and paged by cursor.Read-only

    List Automation runs

    List runs of the workspace's v2 Automations, newest first, filtered by status, Template, or date range and paged by cursor. Returns an object with runs, next_cursor.

    Inputs

    cursorstring
    A cursor token for pagination. Use the `next_cursor` from the previous response to fetch the next page of results. Treat it as opaque. Example: eyJpZCI6IjEyMyJ9
    end_datestring
    An inclusive upper bound on `created_at`, in the same format as `start_date`. Example: 2026-01-31T23:59:59Z
    limitstring
    The number of runs to return per page, between `1` and `50`. Defaults to `20`. Values outside the range are clamped, and a non-numeric value falls back to `20`. Example: 20
    start_datestring
    An inclusive lower bound on `created_at`, as an ISO 8601 date or timestamp (e.g. `2026-08-18` or `2026-08-18T20:06:36.259Z`). Any other format returns `400`. Example: 2026-01-01T00:00:00Z
    statusstring
    A comma-separated list of run statuses to filter on, e.g. `PROCESSED,ERROR`. Example: active
    template_idstring
    A comma-separated list of Automation Template ids to filter on. Example: user-123
  • courier_automations_listList the workspace's saved automation templates, each with its id and a cursor for paging to the next page of results.Read-only

    List Automations

    List the workspace's saved automation templates, each with its id and a cursor for paging to the next page of results. Returns templates, an array of items with name, id, version, createdAt, updatedAt, plus cursor.

    Inputs

    cursorstring
    A cursor token for pagination. Use the cursor from the previous response to fetch the next page of results. Example: eyJpZCI6IjEyMyJ9
    versionstring
    The version of templates to retrieve. Accepted values are published (for published templates) or draft (for draft templates). Defaults to published. Example: publishedone of publisheddraft
  • courier_brand_getReturn one brand by id, including its colors, logo and styling settings, Handlebars snippets, and published version.Read-only

    Get a Brand

    Return one brand by id, including its colors, logo and styling settings, Handlebars snippets, and published version. Returns an object with id, name, published, created, updated, settings, snippets, version. Use this when you have the ID. Use courier_brands_list to find one. Needs brand_id from courier_brands_list.

    Inputs

    brand_idstringrequired
    A unique identifier associated with the brand you wish to retrieve. Example: user-123
  • courier_brands_listList the workspace's brands.Read-only

    List Brands

    List the workspace's brands. Every entry carries its name, styling settings, snippets, and published version. Returns results, an array of items with id, name, published, created, updated, settings, snippets, version, plus paging. Use this to browse. Use courier_brand_get when you already have the ID.

    Inputs

    cursorstring
    A unique identifier that allows for fetching the next set of brands. Example: eyJpZCI6IjEyMyJ9