Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Knock

Scalekit connector
Open markdown

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

Tools
54
What they doRead · write · destructive
26 · 19 · 926 read19 write9 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 Knock connection

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

    Each user opens the link once and enters their Knock 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
  • knock_audience_members_listReturn a paginated list of members for the specified audience.Read-only

    List Audience Members

    Return a paginated list of members for the specified audience. Returns entries, an array of items with __typename, added_at, tenant, user, user_id, plus page_info.

    Inputs

    keystringrequired
    The key of the audience. Example: new-comment
  • knock_bulk_operation_getRetrieve a bulk operation (if it exists) and displays the current state of it.Read-only

    Get bulk operation

    Retrieve a bulk operation (if it exists) and displays the current state of it. Returns an object with __typename, completed_at, error_count, error_items, estimated_total_rows, failed_at, id, inserted_at, name, processed_rows, progress_path, started_at and more.

    Inputs

    idstringrequired
    The ID of the bulk operation to retrieve. Example: 3b6b2e4c-1d2a-4f5e-8a9b-0c1d2e3f4a5b
  • knock_message_activities_listReturn a paginated list of activities for the specified message.Read-only

    List Message Activities

    Return a paginated list of activities for the specified message. Returns items, an array of items with __typename, actor, data, id, inserted_at, recipient, updated_at, plus page_info. Needs message_id from knock_messages_list.

    Inputs

    message_idstringrequired
    The ID of the message to fetch activities for. Example: 1jNaXzB2RZX3LY8wVQnfCKyPnv7
    afterstring
    The cursor to fetch entries after. Example: eyJpZCI6IjEyMyJ9
    beforestring
    The cursor to fetch entries before. Example: eyJpZCI6IjEyMyJ9
    page_sizeinteger
    The number of items per page (defaults to 50). Example: 10
    trigger_datastring
    The trigger data to filter activities by. Example: {"order_id": "A-1001"}
  • knock_message_content_getReturn the fully rendered contents of a message, where the response depends on which channel the message was sent through.Read-only

    Get message content

    Return the fully rendered contents of a message, where the response depends on which channel the message was sent through. Returns an object with __typename, data, inserted_at, message_id. Needs message_id from knock_messages_list.

    Inputs

    message_idstringrequired
    The ID of the message to fetch contents of. Example: 1jNaXzB2RZX3LY8wVQnfCKyPnv7
  • knock_message_delivery_logs_listReturn a paginated list of delivery logs for the specified message.Read-only

    List Message Delivery Logs

    Return a paginated list of delivery logs for the specified message. Returns items, an array of items with __typename, environment_id, id, inserted_at, request, response, service_name, plus page_info. Needs message_id from knock_messages_list.

    Inputs

    message_idstringrequired
    The ID of the message to fetch delivery logs for. Example: 1jNaXzB2RZX3LY8wVQnfCKyPnv7
    afterstring
    The cursor to fetch entries after. Example: eyJpZCI6IjEyMyJ9
    beforestring
    The cursor to fetch entries before. Example: eyJpZCI6IjEyMyJ9
    page_sizeinteger
    The number of items per page (defaults to 50). Example: 10
  • knock_message_events_listReturn a paginated list of events for the specified message.Read-only

    List Message Events

    Return a paginated list of events for the specified message. Returns items, an array of items with __typename, data, id, inserted_at, recipient, type, plus page_info. Needs message_id from knock_messages_list.

    Inputs

    message_idstringrequired
    The ID of the message to fetch events for. Example: 1jNaXzB2RZX3LY8wVQnfCKyPnv7
    afterstring
    The cursor to fetch entries after. Example: eyJpZCI6IjEyMyJ9
    beforestring
    The cursor to fetch entries before. Example: eyJpZCI6IjEyMyJ9
    page_sizeinteger
    The number of items per page (defaults to 50). Example: 10
  • knock_message_getRetrieve a specific message by its ID.Read-only

    Get message

    Retrieve a specific message by its ID. Returns an object with __typename, actors, archived_at, channel, channel_id, clicked_at, data, engagement_statuses, id, inserted_at, interacted_at, link_clicked_at and more. Use this when you have the ID. Use knock_messages_list to find one. Needs message_id from knock_messages_list.

    Inputs

    message_idstringrequired
    The unique identifier for the message. Example: 1jNaXzB2RZX3LY8wVQnfCKyPnv7
  • knock_messages_listReturn a paginated list of messages for the current environment.Read-only

    List messages

    Return a paginated list of messages for the current environment. Returns items, an array of items with __typename, actors, archived_at, channel, channel_id, clicked_at, data, engagement_statuses, id, inserted_at, plus page_info. Use this to browse. Use knock_message_get when you already have the ID.

    Inputs

    afterstring
    The cursor to fetch entries after. Example: eyJpZCI6IjEyMyJ9
    beforestring
    The cursor to fetch entries before. Example: eyJpZCI6IjEyMyJ9
    channel_idstring
    Limits the results to items with the corresponding channel ID. Example: 4c2f0a3e-8b1d-4e5f-9a6b-7c8d9e0f1a2b
    engagement_statusarray
    Limits the results to messages with the given engagement status. Example: ["unread"]
    inserted_at_gtstring
    Limits the results to items inserted after the given date. Example: 2025-01-01T00:00:00Z
    inserted_at_gtestring
    Limits the results to items inserted after or on the given date. Example: 2025-01-01T00:00:00Z
    inserted_at_ltstring
    Limits the results to items inserted before the given date. Example: 2025-01-01T00:00:00Z
    inserted_at_ltestring
    Limits the results to items inserted before or on the given date. Example: 2025-01-01T00:00:00Z
    message_idsarray
    Limits the results to only the message IDs given (max 50). Note: when using this option, the results will be subject to any other filters applied to the query. Example: ["1jNaXzB2RZX3LY8wVQnfCKyPnv7"]
    page_sizeinteger
    The number of items per page (defaults to 50). Example: 10
    sourcestring
    Limits the results to messages triggered by the given workflow key. Example: comment-created
    statusarray
    Limits the results to messages with the given delivery status. Example: ["delivered"]
    tenantstring
    Limits the results to items with the corresponding tenant. Example: acme-corp
    trigger_datastring
    Limits the results to only messages that were generated with the given data. See trigger data filtering for more information. Example: {"order_id": "A-1001"}
    workflow_categoriesarray
    Limits the results to messages related to any of the provided categories. Example: ["workflow_123"]
    workflow_recipient_run_idstring
    Limits the results to messages for a specific recipient's workflow run. Example: 123e4567-e89b-12d3-a456-426614174000
    workflow_run_idstring
    Limits the results to messages associated with the top-level workflow run ID returned by the workflow trigger request. Example: 123e4567-e89b-12d3-a456-426614174000