Skip to content

Latest commit

 

History

History
125 lines (97 loc) · 36.2 KB

File metadata and controls

125 lines (97 loc) · 36.2 KB

AnalyticsService

A list of all methods in the AnalyticsService service. Click on the method name to view detailed information about that method.

Methods Description
getAnalyticsData Gets analytics data based on the specified resource, metrics, and given filters for team, internal, and public workspaces, as well as Partner Workspaces. Note: This endpoint only accepts the following resource:metric query parameter combinations: - userworkspace_active_users, active_users - workspaceelements_in_workspace, active_workspaces, api_calls, active_collections, response_status, pending_invites, needs_attention, success_rate, user_requests, collection_error_aggregate - teamuser_api_journey, workspace_distribution, internal_workspace_distribution, license_consumption, members, last_autoflex_cycle, partner_engagement_funnel members_overtime , member_invites, invites_sent , invites_accepted - aitop_agent_models_by_usage, activity_distribution, peak_activity, usage_leaderboard, credit_usage_by_model, messages_sent, credit_usage, agent_mode_sessions, new_vs_returning_users, agent_mode_users - api_developmentactive_workspaces, entity_activity, top_entities - api_testingruns, functional_test_runs, performance_test_runs - api_productionmonitor_runs, flow_executions - api_distributionactive_workspaces, pvt_network, partner, public - api_managementworkspace_activity The view query parameter only accepts the following values when called with the following resource:metric pairs: detailed or summaryuser:active_users, workspace:active_workspaces, workspace:pending_invites, workspace:needs_attention, workspace:success_rate, team:partner_engagement_funnel, api_distribution:pvt_network, api_distribution:partner, api_distribution:public - detailed, summary, or trendsapi_development:entity_activity, api_testing:functional_test_runs , api_testing:performance_test_runs, api_production:monitor_runs, api_production:flow_executions - summary or trendapi_development:active_workspaces, api_testing:runs, api_distribution:active_workspaces, api_management:workspace_activity - summary only — workspace:elements_in_workspace, workspace:workspace_active_users, workspace:api_calls, workspace:response_status, team:user_api_journey, team:workspace_distribution, team:internal_workspace_distribution, team:license_consumption - detailed only — workspace:active_collections, workspace:user_requests, api_development:top_entities, api_management:popular_workspaces , team:invites_sent , team:invites_accepted - trend only — team:members_overtime, team:member_invites
getAnalyticsMetadata Returns a catalog of analytics resources and their corresponding metrics for use with the GET /analytics endpoint. These metrics provide insights on API usage, success, workspace, and team trends in Postman.

getAnalyticsData

Gets analytics data based on the specified resource, metrics, and given filters for team, internal, and public workspaces, as well as Partner Workspaces. Note: This endpoint only accepts the following resource:metric query parameter combinations: - userworkspace_active_users, active_users - workspaceelements_in_workspace, active_workspaces, api_calls, active_collections, response_status, pending_invites, needs_attention, success_rate, user_requests, collection_error_aggregate - teamuser_api_journey, workspace_distribution, internal_workspace_distribution, license_consumption, members, last_autoflex_cycle, partner_engagement_funnel members_overtime , member_invites, invites_sent , invites_accepted - aitop_agent_models_by_usage, activity_distribution, peak_activity, usage_leaderboard, credit_usage_by_model, messages_sent, credit_usage, agent_mode_sessions, new_vs_returning_users, agent_mode_users - api_developmentactive_workspaces, entity_activity, top_entities - api_testingruns, functional_test_runs, performance_test_runs - api_productionmonitor_runs, flow_executions - api_distributionactive_workspaces, pvt_network, partner, public - api_managementworkspace_activity The view query parameter only accepts the following values when called with the following resource:metric pairs: detailed or summaryuser:active_users, workspace:active_workspaces, workspace:pending_invites, workspace:needs_attention, workspace:success_rate, team:partner_engagement_funnel, api_distribution:pvt_network, api_distribution:partner, api_distribution:public - detailed, summary, or trendsapi_development:entity_activity, api_testing:functional_test_runs , api_testing:performance_test_runs, api_production:monitor_runs, api_production:flow_executions - summary or trendapi_development:active_workspaces, api_testing:runs, api_distribution:active_workspaces, api_management:workspace_activity - summary only — workspace:elements_in_workspace, workspace:workspace_active_users, workspace:api_calls, workspace:response_status, team:user_api_journey, team:workspace_distribution, team:internal_workspace_distribution, team:license_consumption - detailed only — workspace:active_collections, workspace:user_requests, api_development:top_entities, api_management:popular_workspaces , team:invites_sent , team:invites_accepted - trend only — team:members_overtime, team:member_invites

  • HTTP Method: GET
  • Endpoint: /analytics

Parameters

