API and clients

JOpt.TourOptimizer has one REST API in both modes. Every server describes its API in an OpenAPI schema, and clients in any language can be generated from that schema. This page lists the endpoint groups, the headers, the JSON model of an optimization and the example clients.

TourOptimizer publishes an OpenAPI schema for each release; every server also serves its own. Example clients in Java, C#, Python and Angular are generated from it, and any OpenAPI generator can make a client in another language. JOpt.Solve and the MCP connector call the same REST API. The request carries the optimization in the JSON form of the JOpt core, and the result is the complete optimization snapshot. In Java, the JOpt core writes this JSON and reads a result back.

The diagram opens full size on click.

The OpenAPI schema

  • Every TourOptimizer server serves its OpenAPI schema at /v3/api-docs and the Swagger UI for it, unless the operator switched them off (Settings).
  • The schema of each TourOptimizer release is on the API page, where you can read it and download it.
  • The schema is the contract: an operation, a field or a reason code that is not in the schema of your release is not part of the API.

Endpoint groups

GroupEndpointsModes
JobsPOST /api/v1/jobs to submit, then GET /api/v1/jobs/{jobId}/state, /result, /solution, /status, /progress, /warnings, /errors; POST /api/v1/jobs/{jobId}/stop and /cancel; DELETE /api/v1/jobs/{jobId}Both
Intermediate resultsPOST and GET /api/v1/jobs/{jobId}/request-result: the best result so far, while the job keeps runningBoth
SearchPOST /api/v1/jobs/state/search, /api/v1/jobs/status/search and /api/v1/jobs/searchBoth
Job exportGET /api/v1/jobs/{jobId}/export: the stored result as a ZIP archiveBoth
Synchronous runs and live streamsPOST /api/v1/runs, then GET /api/v1/runs/{runId}/result or /solution, the server-sent event streams under /api/v1/runs/{runId}/stream/, and DELETE /api/v1/runs/{runId}Trusted mode
Job importPOST /api/v1/jobs/import: stores a result that was computed elsewhere, without a runTrusted mode
Geo dataPOST /api/v1/jobs/withGeoProvider: a job whose distances and driving times come from GeoCoderRouterAuth mode, in the JOpt Platform stack
GeocodingPOST /api/geocode/geoCode: a geocoding request, answered by GeoCoderRouterAuth mode, in the JOpt Platform stack
RoutesPOST /api/routing/solution: the turn-by-turn routes of an optimization result, from GeoCoderRouterAuth mode, in the JOpt Platform stack
Account planGET /api/account/plan: the plan of the signed-in accountAuth mode
HealthGET /api/v1/healthBoth

How a job flows through these endpoints is on Jobs.

Headers

HeaderUseModes
X-Tenant-IdThe tenant of the request. All stored data is scoped to it.Trusted mode: your backend sends it. Auth mode: TourOptimizer sets it from the token and overwrites a sent value.
Authorization: Bearer ...The access token of the signed-in user or clientAuth mode
Idempotency-KeyMakes a submit safe to retry: the same key with the same body returns the same jobIdBoth
X-Encryption-SecretReads a result that the client encrypted with its own secretTrusted mode

A refusal answers with an HTTP status and a reason code in the body. The codes are on Checks and limits.

The JSON model of an optimization

A request body is the JSON form of an optimization of the JOpt core. It holds the input (nodes, resources, constraints and properties) and, after a run, the solution. Its extension carries what belongs to the server and not to the optimization itself:

FieldWhat it holds
extension.keySettingThe JOpt license of the request (trusted mode; see Settings)
extension.timeOutThe max run time as an ISO 8601 duration such as PT30M, or UNLIMITED; counted from the start of the run
extension.persistenceSettingHow the job is stored: the keep time (expiry), the completion webhook and, in trusted mode, the encryption secret of the client

TourOptimizer removes the license, the webhook signing secret and the encryption secret before it stores a job, and never returns them in a result.

A Java program can turn an optimization of the JOpt core into this JSON and read the JSON back into the core:

Example clients

The example clients were generated from the OpenAPI schema. Each repository has a README with the setup.

To generate a client in another language, download the schema of your release from the API page and run an OpenAPI generator on it.

Video tutorials

Two videos show the Java REST client:


Added: 2026-11-27 | Last updated: 2026-11-27