Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to ServiceNow

Scalekit connector
Open markdown

The ServiceNow connector lets your AI agent act in each user's ServiceNow account. Each user signs in to ServiceNow once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 112 tools.

Tools
112
What they doRead · write · destructive
56 · 46 · 1056 read46 write10 destructive
Users sign in with
OAuth app
Your own ServiceNow app

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 ServiceNow connection

    In AgentKit > Connections, create a ServiceNow connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register an OAuth app

    ServiceNow connections use your own OAuth app. Register one with ServiceNow and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the ServiceNow connection.

    Console steps with screenshots

    Register your Scalekit environment with ServiceNow so Scalekit handles the OAuth flow and token lifecycle for your users. Create an OAuth application registry in your ServiceNow instance, then add its Client ID and Client Secret to your Scalekit connection.

    1. Copy the redirect URI from Scalekit

      • In the Scalekit dashboard, go to AgentKit > Connections > Create Connection. Find ServiceNow and click Create.

      • Click Use your own credentials and copy the redirect URI. It looks like https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback.

    2. Open Application Registry in ServiceNow

      • Log in to your ServiceNow instance.

      • Use the top navigation search to find Application Registry under System OAuth.

        ServiceNow navigation search showing System OAuth > Application Registry

      • The Application Registries list shows every OAuth client and provider already configured on your instance.

        Application Registries list showing existing OAuth clients and providers

    3. Create a new OAuth application

      • Click New. ServiceNow asks What kind of OAuth application?

        OAuth application type picker with New Inbound Integration Experience highlighted

      • Select New Inbound Integration Experience.

      • Give the application a Name (for example, Agent Auth) and paste the redirect URI you copied in step 1 into the Redirect URL field.

      • Save the record.

    4. Copy your Client ID and Client Secret

      • Open the application record you just created under Application Registries.

      • Copy the Client ID shown on the record.

      • Click the lock icon next to Client Secret to reveal and copy it.

        ServiceNow OAuth application record showing Client ID, Client Secret, and Redirect URL fields

    5. Add credentials in Scalekit

      • Return to the connection you created in Scalekit and enter:
        • Client ID — from your ServiceNow application registry
        • Client Secret — from your ServiceNow application registry
      • Click Save.
  5. 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 = 'servicenow'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize ServiceNow:', 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: 'servicenow_get_current_user',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • servicenow_aggregate_statsRetrieve aggregate statistics (COUNT, SUM, AVG, MIN, MAX) for any ServiceNow table.Read-only

    Get Aggregate Statistics

    Retrieve aggregate statistics (COUNT, SUM, AVG, MIN, MAX) for any ServiceNow table. Group results by fields for dashboard-style analytics.

    Inputs

    table_namestringrequired
    Name of the ServiceNow table to aggregate (e.g., incident, change_request)
    sysparm_avg_fieldsstring
    Comma-separated list of fields to compute the AVERAGE for
    sysparm_countboolean
    When true, include a COUNT of all matching records in the result
    sysparm_display_valuestring
    Return display values alongside actual values. Use 'true', 'false', or 'all'one of truefalseall
    sysparm_group_bystring
    Comma-separated fields to GROUP BY in the aggregate query
    sysparm_max_fieldsstring
    Comma-separated list of fields to find the MAXIMUM value for
    sysparm_min_fieldsstring
    Comma-separated list of fields to find the MINIMUM value for
    sysparm_order_bystring
    Field name to order grouped aggregate results by
    sysparm_querystring
    Encoded query string to filter records before aggregation (ServiceNow query syntax)
    sysparm_sum_fieldsstring
    Comma-separated list of fields to SUM
  • servicenow_attachment_downloadDownload the binary file contents of an attachment from ServiceNow.Read-only

    Download Attachment

    Download the binary file contents of an attachment from ServiceNow. Returns the raw file data. Use servicenow_attachment_get to first retrieve metadata (filename, content_type).

    Inputs

    sys_idstringrequired
    The sys_id of the attachment record whose binary content to download.
  • servicenow_attachment_getRetrieve metadata for a specific attachment by its sys_id.Read-only

    Get Attachment

    Retrieve metadata for a specific attachment by its sys_id. Returns details such as filename, content type, size, and the associated record.

    Inputs

    sys_idstringrequired
    The sys_id of the attachment to retrieve.
  • servicenow_attachment_listRetrieve a list of attachments associated with a record in ServiceNow.Read-only

    List Attachments

    Retrieve a list of attachments associated with a record in ServiceNow. Filter by table name and record sys_id to find attachments for a specific record.

    Inputs

    file_namestring
    Filter attachments by filename.
    sysparm_limitinteger
    Maximum number of records to return (default: 10).
    sysparm_offsetinteger
    Number of records to skip for pagination.
    table_namestring
    Table name of the parent record (e.g., `incident`, `change_request`).
    table_sys_idstring
    sys_id of the parent record whose attachments to retrieve.
  • servicenow_catalog_cart_getRetrieve the current user's shopping cart contents.Read-only

    Get Service Catalog Cart

    Retrieve the current user's shopping cart contents.

    Inputs

    This tool takes no inputs.

  • servicenow_catalog_categories_listList all Service Catalog categories from ServiceNow.Read-only

    List Catalog Categories

    List all Service Catalog categories from ServiceNow. Returns category names, descriptions, and their parent catalog associations.

    Inputs

    sysparm_fieldsstring
    Comma-separated list of fields to return in the response.
    sysparm_limitinteger
    Maximum number of records to return.
    sysparm_offsetinteger
    Number of records to skip for pagination.
  • servicenow_catalog_category_getRetrieve details of a specific service catalog category, including its catalog items.Read-only

    Get Catalog Category

    Retrieve details of a specific service catalog category, including its catalog items.

    Inputs

    sys_idstringrequired
    The sys_id of the catalog category to retrieve.
  • servicenow_catalog_getRetrieve details of a specific service catalog by its sys_id from the ServiceNow Service Catalog API.Read-only

    Get Service Catalog

    Retrieve details of a specific service catalog by its sys_id from the ServiceNow Service Catalog API.

    Inputs

    sysparm_catalogstringrequired
    The sys_id of the service catalog to retrieve

Workflows

Don’t worry about your ServiceNow instance domain in the path. Scalekit automatically resolves {{domain}} from the connected account’s configuration. For example, a request with path="/api/now/table/sys_user" will be sent to https://mycompany.service-now.com/api/now/table/sys_user automatically.

Proxy API call
const result = await actions.request({
connectionName: 'servicenow',
identifier: 'user_123',
path: '/api/now/table/sys_user',
method: 'GET',
});
console.log(result);
Execute a tool
const result = await actions.executeTool({
connector: 'servicenow',
identifier: 'user_123',
toolName: 'servicenow_user_list',
toolInput: {},
});
console.log(result);