Name Type Required Description
resource AnalyticsResource Returns metrics and insights for API usage, success, and workspace/team trends in Postman: - user — Data related to individual user activities and engagement within Postman workspaces. - team — Team-level analytics, license consumption, and organizational trends. - workspace — Workspace-level activities, elements, and collaboration patterns. - ai — Analytics related to Agent Mode usage across workspaces, covering user activity, model usage, and credit consumption patterns. - api_development — API development activity metrics that include workspace counts, entity activity by type (collection, flow, mock, specification, sdk), and top entities. - api_testing — API testing metrics such as total test runs, functional test runs (Collection Runner), and performance test runs. - api_production — API production metrics, including monitor run activity and production flow execution activity. - api_distribution — API distribution metrics, such as active workspace counts across distribution channels. - api_management — API management metrics, such as workspace activity, active counts, trends, and top workspaces.
metrics AnalyticsMetrics Filters the response by only the given metrics. The metric must match the given resource value. For a list of metrics and their related resource value, call the GET /analytics-metadata endpoint.
view AnalyticsView The view type for the analytics data: - detailed — Return extensive information. - summary — Return aggregated information. - trend — Return trend information over a duration.
workspaceType string A comma-separated list of internal, public, and partner workspace types to filter the results by.
userId string A comma-separated list of user IDs to filter the results by. Only pass this parameter when calling the user_requests metric for the workspace resource.
duration AnalyticsDuration Filters the response by the given duration.
requestId string A comma-separated list of unique request IDs (userId-requestId) to filter the response by. Only pass this parameter when using the user_requests metric.
responseStatus string A comma-separated list of HTTP response status codes to filter the results by. Accepts values 100 through 600. Only pass this parameter when using the user_requests metric.
attentionType string A comma-separated list of issues types to filter the results by. Attention types provide details about issues users or partners are facing. Accepts the high_non_200OK_rate_for_partner and no_success_on_tried_request values. Only pass this parameter when using the needs_attention metric.
period string Filters results for a given period of time (as opposed to a range) for supported views. Use a YEAR-MONTH value for month filtering or YEAR-MONTH-DAY day filtering.
userType AnalyticsUserType Filters results by a specific user type for supported views.
entityType AnalyticsEntityType The type of Postman entity to filter results by.
limit number The maximum number of rows to return in the response.
offset number The zero-based offset of the first item to return.

Return Type

GetAnalyticsData

Example Usage Code Snippet

import {
  AnalyticsDuration,
  AnalyticsEntityType,
  AnalyticsMetrics,
  AnalyticsResource,
  AnalyticsUserType,
  AnalyticsView,
  PostmanApi,
} from '@postman/api-sdk';

(async () => {
  const postmanApi = new PostmanApi({
    apiKey: 'YOUR_API_KEY',
  });

  const analyticsResource = AnalyticsResource.USER;
  const analyticsMetrics = AnalyticsMetrics.ACTIVE_USERS;
  const analyticsView = AnalyticsView.DETAILED;
  const analyticsDuration = AnalyticsDuration.LAST_30_DAYS;
  const analyticsUserType = AnalyticsUserType.NEW_;
  const analyticsEntityType = AnalyticsEntityType.COLLECTION;

  const data = await postmanApi.analytics.getAnalyticsData({
    resource: analyticsResource,
    metrics: analyticsMetrics,
    view: analyticsView,
    workspaceType: 'public',
    userId: '12345678',
    duration: analyticsDuration,
    requestId: '12345678-c82dd02c-4870-4907-8fcb-593a876cf05b',
    responseStatus: '404',
    attentionType: 'no_success_on_tried_request',
    period: '2026-06',
    userType: analyticsUserType,
    entityType: analyticsEntityType,
    limit: 3,
    offset: 5,
  });

  console.log(data);
})();

getAnalyticsMetadata

Returns a catalog of analytics resources and their corresponding metrics for use with the GET /analytics endpoint. These metrics provide insights on API usage, success, workspace, and team trends in Postman.

  • HTTP Method: GET
  • Endpoint: /analytics-metadata

Parameters

Name Type Required Description
include string A comma-separated list of the additional information to include in the response. Accepts the parameters and response values. When you pass this query parameter and its values, the response provides detailed information, including parameters and response schemas for the given metrics.
resources string A comma-separated list of resource types to filter the metrics by. Accepts the user, workspace, team, and ai values.
metrics AnalyticsMetrics A comma-separated list of metrics values to use to filter the response. If you don't pass this query parameter, then the response returns all metadata for all available metrics.

Return Type

GetAnalyticsMetadata

Example Usage Code Snippet

import { AnalyticsMetrics, PostmanApi } from '@postman/api-sdk';

(async () => {
  const postmanApi = new PostmanApi({
    apiKey: 'YOUR_API_KEY',
  });

  const analyticsMetrics = AnalyticsMetrics.ACTIVE_USERS;

  const data = await postmanApi.analytics.getAnalyticsMetadata({
    include: 'parameters,response',
    resources: 'user,workspace,team',
    metrics: analyticsMetrics,
  });

  console.log(data);
})();