---
title: "Portal Application Analytics"
url: "https://nov18-dev.movespot.fyi/apis/portal-application-analytics-2/versions/e0606fc8-5af7-4955-b903-d9cb07167332"
---

# Portal Application Analytics

OpenAPI specification document.

```json
{"openapi":"3.0.0","info":{"title":"Portal Application Analytics","version":"2.0.0","description":"API for querying Application Analytics.","contact":{"name":"Kong","url":"https://cloud.konghq.com"}},"paths":{"/api/v2/stats":{"post":{"operationId":"query-application-analytics","summary":"Query Application Analytics","description":"Query","requestBody":{"description":"Object describing the query sent to analytics API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryApplicationAnalytics"},"examples":{"Query with a single metric":{"$ref":"#/components/examples/QueryExampleWithMetric"},"Query with a metric and dimension":{"$ref":"#/components/examples/QueryExampleWithMetricAndDimension"},"Query with a metric and two dimensions":{"$ref":"#/components/examples/QueryExampleWithMetricAndMultipleDimensions"},"Query with time dimension":{"$ref":"#/components/examples/QueryExampleWithTimeDimension"}}}}},"responses":{"200":{"$ref":"#/components/responses/QueryResponse"},"400":{"description":"Bad Request","content":{"application/problem+json":{"examples":{"BadRequestExample":{"$ref":"#/components/examples/BadRequestExample"}}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"examples":{"UnauthorizedExample":{"$ref":"#/components/examples/UnauthorizedExample"}}}}},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"portalAccessToken":[]}],"tags":["Application Analytics"]}},"/api/v2/stats/config":{"get":{"operationId":"get-application-analytics-config","summary":"Get Application Analytics Config","description":"Get config for application analytics","responses":{"200":{"$ref":"#/components/responses/GetConfig"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"portalAccessToken":[]}],"tags":["Application Analytics"]}}},"components":{"schemas":{"QueryApplicationAnalytics":{"type":"object","properties":{"start_ms":{"description":"Unix timestamp in milliseconds specifying the lower bound to return data for the query, inclusive.","type":"integer"},"end_ms":{"description":"Unix timestamp in milliseconds specifying upper bound to return data for the query, inclusive.","type":"integer"},"metrics":{"description":"A property of your API (such as request count or latency) that you wish to query on.\nYour chosen metric is aggregated within the specified dimensions, meaning that if you query 'request count by application', you'll receive the total number of requests each application received within the given time frame.  Some metrics, such as latency and response size, have more complicated aggregations: selecting P99 will result in the 99th percentile of the chosen metric.\n","type":"array","items":{"type":"string","enum":["REQUEST_COUNT","REQUEST_PER_MINUTE","RESPONSE_LATENCY_P99","RESPONSE_LATENCY_P95","RESPONSE_LATENCY_P50","RESPONSE_SIZE_P99","RESPONSE_SIZE_P95","RESPONSE_SIZE_P50","REQUEST_SIZE_P99","REQUEST_SIZE_P95","REQUEST_SIZE_P50"]},"maxItems":1,"minItems":1},"dimensions":{"description":"The dimensions for the query.  A query may have up to 2 dimensions, including time.\nIf no dimensions are provided, the report will simply return the provided metric aggregated across\nall available data.\n","type":"array","items":{"type":"string","enum":["API_PRODUCT_VERSION","APPLICATION","STATUS_CODE","STATUS_CODE_GROUPED","TIME"]},"default":[],"maxItems":2,"minItems":0},"granularity_ms":{"description":"`granularity_ms` is only valid for queries that include a time dimension, and it specifies the time buckets in for the returned data.\n","type":"integer","default":86400000},"filter":{"type":"array","items":{"discriminator":{"propertyName":"dimension","mapping":{"API_PRODUCT_VERSION":"#/components/schemas/ApiProductVersionFilter","APPLICATION":"#/components/schemas/ApplicationFilter","STATUS_CODE":"#/components/schemas/StatusCodeFilter","STATUS_CODE_GROUPED":"#/components/schemas/StatusCodeGroupedFilter"}},"oneOf":[{"$ref":"#/components/schemas/ApiProductVersionFilter"},{"$ref":"#/components/schemas/ApplicationFilter"},{"$ref":"#/components/schemas/StatusCodeFilter"},{"$ref":"#/components/schemas/StatusCodeGroupedFilter"}]},"default":[]}},"additionalProperties":false,"required":["start_ms","end_ms","metrics"]},"FilterType":{"description":"The type of filter to apply.  `IN` filters will limit results to only the specified values, while `NOT_IN` filters will exclude the specified values.","type":"string","enum":["IN","NOT_IN"]},"ApiProductVersionFilter":{"type":"object","properties":{"dimension":{"description":"The dimension to filter.","type":"string","enum":["API_PRODUCT_VERSION"]},"type":{"$ref":"#/components/schemas/FilterType"},"values":{"description":"The UUIDs of the API product versions to include in the results.\n","type":"array","items":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"}}},"additionalProperties":false,"required":["dimension","type","values"]},"ApplicationFilter":{"type":"object","properties":{"dimension":{"description":"The dimension to filter. If no application filter is provided the API will implicitly filter on the applications owned by the developer making the query request.","type":"string","enum":["APPLICATION"]},"type":{"$ref":"#/components/schemas/FilterType"},"values":{"description":"The UUIDs of the dev portal applications to include in the results.\n","type":"array","items":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"}}},"additionalProperties":false,"required":["dimension","type","values"]},"StatusCodeFilter":{"type":"object","properties":{"dimension":{"description":"The dimension to filter.","type":"string","enum":["STATUS_CODE"]},"type":{"$ref":"#/components/schemas/FilterType"},"values":{"description":"Only include requests with specific status codes in the results.\n","type":"array","items":{"type":"integer","minimum":100,"maximum":999}}},"additionalProperties":false,"required":["dimension","type","values"]},"StatusCodeGroupedFilter":{"type":"object","properties":{"dimension":{"description":"The dimension to filter.","type":"string","enum":["STATUS_CODE_GROUPED"]},"type":{"$ref":"#/components/schemas/FilterType"},"values":{"description":"Only include the given groups of status codes in the results.\n","type":"array","items":{"type":"string","pattern":"^\\d[X][X]$"}}},"additionalProperties":false,"required":["dimension","type","values"]},"QueryResponseMeta":{"description":"Query response metadata.","type":"object","properties":{"dimensions":{"description":"The dimension name and values returned in the response.","type":"object","additionalProperties":false,"properties":{"API_PRODUCT_VERSION":{"type":"array","items":{"type":"string"}},"APPLICATION":{"type":"array","items":{"type":"string"}},"STATUS_CODE":{"type":"array","items":{"type":"string"}},"STATUS_CODE_GROUPED":{"type":"array","items":{"type":"string"}}}},"metric_names":{"description":"The metric requested in query.","type":"array","items":{"type":"string","enum":["REQUEST_COUNT","REQUEST_PER_MINUTE","RESPONSE_LATENCY_P99","RESPONSE_LATENCY_P95","RESPONSE_LATENCY_P50","RESPONSE_SIZE_P99","RESPONSE_SIZE_P95","RESPONSE_SIZE_P50","REQUEST_SIZE_P99","REQUEST_SIZE_P95","REQUEST_SIZE_P50"]},"maxItems":1,"minItems":1},"metric_units":{"description":"The unit of metric.","type":"object","properties":{"REQUEST_COUNT":{"type":"string","default":"count"},"REQUEST_PER_MINUTE":{"type":"string","default":"count/minute"},"RESPONSE_LATENCY_P99":{"type":"string","default":"ms"},"RESPONSE_LATENCY_P95":{"type":"string","default":"ms"},"RESPONSE_LATENCY_P50":{"type":"string","default":"ms"},"RESPONSE_SIZE_P99":{"type":"string","default":"bytes"},"RESPONSE_SIZE_P95":{"type":"string","default":"bytes"},"RESPONSE_SIZE_P50":{"type":"string","default":"bytes"},"REQUEST_SIZE_P99":{"type":"string","default":"bytes"},"REQUEST_SIZE_P95":{"type":"string","default":"bytes"},"REQUEST_SIZE_P50":{"type":"string","default":"bytes"}}},"start_ms":{"description":"Unix timestamp in milliseconds specifying the lower bound to return data for the query. Provided from the query parameters.","type":"integer"},"end_ms":{"description":"Unix timestamp in milliseconds specifying the upper bound to return data for the query. Provided from the query parameters.","type":"integer"},"truncated":{"description":"True if the limit of dimension values was reached and results were truncated. Limit value is 50.","type":"boolean"},"granularity":{"description":"The resulting time bucket for the returned data. If `TIME` was not specified as a dimension, granularity is the duration of the query.","type":"integer"},"query_id":{"description":"Optional ID used to look up the query.","type":"string"}},"additionalProperties":false},"QueryResponseRecord":{"description":"A response record.","type":"object","properties":{"event":{"description":"Event within the response. Mapping from the requested metrics and dimensions to the values.","type":"object","additionalProperties":false,"properties":{"REQUEST_COUNT":{"description":"The number or requests metric.","type":"integer"},"REQUEST_PER_MINUTE":{"description":"The number of requests per minute metric.","type":"number"},"RESPONSE_LATENCY_P99":{"description":"99th percentile response latency metric in milliseconds.","type":"number"},"RESPONSE_LATENCY_P95":{"description":"95th percentile response latency metric in milliseconds.","type":"number"},"RESPONSE_LATENCY_P50":{"description":"50th percentile response latency metric in milliseconds.","type":"number"},"RESPONSE_SIZE_P99":{"description":"99th percentile response size metric in bytes.","type":"number"},"RESPONSE_SIZE_P95":{"description":"95th percentile response size metric in bytes.","type":"number"},"RESPONSE_SIZE_P50":{"description":"50th percentile response size metric in bytes.","type":"number"},"REQUEST_SIZE_P99":{"description":"99th percentile request size metric in bytes.","type":"number"},"REQUEST_SIZE_P95":{"description":"95th percentile request size metric in bytes.","type":"number"},"REQUEST_SIZE_P50":{"description":"50th percentile request size metric in bytes.","type":"number"},"API_PRODUCT_VERSION":{"description":"Dimension value for `API_PRODUCT_VERSION` name.","type":"string"},"APPLICATION":{"description":"Dimension value for `APPLICATION` name.","type":"string"},"STATUS_CODE":{"description":"Dimension value for `STATUS_CODE`.","type":"string"},"STATUS_CODE_GROUPED":{"description":"Dimension value for `STATUS_CODE_GROUPED`.","type":"string"}}},"timestamp":{"description":"An ISO-8601 timestamp. If `TIME` was requested as a dimension this will be the start of the time bucket. If not specified this is the start time of the query.","type":"string","format":"date-time","example":"2023-08-03T15:00:00.000Z"}},"additionalProperties":false},"QueryResponseRecords":{"description":"Query response data.","type":"array","items":{"$ref":"#/components/schemas/QueryResponseRecord"}},"GetConfigResponse":{"type":"object","properties":{"analytics":{"description":"Null if analytics is not enabled.","type":"object","additionalProperties":false,"nullable":true,"properties":{"percentiles":{"description":"True if analytics percentiles are enabled.","type":"boolean"},"retention_ms":{"description":"Analytics retention in milliseconds.","type":"integer"}},"required":["percentiles","retention_ms"]}},"additionalProperties":false,"required":["analytics"]},"BaseError":{"description":"standard error","type":"object","properties":{"status":{"description":"The HTTP status code of the error. Useful when passing the response\nbody to child properties in a frontend UI. Must be returned as an integer.\n","type":"integer","readOnly":true},"title":{"description":"A short, human-readable summary of the problem. It should not\nchange between occurences of a problem, except for localization.\nShould be provided as \"Sentence case\" for direct use in the UI.\n","type":"string","readOnly":true},"type":{"description":"The error type.","type":"string","readOnly":true},"instance":{"description":"Used to return the correlation ID back to the user, in the format\nkong:trace:<correlation_id>. This helps us find the relevant logs\nwhen a customer reports an issue.\n","type":"string","readOnly":true},"detail":{"description":"A human readable explanation specific to this occurence of the problem.\nThis field may contain request/entity data to help the user understand\nwhat went wrong. Enclose variable values in square brackets. Should be\nprovided as \"Sentence case\" for direct use in the UI.\n","type":"string","readOnly":true}},"required":["status","title","instance","detail"],"title":"Error"},"ForbiddenError":{"allOf":[{"$ref":"#/components/schemas/BaseError"},{"type":"object","properties":{"status":{"example":403},"title":{"example":"Forbidden"},"type":{"example":"https://httpstatuses.com/403"},"instance":{"example":"kong:trace:1234567890"},"detail":{"example":"Forbidden"}}}]},"UnauthorizedError":{"allOf":[{"$ref":"#/components/schemas/BaseError"},{"type":"object","properties":{"status":{"example":401},"title":{"example":"Unauthorized"},"type":{"example":"https://httpstatuses.com/401"},"instance":{"example":"kong:trace:1234567890"},"detail":{"example":"Invalid credentials"}}}]}},"examples":{"ResponseExampleWithMetricAndDimension":{"value":{"meta":{"dimensions":{"APPLICATION":["Application 1","Application 2"]},"metric_names":["RESPONSE_LATENCY_P99"],"metric_units":{"RESPONSE_LATENCY_P99":"ms"},"start_ms":1691074800000,"end_ms":1691161200000,"granularity":86400000,"truncated":false,"query_id":"portal-api-3c0abb98-90bd-4e80-a495-ac268acc493e"},"records":[{"event":{"APPLICATION":"Application 1","RESPONSE_LATENCY_P99":250},"timestamp":"2023-08-03T15:00:00.000Z"},{"event":{"APPLICATION":"Application 2","RESPONSE_LATENCY_P99":740},"timestamp":"2023-08-03T15:00:00.000Z"}]}},"ResponseExampleWithMetric":{"value":{"meta":{"dimensions":{},"metric_names":["REQUEST_PER_MINUTE"],"metric_units":{"REQUEST_PER_MINUTE":"count/minute"},"start_ms":1691158080000,"end_ms":1691158980000,"granularity":900000,"truncated":false,"query_id":"portal-api-3c0abb98-90bd-4e80-a495-ac268acc493e"},"records":[{"event":{"REQUEST_PER_MINUTE":1340.8666666666666},"timestamp":"2023-08-04T14:08:00.000Z"}]}},"ResponseExampleWithMetricAndMultipleDimensions":{"value":{"meta":{"start_ms":1691074800000,"end_ms":1691082000000,"granularity":7200000,"query_id":"portal-api-4fad296e-da5e-41ed-af86-191440fe448e","metric_names":["REQUEST_COUNT"],"metric_units":{"REQUEST_COUNT":"count"},"dimensions":{"APPLICATION":["GetMeAKongApplication926"],"STATUS_CODE_GROUPED":["2XX","3XX"]},"truncated":false},"records":[{"event":{"APPLICATION":"Application 1","STATUS_CODE_GROUPED":"2XX","REQUEST_COUNT":81447},"timestamp":"2023-08-03T15:00:00.000Z"},{"event":{"APPLICATION":"Application 1","STATUS_CODE_GROUPED":"5XX","REQUEST_COUNT":28468},"timestamp":"2023-08-03T15:00:00.000Z"},{"event":{"APPLICATION":"Application 2","STATUS_CODE_GROUPED":"2XX","REQUEST_COUNT":45819},"timestamp":"2023-08-03T15:00:00.000Z"},{"event":{"APPLICATION":"Application 2","STATUS_CODE_GROUPED":"5XX","REQUEST_COUNT":25041},"timestamp":"2023-08-03T15:00:00.000Z"}]}},"ResponseExampleWithTimeDimension":{"value":{"meta":{"start_ms":1691074800000,"end_ms":1691082000000,"granularity":3600000,"query_id":"portal-api-3c0abb98-90bd-4e80-a495-ac268acc493e","metric_names":["RESPONSE_SIZE_P99"],"metric_units":{"RESPONSE_SIZE_P99":"bytes"},"dimensions":{"STATUS_CODE_GROUPED":["2XX","3XX","4XX","5XX"]},"truncated":false},"records":[{"event":{"STATUS_CODE_GROUPED":"2XX","RESPONSE_SIZE_P99":590},"timestamp":"2023-08-03T15:00:00.000Z"},{"event":{"STATUS_CODE_GROUPED":"3XX","RESPONSE_SIZE_P99":584},"timestamp":"2023-08-03T15:00:00.000Z"},{"event":{"STATUS_CODE_GROUPED":"4XX","RESPONSE_SIZE_P99":629},"timestamp":"2023-08-03T15:00:00.000Z"},{"event":{"STATUS_CODE_GROUPED":"5XX","RESPONSE_SIZE_P99":603},"timestamp":"2023-08-03T15:00:00.000Z"},{"event":{"STATUS_CODE_GROUPED":"2XX","RESPONSE_SIZE_P99":590},"timestamp":"2023-08-03T16:00:00.000Z"},{"event":{"STATUS_CODE_GROUPED":"3XX","RESPONSE_SIZE_P99":584},"timestamp":"2023-08-03T16:00:00.000Z"},{"event":{"STATUS_CODE_GROUPED":"4XX","RESPONSE_SIZE_P99":628},"timestamp":"2023-08-03T16:00:00.000Z"},{"event":{"STATUS_CODE_GROUPED":"5XX","RESPONSE_SIZE_P99":603},"timestamp":"2023-08-03T16:00:00.000Z"}]}},"QueryExampleWithMetric":{"value":{"start_ms":1691158080000,"end_ms":1691158980000,"metrics":["REQUEST_PER_MINUTE"],"filter":[{"dimension":"API_PRODUCT_VERSION","type":"IN","values":["417e47e8-ae7b-48a1-9b34-3f6835161de1"]}]}},"QueryExampleWithMetricAndDimension":{"value":{"start_ms":1691074800000,"end_ms":1691161200000,"metrics":["RESPONSE_LATENCY_P99"],"dimensions":["APPLICATION"]}},"QueryExampleWithMetricAndMultipleDimensions":{"value":{"start_ms":1691074800000,"end_ms":1691082000000,"metrics":["REQUEST_COUNT"],"dimensions":["APPLICATION","STATUS_CODE_GROUPED"],"filter":[{"dimension":"STATUS_CODE_GROUPED","type":"IN","values":["2XX","5XX"]}]}},"QueryExampleWithTimeDimension":{"value":{"start_ms":1691074800000,"end_ms":1691082000000,"granularity_ms":3600000,"metrics":["RESPONSE_SIZE_P99"],"dimensions":["TIME","STATUS_CODE_GROUPED"]}},"BadRequestExample":{"value":{"status":400,"title":"Bad Request","instance":"kong:trace:9039922446017540182","detail":"Malformed Query: dimension API_PRODUCT is not allowed","invalid_parameters":[]}},"UnauthorizedExample":{"value":{"status":401,"title":"Unauthorized","instance":"kong:trace:9039922446017540182","detail":"Developer to not have access to APPLICATION: abe525e6-6baa-4cca-ba67-36dad0194a69","invalid_parameters":[]}},"GetConfigNoAnalytics200response":{"value":{"analytics":null}},"GetConfigAnalytics200response":{"value":{"analytics":{"percentiles":true,"retention_ms":31536000000}}},"ForbiddenExample":{"value":{"status":403,"title":"Forbidden","instance":"kong:trace:2723154947768991354","detail":"You do not have permission to perform this action"}},"examples-UnauthorizedExample":{"value":{"status":401,"title":"Unauthorized","instance":"kong:trace:8347343766220159418","detail":"Unauthorized"}}},"responses":{"QueryResponse":{"description":"A response from an Application Analytics query.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/QueryResponseMeta"},"records":{"$ref":"#/components/schemas/QueryResponseRecords"}},"additionalProperties":false},"examples":{"Response with a single metric":{"$ref":"#/components/examples/ResponseExampleWithMetric"},"Response with metric and dimension":{"$ref":"#/components/examples/ResponseExampleWithMetricAndDimension"},"Response with metric and two dimensions":{"$ref":"#/components/examples/ResponseExampleWithMetricAndMultipleDimensions"},"Response with time dimension":{"$ref":"#/components/examples/ResponseExampleWithTimeDimension"}}}}},"GetConfig":{"description":"Get config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetConfigResponse"},"examples":{"GetConfigNoAnalytics200response":{"$ref":"#/components/examples/GetConfigNoAnalytics200response"},"GetConfigAnalytics200response":{"$ref":"#/components/examples/GetConfigAnalytics200response"}}}}},"Forbidden":{"description":"Forbidden","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"},"examples":{"UnauthorizedExample":{"$ref":"#/components/examples/ForbiddenExample"}}}}},"Unauthorized":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"},"examples":{"UnauthorizedExample":{"$ref":"#/components/examples/examples-UnauthorizedExample"}}}}}},"securitySchemes":{"portalAccessToken":{"type":"apiKey","in":"cookie","name":"portalaccesstoken","description":"The Developer portal cookie is meant to be used by the Developer API to authenticate with.\n"}}},"tags":[{"name":"Application Analytics","description":"The API for querying Application Analytics. Application Analytics is only available for private portals."}]}
```
