{"type":"api","title":"Export Traffic Insights flow records","meta":{"id":"/apps/pubhub/media/000-v7-apis/4ec57f8c141f43990cef5c737bb51240bb169e79/e205fab2-801c-3c2f-a62d-e9b26dca6df8","info":{"version":"7.0.117","title":"Traffic Insights Flows API","description":"**Note:** All Traffic Insights APIs are not available for ThousandEyes for Government instance.\n\nUse the Traffic Insights Flows API to export Traffic Insights flow records for an account group.\n\nThe export uses server-controlled time-window pagination. When more data remains, use the cursor returned in `_links.next.href` to retrieve the next time window.\n\nExport responses are streamed as `application/hal+json`. If an error occurs after streaming begins, the response status is already committed as `200` and the failure is reported in the body: the response contains the `flows` streamed before the failure and an `error` field. Always treat the presence of `error` as a failed export, regardless of the status code. Errors that occur before streaming begins return `500` with `application/problem+json`.\n\nFor more information about Traffic Insights, see [Traffic Insights](https://docs.thousandeyes.com/product-documentation/traffic-insights).\n"},"security":[{"BearerAuth":[]}],"tags":[{"name":"Traffic Insights Flows","description":"Export Traffic Insights flow records for an account group."}],"openapi":"3.0.1","servers":[{"description":"ThousandEyes API production URL","url":"https://api.thousandeyes.com/v7"}],"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Bearer authentication token"}}},"spec":{"tags":["Traffic Insights Flows"],"summary":"Export Traffic Insights flow records","operationId":"getFlows","description":"Streams Traffic Insights flow records for the requested account group. Each response contains records from one server-selected time window.\n\nFor the initial request, specify `startDate` and optionally `endDate`. The range includes `startDate` and excludes `endDate`, and both values must be ISO 8601 with an offset; `Z` (UTC) is recommended. If `endDate` is omitted, it defaults to the current UTC time truncated to whole seconds. If more data remains, follow `_links.next.href` or pass the opaque `cursor` value from that URL to retrieve the next time window.\n\nEach returned record contains all columns stored for that flow record. The examples below show an abbreviated subset of fields for readability.\n\nDo not specify `cursor` together with `startDate` or `endDate`. The server controls the page size; this operation does not support the `max` parameter.\n","parameters":[{"name":"aid","in":"query","description":"A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.","required":false,"schema":{"type":"string","example":"1234"},"$$ref":"#/components/parameters/AccountGroupId"},{"name":"startDate","in":"query","description":"Start of the time range, in ISO 8601 with an offset; `Z` (UTC) is recommended.\nRequired for the initial request when `cursor` is not specified.\nThe range includes `startDate` and excludes `endDate`. Do not pass with `cursor`.\nSpecify whole seconds. A zero fractional part such as `.000` is accepted; any non-zero\nfractional seconds are rejected with `400`.\n","schema":{"type":"string","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(\\.0+)?([Zz]|[+-]\\d{2}:\\d{2})$","example":"2022-07-17T22:00:54Z"},"$$ref":"#/components/parameters/StartDate"},{"name":"endDate","in":"query","description":"End of the time range, in ISO 8601 with an offset; `Z` (UTC) is recommended.\nOptional for the initial request; defaults to the current UTC time\ntruncated to whole seconds when omitted. The range includes `startDate` and excludes `endDate`.\nDo not pass with `cursor`.\nSpecify whole seconds. A zero fractional part such as `.000` is accepted; any non-zero\nfractional seconds are rejected with `400`.\n","schema":{"type":"string","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(\\.0+)?([Zz]|[+-]\\d{2}:\\d{2})$","example":"2022-07-18T22:00:54Z"},"$$ref":"#/components/parameters/EndDate"},{"name":"cursor","in":"query","description":"Opaque cursor for the next time window. Pass the value from `_links.next.href` on continuation requests.\nDo not pass together with `startDate` or `endDate`.\n","schema":{"type":"string"},"$$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Flow records for the current time window. Successful responses include HAL `_links`.\nIf an error occurs after response streaming begins, the status remains `200` because the response is already committed. The response contains any `flows` streamed before the failure and an `error` field, and `_links` is omitted.\n","content":{"application/hal+json":{"schema":{"oneOf":[{"type":"object","required":["flows","_links"],"description":"Flow records for one server-selected time window. `_links.next.href` contains a fully resolved URL when more data remains. Continuation pages include `_links.self.href`.","properties":{"flows":{"x-paginated-items":true,"type":"array","description":"Flow records for the current time window.","items":{"type":"object","additionalProperties":true,"description":"Traffic Insights flow record. Each record contains every column stored for the flow record. Common fields are documented below; additional deployment- and schema-version-specific fields can also be returned. Documented field names and types are stable.\n","properties":{"ts":{"type":"integer","format":"int64","description":"Flow observation time as Unix epoch seconds.","example":1762097100},"tenantId":{"type":"string","description":"Account group identifier for the authenticated account group. Matches the `aid` query parameter value. Retrieve `aid` from the `/account-groups` endpoint.\n","example":"107878"},"appName":{"type":"string","description":"Application name classification.","example":"youtube"},"clientIp":{"type":"string","description":"Client IP address.","example":"10.0.0.12"},"serverIp":{"type":"string","description":"Server IP address.","example":"142.250.80.46"},"serverPort":{"type":"integer","description":"Server port.","example":443},"clientBytes":{"type":"integer","format":"int64","description":"Bytes sent by the client.","example":1024},"serverBytes":{"type":"integer","format":"int64","description":"Bytes sent by the server.","example":4096},"clientPkts":{"type":"integer","format":"int64","description":"Packets sent by the client.","example":10},"serverPkts":{"type":"integer","format":"int64","description":"Packets sent by the server.","example":12},"ifName":{"type":"string","description":"Interface name on the exporter.","example":"eth0"},"exporterIp":{"type":"string","description":"Exporter IP address.","example":"10.0.0.1"},"agentId":{"type":"string","description":"ThousandEyes agent identifier. Get `agentId` from the `/agents` endpoint.","example":"agent-1"},"siteId":{"type":"string","description":"ThousandEyes site identifier.","example":"site-1"}},"$$ref":"#/components/schemas/FlowRecord"}},"_links":{"type":"object","description":"A links object containing pagination related link(s).","properties":{"previous":{"type":"object","description":"A hyperlink from the containing resource to a URI.","required":["href"],"properties":{"href":{"type":"string","description":"Its value is either a URI [RFC3986] or a URI template [RFC6570].","example":"https://api.thousandeyes.com/v7/link/to/resource/id"},"templated":{"type":"boolean","description":"Should be true when the link object's \"href\" property is a URI template."},"type":{"type":"string","description":"Used as a hint to indicate the media type expected when dereferencing the target resource."},"deprecation":{"type":"string","description":"Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation."},"name":{"type":"string","description":"Its value may be used as a secondary key for selecting link objects that share the same relation type."},"profile":{"type":"string","description":"A URI that hints about the profile of the target resource."},"title":{"type":"string","description":"Intended for labelling the link with a human-readable identifier"},"hreflang":{"type":"string","description":"Indicates the language of the target resource"}},"$$ref":"#/components/schemas/Link"},"next":{"type":"object","description":"A hyperlink from the containing resource to a URI.","required":["href"],"properties":{"href":{"type":"string","description":"Its value is either a URI [RFC3986] or a URI template [RFC6570].","example":"https://api.thousandeyes.com/v7/link/to/resource/id"},"templated":{"type":"boolean","description":"Should be true when the link object's \"href\" property is a URI template."},"type":{"type":"string","description":"Used as a hint to indicate the media type expected when dereferencing the target resource."},"deprecation":{"type":"string","description":"Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation."},"name":{"type":"string","description":"Its value may be used as a secondary key for selecting link objects that share the same relation type."},"profile":{"type":"string","description":"A URI that hints about the profile of the target resource."},"title":{"type":"string","description":"Intended for labelling the link with a human-readable identifier"},"hreflang":{"type":"string","description":"Indicates the language of the target resource"}},"$$ref":"#/components/schemas/Link"},"self":{"type":"object","description":"A hyperlink from the containing resource to a URI.","required":["href"],"properties":{"href":{"type":"string","description":"Its value is either a URI [RFC3986] or a URI template [RFC6570].","example":"https://api.thousandeyes.com/v7/link/to/resource/id"},"templated":{"type":"boolean","description":"Should be true when the link object's \"href\" property is a URI template."},"type":{"type":"string","description":"Used as a hint to indicate the media type expected when dereferencing the target resource."},"deprecation":{"type":"string","description":"Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation."},"name":{"type":"string","description":"Its value may be used as a secondary key for selecting link objects that share the same relation type."},"profile":{"type":"string","description":"A URI that hints about the profile of the target resource."},"title":{"type":"string","description":"Intended for labelling the link with a human-readable identifier"},"hreflang":{"type":"string","description":"Indicates the language of the target resource"}},"$$ref":"#/components/schemas/Link"}},"$$ref":"#/components/schemas/PaginationLinks"}},"$$ref":"#/components/schemas/FlowsSuccess"},{"type":"object","additionalProperties":false,"required":["flows","error"],"description":"Partial export response returned with status `200` when an error occurs after response streaming begins. Contains the flow records streamed before the failure and an `error` field. `_links` is omitted. Treat the presence of `error` as a failed export.\n","properties":{"flows":{"type":"array","description":"Flow records streamed before the failure.","items":{"type":"object","additionalProperties":true,"description":"Traffic Insights flow record. Each record contains every column stored for the flow record. Common fields are documented below; additional deployment- and schema-version-specific fields can also be returned. Documented field names and types are stable.\n","properties":{"ts":{"type":"integer","format":"int64","description":"Flow observation time as Unix epoch seconds.","example":1762097100},"tenantId":{"type":"string","description":"Account group identifier for the authenticated account group. Matches the `aid` query parameter value. Retrieve `aid` from the `/account-groups` endpoint.\n","example":"107878"},"appName":{"type":"string","description":"Application name classification.","example":"youtube"},"clientIp":{"type":"string","description":"Client IP address.","example":"10.0.0.12"},"serverIp":{"type":"string","description":"Server IP address.","example":"142.250.80.46"},"serverPort":{"type":"integer","description":"Server port.","example":443},"clientBytes":{"type":"integer","format":"int64","description":"Bytes sent by the client.","example":1024},"serverBytes":{"type":"integer","format":"int64","description":"Bytes sent by the server.","example":4096},"clientPkts":{"type":"integer","format":"int64","description":"Packets sent by the client.","example":10},"serverPkts":{"type":"integer","format":"int64","description":"Packets sent by the server.","example":12},"ifName":{"type":"string","description":"Interface name on the exporter.","example":"eth0"},"exporterIp":{"type":"string","description":"Exporter IP address.","example":"10.0.0.1"},"agentId":{"type":"string","description":"ThousandEyes agent identifier. Get `agentId` from the `/agents` endpoint.","example":"agent-1"},"siteId":{"type":"string","description":"ThousandEyes site identifier.","example":"site-1"}},"$$ref":"#/components/schemas/FlowRecord"}},"error":{"type":"string","description":"Error message describing why streaming stopped.","example":"Failed while streaming flows"}},"$$ref":"#/components/schemas/FlowsPartialFailure"}]},"examples":{"firstPage":{"summary":"First page with more data available","value":{"flows":[{"ts":1727696230,"tenantId":"107878","appName":"youtube"}],"_links":{"next":{"href":"https://api.thousandeyes.com/v7/traffic-insights/flows?cursor=eyJhbGciOiJIUzI1NiJ9.example"}}}},"continuationPage":{"summary":"Continuation page","value":{"flows":[{"ts":1727696530,"tenantId":"107878","appName":"youtube"}],"_links":{"self":{"href":"https://api.thousandeyes.com/v7/traffic-insights/flows?cursor=eyJhbGciOiJIUzI1NiJ9.example"},"next":{"href":"https://api.thousandeyes.com/v7/traffic-insights/flows?cursor=eyJhbGciOiJIUzI1NiJ9.example-next"}}}},"lastPage":{"summary":"Last page","value":{"flows":[{"ts":1727699830,"tenantId":"107878","appName":"youtube"}],"_links":{"self":{"href":"https://api.thousandeyes.com/v7/traffic-insights/flows?cursor=eyJhbGciOiJIUzI1NiJ9.example-last"}}}}}}}},"400":{"description":"Bad request. Returned for invalid query parameters, when `startDate` is omitted without a `cursor`, when `startDate` is greater than or equal to `endDate`, or when `cursor` is combined with `startDate` or `endDate`.\n","content":{"application/problem+json":{"schema":{"type":"object","allOf":[{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."}},"$$ref":"#/components/schemas/Error"},{"type":"object","properties":{"errors":{"nullable":true,"type":"array","description":"(Optional) When multiple errors occur, the details for each error are listed.","items":{"type":"object","properties":{"code":{"type":"string","description":"(Optional) A unique error type/code that can be referenced in the documentation for further details."},"field":{"type":"string","description":"Identifies the field that triggered this particular error."},"message":{"type":"string","description":"A short, human-readable summary of the error."}},"$$ref":"#/components/schemas/ValidationErrorItem"}}}}],"$$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"invalid_token"},"error_description":{"type":"string","example":"Invalid access token"}},"$$ref":"#/components/schemas/UnauthorizedError"}}},"$$ref":"#/components/responses/401"},"403":{"description":"Insufficient permissions to query endpoint","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."}},"$$ref":"#/components/schemas/Error"}}},"$$ref":"#/components/responses/403"},"429":{"description":"Exhausted rate limit for the organization","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."}},"$$ref":"#/components/schemas/Error"}}},"$$ref":"#/components/responses/429"},"500":{"description":"Internal server error that occurs before response streaming begins.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."}},"$$ref":"#/components/schemas/Error"}}}}},"__originalOperationId":"getFlows","security":[{"BearerAuth":[]}],"method":"get","path":"/traffic-insights/flows"}}