post
/api/v2/origin-destination/closed-matrix
Python SDK method:
client.origin_destination.closed_matrix(params).run()

Start closed OD matrix job

Creates a job to generate a closed origin-destination analysis. Generates a list of origin/destination zone pairs with journey metrics (count, distance, duration, percentiles, vehicle-class/vocation/fuel-type breakdowns). Set generateTimeSeries to true to produce time-series breakdowns retrievable from the companion time-series result endpoint.

Altitude Help Center — Closed OD API

Request Body

Analysis parameters.

application/json: object

NameTypeInput ShapeValuesDescriptionValue Required
aggregationUnitsarray<string>-hour, dayofweek, daytype, daytypehourTime-series dimensions to generate when generateTimeSeries is true. Valid values: hour, dayofweek, daytype, daytypehour. An empty array generates all four.N
componentTimeRangeobjectcomponent: string; timeFrom: string; timeTo: string-Time-of-day window and journey endpoint constraint applied to the analysis.Y
connectorAndConditionboolean--When true, journeys must pass through all connectors; when false (default), passing through at least one is sufficient.N
connectorIdsarray<string>--Encoded zone IDs that journeys must pass through. Provide either connectorIds or connectors, not both.N
connectorsarray<object>code: string; iso_3166_2: string; type: string-Zone objects that journeys must pass through (subject to connectorAndCondition). Provide either connectors or connectorIds, not both.N
customAggregationValuesarray<object>aggregationValue: string; hourEnd: integer (int64); hourStart: integer (int64)-Custom hourly range buckets appended to the time-series output in addition to any aggregationUnits selections.N
dateRangesarray<DateRangeDto>dateFrom: string; dateTo: string-Date ranges to include in the analysis. Maximum 4 non-overlapping ranges, each up to 365 days. Results are aggregated across all ranges unless isTrendAnalysis is true.Y
daysOfWeekarray<DayOfWeek>-1, 2, 3, 4, 5, 6, 7Days of the week to include (1=Sunday … 7=Saturday). An empty array includes all days.N
destinationIdsarray<string>--Encoded destination zone IDs. Provide either destinationIds or destinations, not both.N
destinationsarray<object>code: string; iso_3166_2: string; type: string-Destination zone objects for the analysis. Provide either destinations or destinationIds, not both.N
generateTimeSeriesboolean--When true, a time-series breakdown child analysis is generated. Results are retrievable via GET /api/v2/origin-destination/closed-matrix/{id}/time-series once the job is complete.Y
industriesarray<IndustryGroup>-agriculture, mining, utilities, construction, manufacturing, wholesale, retail, transportation_and_warehousing, information_and_cultural, finance_and_insurance, real_estate, science_and_technology, management, administrative_and_support, education, health_care, arts_and_entertainment, accommodation_and_food, public_administration, other_services, unclassifiedNamed industry IDs from GET /api/v2/filters/industries (e.g. 'manufacturing', 'retail'). Resolved to NAICS codes at query time and combined with any naics values. Leave both industries and naics empty to include all industries.N
isMetricboolean--When true, distance values are returned in kilometres; when false, in miles. If omitted, defaults to the isMetric setting on the authenticated user's profile.N
isTrendAnalysisboolean--When true, results are returned per date range instead of aggregated across all ranges. Applies to both the primary output and the time-series output.N
naicsarray<integer (int64)>--Explicit raw NAICS integer codes to filter by. Combined with any industries values. Leave both naics and industries empty to include all industries.N
originIdsarray<string>--Encoded origin zone IDs. Provide either originIds or origins, not both.N
originsarray<object>code: string; iso_3166_2: string; type: string-Origin zone objects for the analysis. Provide either origins or originIds, not both.N
percentilesarray<integer (int64)>--Percentile values (1–99) to calculate for journey distance, duration, and dwell time. Defaults to [15, 85] when omitted.N
tripChainCriteriaobjectmaxStopDuration: integer (int64); shortJourneyDistanceThreshold: number (double)-Trip-chaining criteria. Omit or send zero values to run without trip chaining.N
vehicleClassIdsarray<string>--Vehicle class filter IDs from GET /api/v2/filters/vehicle-classes. IDs must use the scheme_vehicleClassIndex_categoryIndex format and share one scheme. An empty array includes all vehicle classes.N
vehicleClassSchemeIdinteger--Vehicle classification scheme, from 1 through 5. Defaults to 2 (FHWA/GVWR) when omitted.N
vehicleClassesarray<object>vehicleType: string; weightClass: string-Vehicle class filters. Use an empty array to include all vehicle classes.N
vocationsarray<VocationID>-1, 2, 3, 4, 5Vocation IDs from GET /api/v2/filters/vocations. An empty array includes all vocations.N

Examples

County-to-county closed OD request

Converted from the v1 closed OD example using v2 zone fields.

{
  "componentTimeRange": {
    "component": "Both",
    "timeFrom": "00:00:00",
    "timeTo": "23:59:59.999"
  },
  "dateRanges": [
    {
      "dateFrom": "2026-01-01",
      "dateTo": "2026-01-31"
    }
  ],
  "destinations": [
    {
      "code": "32023",
      "iso_3166_2": "US-NV",
      "type": "County"
    }
  ],
  "generateTimeSeries": false,
  "isMetric": false,
  "origins": [
    {
      "code": "32003",
      "iso_3166_2": "US-NV",
      "type": "County"
    }
  ],
  "percentiles": [
    15,
    85
  ]
}

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.