DEVELOPERS / API V1

Your software’s addresses.
Ready for your Tesla.

Connect your CRM, delivery software, scheduling tools, or server through the route import API. Your user reviews the imported stops in SelfRoute, then sends each destination to Tesla when ready.

01. Connect

  1. Use SelfRoute build 11 or later and sign in with Apple.
  2. Open Settings → Software & AI connections (CRM & API in earlier builds) → Manage API connections.
  3. Name your integration and create a key. Copy it immediately: the full key appears only once.
  4. Store the key in your server or automation platform’s secret storage. Send it as a Bearer token.
This API imports routes into SelfRoute. It does not send routes to Tesla, control a car, or expose Tesla credentials.

Use the HTTP module in Make, n8n, or Zapier webhooks, or call from your own server. There is no native marketplace connector or OAuth integration in v1.

Imported routes appear under Saved routes. Open that tab, or return to it after the app was in the background, to fetch imports. Your selected route and unsaved edits are preserved.

02. Import one or several routes

POSThttps://pbvnwuxncpubjgxojcnu.supabase.co/functions/v1/route-import/v1/routes

The Supabase HTTPS URL above is the current API address. api.selfroute.app is not configured.

curl --request POST \
  'https://pbvnwuxncpubjgxojcnu.supabase.co/functions/v1/route-import/v1/routes' \
  --header "Authorization: Bearer $SELFROUTE_API_KEY" \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: crm-monday-2026-10-19-v1' \
  --data '{
    "routes": [{
      "name": "Monday visits",
      "stops": [
        {"address": "Your first full street address, city, state, ZIP"},
        {"address": "Your second full street address, city, state, ZIP"}
      ]
    }]
  }'

Successful response · HTTP 201

{
  "routeIds": ["route-uuid"],
  "replayed": false
}

SelfRoute generates route and stop IDs. Stop order and duplicate addresses are preserved. Every stop starts pending. Address text is trimmed and imported as supplied; import does not geocode an address or verify that it exists.

Safe retries with idempotency

Choose a unique Idempotency-Key for each intended import. It must contain 8–128 characters: letters, numbers, hyphens, underscores, periods, or colons. On network retries, keep both the key and body unchanged.

Concurrent retries create one batch. A replay returns HTTP 200, the original IDs, and replayed: true. Reusing the key with different content returns HTTP 409. A replay returns the original IDs even if the route was later edited in the app. Batch writes are atomic.

03. Read an imported route

GEThttps://pbvnwuxncpubjgxojcnu.supabase.co/functions/v1/route-import/v1/routes/{routeId}

Use the same Bearer key that imported the route. A key can read only its own imported routes. Manually created routes, other users’ routes, and routes imported with a different key return 404.

curl \
  'https://pbvnwuxncpubjgxojcnu.supabase.co/functions/v1/route-import/v1/routes/ROUTE_UUID' \
  --header "Authorization: Bearer $SELFROUTE_API_KEY"

Response contains route: {id, name, version, stops}. Stop fields include id, address, locationId, and status.

StatusMeaning
pendingDestination has not been marked accepted or completed.
acceptedTesla accepted the command. This is not proof of arrival or installation on the vehicle screen.
unknownDelivery uncertain. User should check the vehicle.
completedUser explicitly marked arrival. Not automatic arrival tracking.

Poll responsibly within the account request quota. V1 does not offer outgoing webhooks or CRM route editing/deletion.

04. Limits & quotas

ResourceLimit
Routes per request1–10
Stops per route1–500
Total stops per request500 across all routes
Route name1–80 characters
Address3–500 characters
Request body1.2 MB
API requests60 per minute, account-wide
Imported routes100 per UTC day, account-wide
Active API keys5 per account
Key lifetime90 days

Retries count toward request quotas but do not count again as imported routes. Unknown fields are rejected, including caller-supplied user IDs, vehicle IDs, and progress/status fields.

500 stops applies to manual route planning. Driving-time optimization supports 3–20 stops. No silent truncation. Tesla receives one destination per explicit user action, not a 500-stop navigation request.

05. Errors & retry handling

HTTPMeaning / action
400Invalid body, fields, counts, or Idempotency-Key. Correct the request.
401Missing, invalid, expired, or revoked key. Check the credential.
404Unknown endpoint or route outside this exact key’s scope.
405Unsupported HTTP method.
409Idempotency-Key reused with different content. Preserve original payload on retries.
413Request exceeds 1.2 MB. Reduce request size.
429Request or import quota reached. See timing below.
503Temporary service failure. Retry with backoff, same body, and same Idempotency-Key.

HTTP 429 includes Retry-After: 60. If the error indicates the daily import quota, wait until the next UTC day. Do not retry every minute against an exhausted daily quota.

06. Keep keys private

  • Call from trusted servers or automation tools. Never put API keys in browser JavaScript, source control, URLs, or logs.
  • Create a replacement before the 90-day expiry. Update your integration, then revoke the previous key in SelfRoute.
  • A replacement key cannot read routes imported by an older key. Plan progress polling around key rotation.
  • Revocation blocks subsequent API access but keeps saved routes in the app. Account deletion removes keys and import records.
  • SelfRoute stores API secrets as SHA-256 hashes. Public database clients cannot access key tables or internal integration functions.
  • CRM keys are not accepted by Tesla, Watch, account, or billing endpoints. Responses containing data are not cacheable.

See our Privacy Policy and Terms of Use for data handling and permitted use.

Import routes from AI clients with MCP

The SelfRoute MCP developer package wraps this API with route-import and scoped progress tools. Local stdio clients can run the package; hosted ChatGPT and remote Claude connections remain pending.

MCP tools and setup ↗