Skip to content
Sarathi ಸಾರಥಿ
Home How to use About API OpenAPI JSON
Home / API guide
API reference

Sarathi API guide

The public contract for authentication, journey planning and transit data. The exact machine-readable schema is available as OpenAPI JSON.

API version 1.0 · Updated 1 September 2026
In this guideAccess modelAuthenticationEndpoint groupsRate limitsErrorsSchema

1. Access model

Production mobile API requests carry two independent proofs: an official-app proof and a user Bearer token. Public health, rollout status and OpenAPI schema routes do not require a user account. Rollout modes can temporarily monitor rather than reject missing user tokens.

ProofHeaderWhat it establishes
Application trust tokenX-Sarathi-App-Token plus request-signature headersRegistered official app installation and body-bound request
User access JWTAuthorization: Bearer …Authenticated user session bound to the installation
Do not embed shared API keys or certificates in another client. Access for an approved partner or public-data consumer needs a separately scoped server-to-server credential and quota policy.

2. WhatsApp OTP and session routes

Method and pathPurpose
POST /api/v1/auth/otp/requestSend a short-lived WhatsApp OTP challenge.
POST /api/v1/auth/otp/verifyVerify code, accept current terms and create a persistent rotating session.
POST /api/v1/auth/tokenRotate a refresh token and issue a new short access JWT.
GET /api/v1/auth/meReturn the minimal authenticated account summary.
POST /api/v1/auth/logoutRevoke the current session.
DELETE /api/v1/auth/accountDelete the account and authentication sessions.

Refresh tokens belong only in protected device storage. Never place them in a URL, analytics event, application log or support message.

3. Main endpoint groups

GroupExamples
Journey planningPOST /api/v1/journeys/plan, POST /api/plan
Stops and accessGET /api/v1/stops/access, GET /api/stops/nearby
Bus and Metro directoryGET /api/routes, GET /api/metro/lines, GET /api/metro/stations
PlacesGET /api/places/autocomplete, GET /api/places/details
Data and healthGET /api/v1/datasets/current, GET /api/v1/live, GET /api/v1/ready
App trustPOST /api/v1/trust/challenge, POST /api/v1/trust/register, POST /api/v1/trust/token

4. Rate limits

The generic API limit is intentionally broad. Journey planning, place lookup, feedback and authentication have narrower buckets. OTP has additional per-phone, per-IP, resend, daily and verification-attempt limits. A 429 response includes Retry-After; callers should wait and use exponential backoff rather than retrying in a loop.

5. Errors and request references

Most validation and security failures use a JSON detail object with a stable code and user-safe message. Authentication errors return WWW-Authenticate: Bearer. Trust and auth responses use dedicated diagnostic headers. Include the API request ID, not a token or OTP, when reporting an error.

6. Complete schema

Use the generated OpenAPI JSON schema for current models, parameters and responses. The root Compose proxy serves the schema from the same origin as this page.

Production integrations require explicit owner approval, a quota decision and a security review. The mobile app credential model is not a general third-party API key mechanism.

Sarathi · ಸಾರಥಿ

An independent companion for Bengaluru bus, Metro and walking journeys. Not affiliated with BMTC or BMRCL.

Sarathi — a product of AUMLayer Cloud Labs LLP

Website
aumlayer.com
Email
[email protected]
Phone
+91 81510 39365

Product

Journey Data labels FAQ

Help

How to use Support About Data sources API guide

Legal

Privacy Policy Terms and Conditions Data sources Launch status
© AUMLayer Cloud Labs LLP. All rights reserved. No advertising cookies on this site · Not affiliated with BMTC or BMRCL