Analysis Creation
Purpose
Create a Flow Matrix Analysis by sending a POST request.
Request data
HTTPS Method: POST
For ease of viewing and identification:
- Parameters enclosed in curly brackets { } must be replaced with their values.
- Please see the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
Format
https://api.tomtom.com/origindestination/1/analysis/flowmatrix?key={Your_API_Key}Example
https://api.tomtom.com/origindestination/1/analysis/flowmatrix?key={Your_API_Key}Request parameters
Required parameters | Description |
|---|---|
| Authorization key for access to the API. Value: Your valid API Key. |
Request POST body fields
Required fields | Description |
|---|---|
| Job name string which will be used in the process and output. Given for the user’s convenience. (Limit: 1 to 254 characters.) |
| Version of the analysis to create. Value: The field itself is optional in the API and defaults to |
| List of region definitions.
The maximum number of regions and their maximum total area are part of the limits granted to
your contract. Regions that declare a narrowed |
| Time definition for the analysis. |
| Time zone for the analysis as a
TZ database name. For example |
| List of date ranges to analyze. The earliest and the latest date you may request, and the maximum number of date ranges in a single analysis, are part of the limits granted to your contract. (Limit: a single date range cannot cover more days than the calendar year it starts in, that is 365 or 366 days.) |
| List of time ranges to analyze. The maximum number of time ranges in a single analysis is part of the limits granted to your contract. A trip is counted in a time range if it entered its origin region within that range. |
Optional fields | Description |
|---|---|
| Determines from what devices data will be used.
|
| Days of the week to analyze. Applies to every date range that does not declare its own
|
| Optional parameter indicating which map version should be used for map-matching. If not provided, a map version will be selected automatically based on the selected date ranges. You can check the list of available maps at Available maps. The value of this parameter should align with the selected date range, to avoid confusion. This parameter is used only if the convex hull area of the regions is below 3000 km^2, as map-matching is disabled for larger areas. Learn more in the user guide. |
| Setting this parameter to The analysis computes all results from the remaining trips; normalized values are shares of the remaining total. The filter is applied only when the analysis is map-matched, which requires the same
convex hull area below 3000 km^2 as The filter also widens the area of map data the analysis loads, so the analysis may take longer to complete. This parameter is not returned in the preview response, so a finished analysis cannot be inspected to tell whether the filter was applied to it. |
| Setting this parameter as The option is turned off automatically when the analysis defines more than 600 regions. |
Request POST body example
POST body example - JSON
{ "name": "test analysis", "analysisVersion": 2, "regions": [ { "type": "Feature", "properties": { "name": "Region 1" }, "geometry": { "type": "Polygon", "coordinates": [ [ [19.45307, 51.80322], [19.44902, 51.80309], [19.44501, 51.80272], [19.44108, 51.80211], [19.43726, 51.80127], [19.43359, 51.8002], [19.43012, 51.79891], [19.42686, 51.79741], [19.42386, 51.79573], [19.42114, 51.79387], [19.41872, 51.79185], [19.41664, 51.7897], [19.41491, 51.78744], [19.41355, 51.78507], [19.41256, 51.78264], [19.41197, 51.78016], [19.41177, 51.77766], [19.41198, 51.77515], [19.41257, 51.77267], [19.41356, 51.77024], [19.41493, 51.76788], [19.41666, 51.76561], [19.41875, 51.76346], [19.42116, 51.76145], [19.42388, 51.75959], [19.42688, 51.75791], [19.43014, 51.75642], [19.43361, 51.75513], [19.43728, 51.75406], [19.44109, 51.75321], [19.44502, 51.7526], [19.44903, 51.75224], [19.45307, 51.75211], [19.45712, 51.75224], [19.46112, 51.7526], [19.46505, 51.75321], [19.46887, 51.75406], [19.47253, 51.75513], [19.476, 51.75642], [19.47926, 51.75791], [19.48226, 51.75959], [19.48498, 51.76145], [19.4874, 51.76346], [19.48948, 51.76561], [19.49122, 51.76788], [19.49258, 51.77024], [19.49357, 51.77267], [19.49417, 51.77515], [19.49437, 51.77766], [19.49417, 51.78016], [19.49358, 51.78264], [19.4926, 51.78507], [19.49123, 51.78744], [19.4895, 51.7897], [19.48742, 51.79185], [19.48501, 51.79387], [19.48229, 51.79573], [19.47928, 51.79741], [19.47603, 51.79891], [19.47255, 51.8002], [19.46888, 51.80127], [19.46507, 51.80211], [19.46113, 51.80272], [19.45712, 51.80309], [19.45307, 51.80322] ] ] } }, { "type": "Feature", "properties": { "name": "Region 2" }, "geometry": { "type": "Polygon", "coordinates": [ [ [19.34042, 51.75914], [19.29603, 51.75914], [19.29503, 51.73687], [19.35623, 51.73541], [19.35623, 51.73562], [19.34042, 51.75914] ] ] } }, { "type": "Feature", "properties": { "name": "Region 3" }, "geometry": { "type": "Polygon", "coordinates": [ [ [19.44131, 51.73073], [19.44131, 51.71274], [19.47035, 51.71274], [19.47035, 51.73073], [19.44131, 51.73073] ] ] } }, { "type": "Feature", "properties": { "name": "Region 4" }, "geometry": { "type": "Polygon", "coordinates": [ [ [19.44131, 51.71274], [19.44131, 51.69476], [19.47035, 51.69476], [19.47035, 51.71274], [19.44131, 51.71274] ] ] } }, { "type": "Feature", "properties": { "name": "Region 5" }, "geometry": { "type": "Polygon", "coordinates": [ [ [19.47035, 51.73073], [19.47035, 51.71274], [19.49939, 51.71274], [19.49939, 51.73073], [19.47035, 51.73073] ] ] } }, { "type": "Feature", "properties": { "name": "Region 6" }, "geometry": { "type": "Polygon", "coordinates": [ [ [19.47035, 51.71274], [19.47035, 51.69476], [19.49939, 51.69476], [19.49939, 51.71274], [19.47035, 51.71274] ] ] } } ], "time": { "dateRanges": [ { "startDate": "2026-04-25", "endDate": "2026-05-24", "exclusions": ["2026-04-29"] }, { "startDate": "2026-04-29", "endDate": "2026-05-28" }, { "startDate": "2026-05-27", "endDate": "2026-05-28", "name": "weekend" } ], "daysOfWeek": [ "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY" ], "timeRanges": [ { "startTime": "07:00", "endTime": "10:00" }, { "startTime": "16:00", "endTime": "19:00" } ], "zoneId": "Europe/Warsaw" }, "tripStats": false}All date ranges and all time ranges are multiplied to cover all possible time definitions. The preceding example has 3 date ranges and 2 time ranges, so it results in 6 different periods:
2026-04-25 - 2026-05-24 : 07:00 - 10:002026-04-25 - 2026-05-24 : 16:00 - 19:002026-04-29 - 2026-05-28 : 07:00 - 10:002026-04-29 - 2026-05-28 : 16:00 - 19:002026-05-27 - 2026-05-28 : 07:00 - 10:002026-05-27 - 2026-05-28 : 16:00 - 19:00
Every period is a separate result, addressed by its dateRange and timeRange index.
Required POST headers
Header | Value |
|---|---|
|
Regions definition format
Region should be defined
as GeoJSON Feature Object
or GeoJSON FeatureCollection Object. Each feature
can only contain the following types of geometries: Polygon, MultiPolygon or LineString. Note that in the case of the
FeatureCollection object each feature of that collection will be used as a separate region.
Regions are identified in every result by their index in this list, counted from 0.
The following feature properties are read:
Optional properties | Description |
|---|---|
| Region name, used in the CSV outputs. When it is missing or empty, the region is named
|
| Restricts the roles the region may play in the result. At least one region of the analysis must carry a role. |
| For a |
| For a |
Date range format
Required fields | Description |
|---|---|
| Start date of the date range in |
| End date of the date range in |
Optional fields | Description |
|---|---|
| List of dates to exclude from the given range in |
| Days of the week for this date range only. When present, it overrides Default value: the days of the week given as |
| Date range name. Given for the user’s convenience.
Value: A date range name. For example: Default value: none. When the field is omitted, the date range has no name and the field is absent from the response. |
Time range format
Required fields | Description |
|---|---|
| Start time of the time range in |
| End time of the time range in |
NOTE: To analyze a whole day you should use 00:00 for both the startTime and endTime.
NOTE: A time range must be at least 1 hour long.
Response data
This response will return information about the created analysis. The following table describes all of the fields that can appear in a response.
Response structure
Field | Description |
|---|---|
| Analysis number id, returned as a string. |
| Job name, given for the user’s convenience. |
| Analysis type. Always |
| Version of the created analysis. Use it to confirm that the analysis was created as version
|
| Job status. One of the following values:
|
| Current value of the job progress (0-100). |
| Estimated time in seconds to change the analysis status from |
| Job creation time in |
| Date and time start of the analysis in the format:
|
| Date and time end of the analysis in the format:
|
| Time definition of the analysis. |
| Time zone as a
TZ database name. For example |
| Days of the week of the analysis. Allowed values:
|
| List of date ranges of the analysis. |
| List of time ranges of the analysis. |
| Data sources the analysis runs on. |
| Field which indicates if this option was enabled. |
| Whether the service actually map-matched the traces of this analysis. |
| The map used for map-matching. Not returned when the analysis is not map-matched. |
| Map version, as a string in the |
| Name of the map the version belongs to. |
Errors
If there is an error in the supplied parameters or any other internal problem, an error response is generated in the requested format.
Response codes
Code | Meaning & possible causes |
|---|---|
| Created |
| Bad Request |
| Unauthorized |
| Forbidden |
| Not Found |