API Authentication (TrackServiceKey)

TrackRoad APIs use an API key called TrackServiceKey. For REST, send it as X-API-Key. For SOAP, send it in SessionIDHeader as SessionID.

TrackRoad API authentication flow showing TrackServiceKey used as X-API-Key for REST and SessionIDHeader for SOAP
Authentication overview: TrackServiceKey is your API key — send it as X-API-Key for REST and as SessionIDHeader/SessionID for SOAP.

Need endpoints and models?

Swagger provides the full request and response schemas for Dispatch, Routes, Route, Geocode, Credit, and Distance.

View Swagger UI API Reference Overview

Table of contents

  1. How authentication works
  2. Generate your TrackServiceKey
  3. REST authentication (X-API-Key)
  4. SOAP authentication (SessionIDHeader)
  5. Login / Logout (legacy)
  6. Security best practices
  7. Common errors (401/403)
  8. Related endpoints
  9. FAQ

How authentication works#

TrackRoad uses a single authentication concept across its API surface: your account-level TrackServiceKey.

  • TrackServiceKey is generated in your TrackRoad account.
  • REST: send it in X-API-Key on every request.
  • SOAP: send it in SessionIDHeader as SessionID on every call.

Recommended for new integrations: use REST wherever possible and keep SOAP only for legacy systems.

Generate your TrackServiceKey#

Before calling the TrackRoad API, create or copy your authentication key from your account.

  1. Sign in to your TrackRoad account.
  2. Open Manage Users (or API settings, if available).
  3. Generate or copy your TrackServiceKey.
  4. Store it securely on the server side only.

If you cannot find your TrackServiceKey, contact TrackRoad Support to enable or confirm API access.

REST authentication (X-API-Key)#

Send your TrackServiceKey in the X-API-Key header on every REST request to TrackRoad.

curl -X POST "https://trackservice.trackroad.com/rest/credit" \
  -H "X-API-Key: YOUR_TRACKSERVICEKEY"

Keep API keys on the server side. Do not embed TrackServiceKey in browser JavaScript, mobile apps, or public client-side code.

SOAP authentication (SessionIDHeader)#

SOAP calls authenticate using SessionIDHeader. For TrackRoad SOAP services, send your TrackServiceKey as the SessionID value on every request.

Login and Logout may still appear in older SOAP documentation, but they are not required for modern integrations that already use TrackServiceKey.

<soap:Header>
  <SessionIDHeader xmlns="http://TrackService.TrackRoad.com/">
    <SessionID>YOUR_TRACKSERVICEKEY</SessionID>
  </SessionIDHeader>
</soap:Header>

Login / Logout endpoints (legacy)#

Login and Logout are maintained for backward compatibility only. New TrackRoad integrations should authenticate with TrackServiceKey: REST via X-API-Key and SOAP via SessionIDHeader.

Security best practices#

Protecting your API key is essential for reliable and secure production integrations.

  • Never expose API keys in front-end JavaScript.
  • Use secure server-to-server or backend integrations.
  • Store keys in environment variables, secret managers, or secured configuration stores.
  • Rotate the key immediately if you suspect compromise.
  • Never log or email API keys in plaintext.

Common errors (401/403)#

If authentication fails, verify the header name, key value, environment, and account status.

  • 401 Unauthorized: missing or invalid key. For REST, check X-API-Key. For SOAP, check SessionIDHeader and SessionID.
  • 403 Forbidden: the key may be valid, but access is blocked, expired, or limited by credit or permissions.

FAQ#

How do I authenticate TrackRoad REST API calls?
Send your TrackServiceKey in the X-API-Key header on every REST request.
How do I authenticate TrackRoad SOAP calls?
For SOAP, send your TrackServiceKey in SessionIDHeader as SessionID on each SOAP request.
Do I need Login/Logout?
No. Login and Logout endpoints are legacy. New integrations should use TrackServiceKey authentication.
Why do I get 401 Unauthorized?
Common causes include a missing X-API-Key header, an invalid key, extra whitespace, or using the wrong environment or host.

Next step: try an endpoint

Once you have your TrackServiceKey, start with Credit to validate authentication, then continue with Geocode, Route, Routes, or Dispatch.

Check Credit Go to Dispatch