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

Start OD segment analysis job

Creates a job to generate an OD segment analysis using zone-pair identifiers from a completed OD matrix job. An empty zonePairIds list includes all pairs that have had a route analysis run against them. You must first run and complete an O/D matrix (Closed, Segment Flow, or Open-Ended) and a Route Analysis before calling this endpoint; jobId must be that matrix job's ID.

Altitude Help Center — getODSegmentAnalysis

Request Body

Analysis parameters.

application/json: object

NameTypeInput ShapeValuesDescriptionValue Required
jobIdstring--Job ID of the OD Matrix (Closed, Segment or Open Ended) on which to run the Segment Analysis. A completed Route Analysis for this matrix job is also required before calling this endpoint.Y
zonePairIdsarray<string>--Identifiers of the source rows to include in the segment 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 that have had a route analysis run against them.N

Examples

OD segment analysis request

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

{
  "jobId": "its_1784148529857_j2z6k08bocf",
  "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.