openapi: 3.0.1 info: contact: email: support@instana.com name: © Instana url: http://instana.com termsOfService: https://www.instana.com/terms-of-use/ title: Instana REST API documentation Website Metrics API version: 1.307.1417 x-ibm-ahub-try: true x-logo: altText: instana logo backgroundColor: '#FAFBFC' url: header-logo.svg description: "Searching for answers and best pratices? Check our [IBM Instana Community](https://community.ibm.com/community/user/aiops/communities/community-home?CommunityKey=58f324a3-3104-41be-9510-5b7c413cc48f).\n\n
\n \"info\n \n Our API documentation is moving to \n API Hub\n\t — please update your bookmarks now, as the current site will be deprecated after Release-306.\n \n
\n\n## Overview\nThe Instana REST API provides programmatic access to the Instana platform. It can be used to retrieve data available through the Instana UI Dashboard -- metrics, events, traces, etc -- and also to automate configuration tasks such as user management.\n\n### Navigating the API documentation\nThe API endpoints are grouped by product area and functionality. This generally maps to how our UI Dashboard is organized, hopefully making it easier to locate which endpoints you'd use to fetch the data you see visualized in our UI. The [UI sections](https://www.ibm.com/docs/en/instana-observability/current?topic=working-user-interface#navigation-menu) include:\n- Websites & Mobile Apps\n- Applications\n- Infrastructure\n- Synthetic Monitoring\n- Events\n- Automation\n- Service Levels\n- Settings\n- etc\n\n### Rate Limiting\nA rate limit is applied to API usage. Up to 5,000 calls per hour can be made. How many remaining calls can be made and when this call limit resets, can inspected via three headers that are part of the responses of the API server.\n\n- **X-RateLimit-Limit:** Shows the maximum number of calls that may be executed per hour.\n- **X-RateLimit-Remaining:** How many calls may still be executed within the current hour.\n- **X-RateLimit-Reset:** Time when the remaining calls will be reset to the limit. For compatibility reasons with other rate limited APIs, this date is not the date in milliseconds, but instead in seconds since 1970-01-01T00:00:00+00:00.\n\n### Further Reading\nWe provide additional documentation for our REST API in our [product documentation](https://www.ibm.com/docs/en/instana-observability/current?topic=apis-web-rest-api). Here you'll also find some common queries for retrieving data and configuring Instana.\n\n## Getting Started with the REST API\n\n### API base URL\nThe base URL for an specific instance of Instana can be determined using the tenant and unit information.\n- `base`: This is the base URL of a tenant unit, e.g. `https://test-example.instana.io`. This is the same URL that is used to access the Instana user interface.\n- `apiToken`: Requests against the Instana API require valid API tokens. An initial API token can be generated via the Instana user interface. Any additional API tokens can be generated via the API itself.\n\n### Curl Example\nHere is an Example to use the REST API with Curl. First lets get all the available metrics with possible aggregations with a GET call.\n\n```bash\ncurl --request GET \\\n --url https://test-instana.instana.io/api/application-monitoring/catalog/metrics \\\n --header 'authorization: apiToken xxxxxxxxxxxxxxxx'\n```\n\nNext we can get every call grouped by the endpoint name that has an error count greater then zero. As a metric we could get the mean error rate for example.\n\n```bash\ncurl --request POST \\\n --url https://test-instana.instana.io/api/application-monitoring/analyze/call-groups \\\n --header 'authorization: apiToken xxxxxxxxxxxxxxxx' \\\n --header 'content-type: application/json' \\\n --data '{\n \"group\":{\n \"groupbyTag\":\"endpoint.name\"\n },\n \"tagFilters\":[\n \t{\n \t\t\"name\":\"call.error.count\",\n \t\t\"value\":\"0\",\n \t\t\"operator\":\"GREATER_THAN\"\n \t}\n ],\n \"metrics\":[\n \t{\n \t\t\"metric\":\"errors\",\n \t\t\"aggregation\":\"MEAN\"\n \t}\n ]\n }'\n```\n\n### Generating REST API clients\n\nThe API is specified using the [OpenAPI v3](https://github.com/OAI/OpenAPI-Specification) (previously known as Swagger) format.\nYou can download the current specification at our [GitHub API documentation](https://instana.github.io/openapi/openapi.yaml).\n\nOpenAPI tries to solve the issue of ever-evolving APIs and clients lagging behind. Please make sure that you always use the latest version of the generator, as a number of improvements are regularly made.\nTo generate a client library for your language, you can use the [OpenAPI client generators](https://github.com/OpenAPITools/openapi-generator).\n\n#### Go\nFor example, to generate a client library for Go to interact with our backend, you can use the following script; mind replacing the values of the `UNIT_NAME` and `TENANT_NAME` environment variables using those for your tenant unit:\n\n```bash\n#!/bin/bash\n\n### This script assumes you have the `java` and `wget` commands on the path\n\nexport UNIT_NAME='myunit' # for example: prod\nexport TENANT_NAME='mytenant' # for example: awesomecompany\n\n//Download the generator to your current working directory:\nwget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.3.1/openapi-generator-cli-4.3.1.jar -O openapi-generator-cli.jar --server-variables \"tenant=${TENANT_NAME},unit=${UNIT_NAME}\"\n\n//generate a client library that you can vendor into your repository\njava -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g go \\\n -o pkg/instana/openapi \\\n --skip-validate-spec\n\n//(optional) format the Go code according to the Go code standard\ngofmt -s -w pkg/instana/openapi\n```\n\nThe generated clients contain comprehensive READMEs, and you can start right away using the client from the example above:\n\n```go\nimport instana \"./pkg/instana/openapi\"\n\n// readTags will read all available application monitoring tags along with their type and category\nfunc readTags() {\n\tconfiguration := instana.NewConfiguration()\n\tconfiguration.Host = \"tenant-unit.instana.io\"\n\tconfiguration.BasePath = \"https://tenant-unit.instana.io\"\n\n\tclient := instana.NewAPIClient(configuration)\n\tauth := context.WithValue(context.Background(), instana.ContextAPIKey, instana.APIKey{\n\t\tKey: apiKey,\n\t\tPrefix: \"apiToken\",\n\t})\n\n\ttags, _, err := client.ApplicationCatalogApi.GetApplicationTagCatalog(auth)\n\tif err != nil {\n\t\tfmt.Fatalf(\"Error calling the API, aborting.\")\n\t}\n\n\tfor _, tag := range tags {\n\t\tfmt.Printf(\"%s (%s): %s\\n\", tag.Category, tag.Type, tag.Name)\n\t}\n}\n```\n\n#### Java\nFollow the instructions provided in the official documentation from [OpenAPI Tools](https://github.com/OpenAPITools) to download the [openapi-generator-cli.jar](https://github.com/OpenAPITools/openapi-generator?tab=readme-ov-file#13---download-jar).\n\nDepending on your environment, use one of the following java http client implementations which will create a valid client for our OpenAPI specification:\n```\n//Nativ Java HTTP Client\njava -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g java -o pkg/instana/openapi --skip-validate-spec -p dateLibrary=java8 --library native\n\n//Spring WebClient\njava -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g java -o pkg/instana/openapi --skip-validate-spec -p dateLibrary=java8,hideGenerationTimestamp=true --library webclient\n\n//Spring RestTemplate\njava -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g java -o pkg/instana/openapi --skip-validate-spec -p dateLibrary=java8,hideGenerationTimestamp=true --library resttemplate\n\n```\n" servers: - description: Instana Backend url: https://{unit}-{tenant}.instana.io variables: tenant: default: tenant description: Customer tenant unit unit: default: unit description: Customer tenant name - description: Instana Self-Hosted Backend url: https://{domain} variables: domain: default: example.com description: Customer Self-Hosted domain tags: - name: Website Metrics paths: /api/website-monitoring/metrics: post: deprecated: true description: API request to get website monitoring beacon metrics. operationId: getBeaconMetrics requestBody: content: application/json: schema: $ref: '#/components/schemas/GetWebsiteMetrics' responses: '200': content: application/json: schema: $ref: '#/components/schemas/WebsiteMetricResult' description: OK security: - ApiKeyAuth: - Default summary: Get beacon metrics tags: - Website Metrics x-ibm-ahub-byok: true /api/website-monitoring/page-load{id}{timestamp}: get: description: API request to get website monitoring beacons for a page load. operationId: getPageLoad parameters: - description: Identifier of the page load to be retrieved example: 63f5b070e8d9a597 in: path name: id required: true schema: type: string style: matrix - description: Timestamp of the page load to be retrieved example: 1707012285674 in: path name: timestamp required: true schema: type: integer format: int64 style: matrix responses: '200': content: application/json: example: - websiteId: example website id websiteLabel: robot-shop page: Home phase: pageLoad timestamp: 1707012285674 clockSkew: 447 duration: 120 batchSize: 1 accurateTimingsAvailable: true deprecations: [] pageLoadId: 974bca2eb13047c sessionId: e995a184bb4b4e0 beaconId: 0974bca2eb13047c backendTraceId: c92e3ec967ef173f type: pageLoad customEventName: '' meta: stage: production status: bronze locationUrl: http://robotshop.instana.com/ locationOrigin: http://robotshop.instana.com locationPath: / errorCount: 0 errorMessage: '' errorId: '' errorType: '' parsedStackTrace: [] componentStack: '' userIp: 87.191.0.0 userId: example user id userName: example user name userEmail: example@example.com userLanguages: - de-DE deviceType: '' connectionType: 4g browserName: Firefox browserVersion: '63' osName: Ubuntu osVersion: '18' windowHidden: false windowWidth: 1149 windowHeight: 1008 latitude: 50.8021 longitude: 8.7857 accuracyRadius: 200 city: Weidenhausen subdivision: Hesse subdivisionCode: HE country: Germany countryCode: DE continent: Europe continentCode: EU httpCallUrl: '' httpCallOrigin: '' httpCallPath: '' httpCallMethod: '' httpCallStatus: 400 httpCallCorrelationAttempted: false httpCallAsynchronous: false initiator: html resourceType: document cacheInteraction: '' encodedBodySize: -1 decodedBodySize: -1 transferSize: -1 unloadTime: 0 redirectTime: 0 appCacheTime: 0 dnsTime: 0 tcpTime: 0 sslTime: 0 requestTime: 42 responseTime: 1 processingTime: -1 onLoadTime: 1 backendTime: 51 frontendTime: -1 domTime: -1 childrenTime: 5 firstPaintTime: 331 firstContentfulPaintTime: 331 largestContentfulPaintTime: 331 firstInputDelayTime: -1 cumulativeLayoutShift: -1 cspBlockedUri: '' cspEffectiveDirective: '' cspOriginalPolicy: '' cspDisposition: '' cspSample: '' cspSourceFile: '' cspLineNumber: -1 cspColumnNumber: -1 snippetVersion: '2' httpCallHeaders: {} parentBeaconId: '' interactionNextPaint: -1 schema: type: array items: $ref: '#/components/schemas/WebsiteMonitoringBeacon' description: OK '400': description: Bad request. '404': description: Resource not found. security: - ApiKeyAuth: - Default summary: Get page load tags: - Website Metrics x-ibm-ahub-byok: true /api/website-monitoring/v2/metrics: post: description: API request to get website monitoring beacon metrics. operationId: getBeaconMetricsV2 requestBody: content: application/json: example: metrics: - metric: beaconCount aggregation: SUM tagFilterExpression: type: EXPRESSION logicalOperator: AND elements: - type: TAG_FILTER name: beacon.website.name operator: EQUALS entity: NOT_APPLICABLE value: robot-shop - type: TAG_FILTER name: beacon.location.path operator: EQUALS entity: NOT_APPLICABLE value: / timeFrame: to: null windowSize: 3600000 type: PAGELOAD schema: $ref: '#/components/schemas/GetWebsiteMetricsV2' responses: '200': content: application/json: example: metrics: beaconCount.sum: - - 1706856180000 - 100 adjustedTimeFrame: windowSize: 3540000 to: 1706856180000 schema: $ref: '#/components/schemas/MetricAPIResult' description: OK '401': description: Unauthorized access - requires user authentication. '404': description: Resource not found. '422': description: Unprocessable request - missing/invalid data. '500': description: Internal server error. security: - ApiKeyAuth: - Default summary: Get beacon metrics tags: - Website Metrics x-ibm-ahub-byok: true components: schemas: DeprecatedTagFilter: type: object properties: entity: type: string enum: - NOT_APPLICABLE - DESTINATION - SOURCE name: type: string operator: type: string enum: - EQUALS - CONTAINS - LESS_THAN - LESS_OR_EQUAL_THAN - GREATER_THAN - GREATER_OR_EQUAL_THAN - NOT_EMPTY - NOT_EQUAL - NOT_CONTAIN - IS_EMPTY - NOT_BLANK - IS_BLANK - STARTS_WITH - ENDS_WITH - NOT_STARTS_WITH - NOT_ENDS_WITH - REGEX_MATCH value: type: string required: - name - operator - value WebsiteMonitoringMetricsConfiguration: type: object properties: aggregation: type: string description: 'Set aggregation that can be applied to a series of values. Eg: `MEAN`.' enum: - SUM - MEAN - MAX - MIN - P25 - P50 - P75 - P90 - P95 - P98 - P99 - P99_9 - P99_99 - DISTINCT_COUNT - SUM_POSITIVE - PER_SECOND - INCREASE granularity: type: integer format: int32 description: 'If the granularity is set you will get data points with the specified granularity in seconds. Default: `1000` milliseconds' metric: type: string description: 'Set a particular metric, eg: `latency`.' required: - aggregation - metric WebsiteMonitoringBeacon: type: object properties: accuracyRadius: type: integer format: int64 minimum: -1 accurateTimingsAvailable: type: boolean agentVersion: type: string appCacheTime: type: integer format: int64 minimum: -1 backendTime: type: integer format: int64 minimum: -1 backendTraceId: type: string batchSize: type: integer format: int64 minimum: 1 beaconId: type: string browserName: type: string browserVersion: type: string bytesIngested: type: integer format: int64 cacheInteraction: type: string childrenTime: type: integer format: int64 minimum: -1 city: type: string clockSkew: type: integer format: int64 minimum: -1 componentStack: type: string connectionType: type: string continent: type: string continentCode: type: string country: type: string countryCode: type: string cspBlockedUri: type: string cspColumnNumber: type: integer format: int64 cspDisposition: type: string cspEffectiveDirective: type: string cspLineNumber: type: integer format: int64 cspOriginalPolicy: type: string cspSample: type: string cspSourceFile: type: string cumulativeLayoutShift: type: number format: double customEventName: type: string customMetric: type: number format: double decodedBodySize: type: integer format: int64 minimum: -1 deprecations: type: array items: type: string maxItems: 16 minItems: 0 uniqueItems: true deviceType: type: string dnsTime: type: integer format: int64 minimum: -1 domTime: type: integer format: int64 minimum: -1 duration: type: integer format: int64 minimum: 0 encodedBodySize: type: integer format: int64 minimum: -1 errorCount: type: integer format: int64 minimum: 0 errorId: type: string errorMessage: type: string errorType: type: string firstContentfulPaintTime: type: integer format: int64 minimum: -1 firstInputDelayTime: type: integer format: int64 minimum: -1 firstPaintTime: type: integer format: int64 minimum: -1 frontendTime: type: integer format: int64 minimum: -1 graphqlOperationName: type: string graphqlOperationType: type: string httpCallAsynchronous: type: boolean httpCallCorrelationAttempted: type: boolean httpCallHeaders: type: object additionalProperties: type: string httpCallMethod: type: string httpCallOrigin: type: string httpCallPath: type: string httpCallStatus: type: integer format: int32 maximum: 599 minimum: -1 httpCallUrl: type: string initiator: type: string interactionNextPaint: type: integer format: int64 internalMeta: type: object additionalProperties: type: string label: type: string largestContentfulPaintTime: type: integer format: int64 minimum: -1 latitude: type: number format: double locationOrigin: type: string locationPath: type: string locationUrl: type: string longitude: type: number format: double meta: type: object additionalProperties: type: string onLoadTime: type: integer format: int64 minimum: -1 osName: type: string osVersion: type: string page: type: string pageLoadId: type: string parentBeaconId: type: string parsedStackTrace: type: array items: $ref: '#/components/schemas/JsStackTraceLine' maxItems: 64 minItems: 0 phase: type: string processingTime: type: integer format: int64 minimum: -1 redirectTime: type: integer format: int64 minimum: -1 requestTime: type: integer format: int64 minimum: -1 resourceType: type: string responseTime: type: integer format: int64 minimum: -1 sessionId: type: string snippetVersion: type: string sslTime: type: integer format: int64 minimum: -1 stackTrace: type: string stackTraceParsingStatus: type: integer format: int32 minimum: -1 stackTraceReadability: type: integer format: int32 minimum: 0 subdivision: type: string subdivisionCode: type: string tcpTime: type: integer format: int64 minimum: -1 timestamp: type: integer format: int64 minimum: 1 transferSize: type: integer format: int64 minimum: -1 type: type: string unloadTime: type: integer format: int64 minimum: -1 useFeatures: type: array items: type: string maxItems: 15 minItems: 0 userEmail: type: string userId: type: string userIp: type: string userLanguages: type: array items: type: string maxItems: 5 minItems: 0 userName: type: string websiteId: type: string websiteLabel: type: string windowHeight: type: integer format: int32 minimum: -1 windowHidden: type: boolean windowWidth: type: integer format: int32 minimum: -1 required: - beaconId - locationOrigin - locationUrl - pageLoadId - type - websiteId - websiteLabel MetricAPIResult: type: object properties: adjustedTimeframe: $ref: '#/components/schemas/AdjustedTimeframe' metrics: type: object additionalProperties: type: array items: type: array items: type: number required: - metrics WebsiteMetricResult: type: object properties: empty: type: boolean TagFilterExpressionElement: type: object description: Boolean expression of tag filters to define the scope of relevant calls. discriminator: mapping: EXPRESSION: '#/components/schemas/TagFilterExpression' TAG_FILTER: '#/components/schemas/TagFilter' propertyName: type properties: type: type: string required: - type AdjustedTimeframe: type: object description: 'Time frame provided in API request is slightly adjusted in response for faster API response. For example, In request payload, if timeframe is 08:03 - 14:03, which is a 6 hour window size. It is adjusted to 08:05 - 14:00 Another example, In request payload, if timeframe is 08:20 - 08:20 (next day) which is a 24h window size. It is adjusted to 08:30 - 08:00 (next day) ' properties: to: type: integer format: int64 description: 'end of timeframe expressed as the Unix epoch time in milliseconds. Eg: `ISO 8601` standard time `2024-06-27T05:05:55.615Z` can be represented as `1719464755615` in Unix epoch time in milliseconds.' windowSize: type: integer format: int64 description: windowSize in milliseconds minimum: 0 required: - to GetWebsiteMetrics: type: object properties: metrics: type: array items: $ref: '#/components/schemas/WebsiteMonitoringMetricsConfiguration' maxItems: 5 minItems: 1 tagFilters: type: array items: $ref: '#/components/schemas/DeprecatedTagFilter' maxItems: 32 minItems: 0 timeFrame: $ref: '#/components/schemas/TimeFrame' type: type: string enum: - PAGELOAD - RESOURCELOAD - HTTPREQUEST - ERROR - CUSTOM - PAGE_CHANGE required: - metrics - type GetWebsiteMetricsV2: type: object properties: metrics: type: array items: $ref: '#/components/schemas/WebsiteMonitoringMetricsConfiguration' maxItems: 5 minItems: 1 tagFilterExpression: $ref: '#/components/schemas/TagFilterExpressionElement' timeFrame: $ref: '#/components/schemas/TimeFrame' type: type: string enum: - PAGELOAD - RESOURCELOAD - HTTPREQUEST - ERROR - CUSTOM - PAGE_CHANGE required: - metrics - type TimeFrame: type: object description: Time range for which the data should be retrieved. properties: to: type: integer format: int64 description: 'end of timeframe expressed as the Unix epoch time in milliseconds. Eg: `ISO 8601` standard time `2024-06-27T05:05:55.615Z` can be represented as `1719464755615` in Unix epoch time in milliseconds.' windowSize: type: integer format: int64 description: windowSize in milliseconds maximum: 2678400000 minimum: 0 JsStackTraceLine: type: object properties: column: type: integer format: int32 minimum: -1 file: type: string line: type: integer format: int32 minimum: -1 name: type: string translationExplanation: type: string translationStatus: type: integer format: int32 minimum: -1 required: - file securitySchemes: ApiKeyAuth: in: header name: authorization type: apiKey description: "## Example\n\n```bash\ncurl --request GET \\\n --url https://test-instana.instana.io/api/application-monitoring/catalog/metrics \\\n --header 'authorization: apiToken xxxxxxxxxxxxxxxx'\n```\n" x-tagGroups: - name: Websites & Mobile Apps tags: - Website Metrics - Website Catalog - Website Analyze - Website Configuration - Mobile App Metrics - Mobile App Catalog - Mobile App Analyze - Mobile App Configuration - End User Monitoring - name: Applications tags: - Application Metrics - Application Resources - Application Catalog - Application Analyze - Application Settings - Application Topology - Application Alert Configuration - Global Application Alert Configuration - name: Infrastructure tags: - Infrastructure Analyze - Infrastructure Metrics - Infrastructure Resources - Infrastructure Catalog - Infrastructure Topology - name: Logging tags: - Logging Analyze - name: Synthetic Monitoring tags: - Synthetic Catalog - Synthetic Metrics - Synthetic Settings - Synthetic Test Playback Results - Synthetic Alert Configuration - name: Logs tags: - Log Alert Configuration - name: Events tags: - Events - Event Settings - name: Automation tags: - Action Catalog - Action History - Policies - name: Service Levels tags: - SLI Settings - SLI Report - Apdex Settings - Apdex Report - Service Levels Objective(SLO) Configurations - Service Levels Objective(SLO) Report - Service Levels Alert Configuration - SLO Correction Configurations - SLO Correction Windows - name: AI Management tags: - AI Management - name: Settings tags: - Custom Dashboards - User - Groups - Teams - Roles - Audit Log - API Token - Maintenance Configuration - Synthetic Calls - Session Settings - Automation Settings - Authentication - name: Open Beta Features tags: - Infrastructure Analyze - name: Closed Beta Features tags: - Infrastructure Alert Configuration - name: Instana tags: - Releases - Host Agent - Health - Usage