Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Route4Me

Scalekit connector
Open markdown

The Route4Me connector lets your AI agent act in each user's Route4Me account. Each user connects their own Route4Me API key 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
23 · 21 · 1023 read21 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 Route4Me connection

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

    Each user opens the link once and enters their Route4Me 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
  • route4me_activities_listList activity feed events (stops visited/departed, routes optimized, notes added, members changed, geofence events...), optionally for one route or type.Read-only

    List Activities

    List activity feed events (stops visited/departed, routes optimized, notes added, members changed, geofence events...), optionally for one route or type. Returns results (activities with activity_id, activity_type, activity_message, route_id, member and timestamp) and total. Use this to audit what happened. Use route4me_activity_log to add a message.

    Inputs

    activity_typestring
    Only this type, e.g. mark-destination-visited, mark-destination-departed, route-optimized, note-insert, insert-destination, delete-destination, route-delete, member-created, geofence-entered, user_message. Example: mark-destination-visited.
    limitinteger
    Number of records to return. Example: 20.
    offsetinteger
    Number of records to skip. Example: 0.
    route_idstring
    Only activities for this route. Example: 5C15E83A4BE005BCD1537955D28D51D7.
    teamboolean
    true for team activities on the route. Example: true.
  • route4me_avoidance_zone_getGet one avoidance zone (an area routes must avoid).Read-only

    Get Avoidance Zone

    Get one avoidance zone (an area routes must avoid). Returns its name, color and shape. Use this when you know the ID.

    Inputs

    territory_idstringrequired
    Avoidance zone ID. Example: 596A2A44FE9FB19EEB9C3C072BF2D0BE.
  • route4me_avoidance_zones_listList avoidance zone areas.Read-only

    List Avoidance Zones

    List avoidance zone areas. Returns items with territory_id, territory_name, territory_color and territory shape. Use this to find IDs. Use route4me_avoidance_zone_get for one.

    Inputs

    This tool takes no inputs.

  • route4me_geocodeGeocode one or more addresses (separated by new lines) or reverse-geocode a lat,lng pair.Read-only

    Geocode Addresses

    Geocode one or more addresses (separated by new lines) or reverse-geocode a lat,lng pair. Returns geocoding results with address, lat, lng and type. Use this to get coordinates before creating orders or optimizations.

    Inputs

    addressesstringrequired
    Address(es) or a latitude,longitude pair. Example: Los Angeles International Airport, CA.
    formatstring
    Response format. Example: json.one of jsonxml
  • route4me_location_group_getGet one address book group.Read-only

    Get Location Group

    Get one address book group. Returns the group's name, color and filter. Use this when you know the ID.

    Inputs

    group_idstringrequired
    Group ID. Example: 4F39929B6A8A9D3E9A6B2B9F6B5C2E11.
  • route4me_location_groups_listList address book groups (saved filters of locations).Read-only

    List Location Groups

    List address book groups (saved filters of locations). Returns groups with group_id, group_name, group_color and filter. Use this to find a group_id.

    Inputs

    limitinteger
    Number of records to return. Example: 20.
    offsetinteger
    Number of records to skip. Example: 0.
  • route4me_locations_getGet address book locations by ID.Read-only

    Get Locations by ID

    Get address book locations by ID. Returns the locations. Use this when you know the IDs.

    Inputs

    address_idstringrequired
    Location ID, or several separated by commas. Example: 37023651.
  • route4me_locations_listList or search address book locations.Read-only

    List Locations

    List or search address book locations. Returns results (locations with address_id, address_1, coordinates, alias, contact) and total. Use this to browse or search. Use route4me_locations_get for specific IDs.

    Inputs

    displaystring
    routed for locations already in routes, unrouted for the rest, all (default). Example: all.one of allroutedunrouted
    fieldsstring
    Comma-separated fields to return. Example: address_id,address_1,address_alias.
    limitinteger
    Number of records to return. Example: 20.
    offsetinteger
    Number of records to skip. Example: 0.
    querystring
    Search text. Example: Milford.