Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Basin

Scalekit connector
Open markdown

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

Tools
20
What they doRead · write · destructive
9 · 7 · 49 read7 write4 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 Basin connection

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

    Each user opens the link once and enters their Basin 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
  • basin_get_formGet one form's settings by its ID.Read-only

    Get Form

    Get one form's settings by its ID. Returns the form record: id, uuid, name, project_id and project_name, timezone, redirect_url, notification and autoreply settings, spam protection flags, retention_days, form_webhooks, and inbox, spam and trash counts. Use basin_list_forms to find the ID. Use basin_list_submissions for the form's submissions.

    Inputs

    form_idstringrequired
    ID of the form to retrieve. Use the numeric id field returned by basin_list_forms. Example: 73320.
  • basin_get_mail_templateGet one email template by its ID.Read-only

    Get Mail Template

    Get one email template by its ID. Returns the mail template's id, name, project_id, body (the latest submitted HTML, or the approved HTML when nothing is pending), created_at, and updated_at. Use basin_list_mail_templates to find the ID.

    Inputs

    mail_template_idintegerrequired
    ID of the mail template to retrieve. Use the id field returned by basin_list_mail_templates. Example: 512.
  • basin_get_projectGet one project by its ID.Read-only

    Get Project

    Get one project by its ID. Returns the project's id, name, created_at, and updated_at. Use basin_list_projects to find the ID.

    Inputs

    project_idstringrequired
    ID of the project to retrieve. Use the id field returned by basin_list_projects. Example: 1024.
  • basin_get_submissionGet one form submission by its ID.Read-only

    Get Submission

    Get one form submission by its ID. Returns the submission: id, email, payload_params (the submitted field values), form_id, form name and uuid, spam, read and trash flags, spam_reason, ip, referrer, user_agent, attachments, webhook_sent_at, and timestamps. Use basin_list_submissions to find the ID or to search across submissions.

    Inputs

    submission_idintegerrequired
    ID of the submission to retrieve. Use the id field returned by basin_list_submissions. Example: 61109858.
  • basin_list_domainsList the custom email sending domains available to the account, one page at a time, optionally filtered by a search term.Read-only

    List Domains

    List the custom email sending domains available to the account, one page at a time, optionally filtered by a search term. Returns a page of domain records with pagination metadata. Use this to find a domain_id for a form's custom sending domain (set through basin_update_form's additional_settings).

    Inputs

    pageinteger
    Page number of domains to return, starting at 1. Omit for the first page. Check the response's pagination metadata to see whether more pages exist. Example: 2.
    querystring
    Search term that filters domains by id or name. Example: example.com.
  • basin_list_formsList the forms the API key can access, one page at a time, optionally filtered by a search term.Read-only

    List Forms

    List the forms the API key can access, one page at a time, optionally filtered by a search term. Returns a page of form records with pagination metadata. Use this to find a form's id. Use basin_get_form for one form's full settings.

    Inputs

    pageinteger
    Page number of forms to return, starting at 1. Omit for the first page. Check the response's pagination metadata to see whether more pages exist. Example: 2.
    querystring
    Search term that filters forms by id, name, uuid, or project_id. Example: Contact.
  • basin_list_mail_templatesList the email templates in a project, one page at a time.Read-only

    List Mail Templates

    List the email templates in a project, one page at a time. Returns mail_templates (id, name, project_id, body, created_at, updated_at) and meta with count, page, and per_page. Use this to find a template id for a form's notification or autoreply email. Use basin_get_mail_template for one template.

    Inputs

    project_idintegerrequired
    ID of the project the mail templates belong to. Use the id field returned by basin_list_projects. Example: 1024.
    pageinteger
    Page number of mail templates to return, starting at 1. Omit for the first page. Check the response's pagination metadata to see whether more pages exist. Example: 2.
    page_sizeinteger
    Number of templates per page, up to 20. Example: 20.
  • basin_list_projectsList the projects (groups of forms) the API key can access, one page at a time, optionally filtered by a search term.Read-only

    List Projects

    List the projects (groups of forms) the API key can access, one page at a time, optionally filtered by a search term. Returns a page of project records with pagination metadata. Use this to find a project's id for basin_create_form or basin_list_mail_templates. Use basin_get_project for one project.

    Inputs

    pageinteger
    Page number of projects to return, starting at 1. Omit for the first page. Check the response's pagination metadata to see whether more pages exist. Example: 2.
    querystring
    Search term that filters projects by id or name. Example: Marketing site.