post
/api/v2/origin-destination/routes
Python SDK method:
client.origin_destination.route(params).run()

Start OD route analysis job

Creates a job to generate an OD route analysis using zone-pair identifiers from a completed OD matrix job. You must first run and complete an O/D matrix (Closed, Segment Flow, or Open-Ended) before calling this endpoint. An empty zonePairIds list includes all pairs for Closed and Segment Flow parent matrices; if the parent matrix is an Open-Ended matrix, at least one and no more than 5 zonePairIds are required. The jobId you pass must be the jobId of the parent matrix.

Altitude Help Center — getRouteAnalysis

Request Body

Analysis parameters.

application/json: object

NameTypeInput ShapeValuesDescriptionValue Required
excludeServiceRoadsboolean--When true, service road categories are excluded from computed routes.Y
isMetricboolean--When true, distance values are returned in kilometres; when false, in miles.Y
jobIdstring--Job ID of the OD Matrix (Closed, Segment or Open Ended) on which to run the Route Analysis.Y
routeGroupingThresholdnumber (double)--Fraction (0–1) of trips a road segment must carry to be included in a grouped route. Higher values produce fewer, more common routes.Y
zonePairIdsarray<string>--Identifiers of the OD matrix rows to include in the route analysis: zonePairId values from closed matrix results, or flowId values from open-ended and corridor matrix results. An empty or omitted array includes all pairs for Closed and Segment Flow parent matrices; if the parent matrix is an Open-Ended matrix, at least one and no more than 5 zonePairIds are required.N

Examples

OD route analysis request

Converted from the v1 route analysis example. Use zonePairIds from a completed OD matrix result.

{
  "excludeServiceRoads": true,
  "isMetric": false,
  "jobId": "its_1784148529857_j2z6k08bocf",
  "routeGroupingThreshold": 0.9,
  "zonePairIds": [
    "zone-pair-id-from-matrix"
  ]
}

Success Responses

202 response: object

Job accepted and queued for processing. Poll the location header URL to check status.

NameTypeDescription
errorobjectDetails about why the job failed (RFC 7807 format), or null if it succeeded.
idstringUnique job identifier.
linksobjectNavigation URLs for polling and result retrieval.
statusstringCurrent job lifecycle state: PENDING, QUEUED, RUNNING, DONE, FAILED, CANCELED, or NOT_FOUND.

Response Errors

HTTP Status CodeReason
400The request body or parameters are invalid.
401Authentication is required or the provided credentials are invalid.
403The authenticated user lacks permission to perform this operation.
409The operation conflicts with the current state of the resource.
422The request is syntactically valid but semantically cannot be processed.
429The request rate limit has been exceeded.
500An unexpected server error occurred.