Gong Statistics API

Operations for retrieving activity and performance statistics

OpenAPI Specification

gong-statistics-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Gong Auditing Audit Logs Statistics API
  description: The Gong Auditing API enables retrieval of audit log data by type and time range, providing visibility into user actions and system events for compliance and security monitoring.
  version: 2.0.0
  contact:
    name: Gong
    url: https://www.gong.io
    email: support@gong.io
  license:
    name: Proprietary
    url: https://www.gong.io/terms-of-service/
  termsOfService: https://www.gong.io/terms-of-service/
servers:
- url: https://api.gong.io/v2
  description: Gong API v2 Production Server
security:
- basicAuth: []
- bearerAuth: []
tags:
- name: Statistics
  description: Operations for retrieving activity and performance statistics
paths:
  /stats/activity/aggregated:
    post:
      operationId: retrieveAggregatedActivity
      summary: Gong Retrieve aggregated activity
      description: Retrieves aggregated user activity statistics for a specified time period. Returns metrics such as call counts, email counts, and other activity measures grouped by user.
      tags:
      - Statistics
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AggregatedActivityRequest'
      responses:
        '200':
          description: Successful response containing aggregated activity data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AggregatedActivityResponse'
        '400':
          description: Bad request due to invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - invalid or missing authentication credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /stats/activity/day-by-day:
    post:
      operationId: retrieveDailyActivity
      summary: Gong Retrieve daily activity
      description: Retrieves daily activity statistics broken down by date for specified users and time period. Returns per-day metrics for calls, emails, and other activities.
      tags:
      - Statistics
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DailyActivityRequest'
      responses:
        '200':
          description: Successful response containing daily activity data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DailyActivityResponse'
        '400':
          description: Bad request due to invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - invalid or missing authentication credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /stats/interaction:
    post:
      operationId: retrieveInteractionStats
      summary: Gong Retrieve interaction statistics
      description: Retrieves interaction statistics for calls including talk ratios, longest monologues, interactivity scores, and patience metrics for specified users and time period.
      tags:
      - Statistics
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InteractionStatsRequest'
      responses:
        '200':
          description: Successful response containing interaction statistics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InteractionStatsResponse'
        '400':
          description: Bad request due to invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - invalid or missing authentication credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /coaching/metrics:
    get:
      operationId: listCoachingMetrics
      summary: Gong List coaching metrics
      description: Retrieves coaching metrics for a specified manager, workspace, and time period. Returns data about coaching activities and performance.
      tags:
      - Statistics
      parameters:
      - name: workspace-id
        in: query
        required: false
        description: Filter by workspace ID.
        schema:
          type: string
      - name: manager-id
        in: query
        required: false
        description: Filter by manager's Gong user ID.
        schema:
          type: string
      - name: from
        in: query
        required: true
        description: Start date for the metrics period in ISO-8601 format.
        schema:
          type: string
          format: date-time
      - name: to
        in: query
        required: true
        description: End date for the metrics period in ISO-8601 format.
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: Successful response containing coaching metrics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoachingMetricsResponse'
        '400':
          description: Bad request due to invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - invalid or missing authentication credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AggregatedActivityResponse:
      type: object
      properties:
        requestId:
          type: string
          description: A unique identifier for the request.
        records:
          type: object
          properties:
            totalRecords:
              type: integer
            currentPageSize:
              type: integer
            cursor:
              type: string
        usersAggregatedActivity:
          type: array
          items:
            $ref: '#/components/schemas/UserAggregatedActivity'
          description: List of aggregated activity per user.
    UserInteractionStats:
      type: object
      properties:
        userId:
          type: string
          description: The Gong user ID.
        callsCount:
          type: integer
          description: Total number of calls.
        talkRatio:
          type: number
          format: float
          description: Average talk ratio (percentage of time the user spoke).
        longestMonologue:
          type: number
          description: Longest uninterrupted speaking duration in seconds.
        interactivity:
          type: number
          format: float
          description: Average interactivity score.
        patience:
          type: number
          format: float
          description: Average patience metric.
        questionRate:
          type: number
          format: float
          description: Average question rate per call.
    DailyActivityResponse:
      type: object
      properties:
        requestId:
          type: string
          description: A unique identifier for the request.
        records:
          type: object
          properties:
            totalRecords:
              type: integer
            currentPageSize:
              type: integer
            cursor:
              type: string
        usersDayByDayActivity:
          type: array
          items:
            type: object
            properties:
              userId:
                type: string
                description: The Gong user ID.
              dailyActivities:
                type: array
                items:
                  type: object
                  properties:
                    date:
                      type: string
                      format: date
                      description: The activity date.
                    callsAsHost:
                      type: integer
                    callsAttended:
                      type: integer
                    callsGaveComments:
                      type: integer
                    callsAccessedRecording:
                      type: integer
          description: Daily activity breakdown per user.
    UserAggregatedActivity:
      type: object
      properties:
        userId:
          type: string
          description: The Gong user ID.
        callsAsHost:
          type: integer
          description: Number of calls where the user was the host.
        callsAttended:
          type: integer
          description: Number of calls the user attended.
        callsGaveComments:
          type: integer
          description: Number of calls where the user gave comments.
        callsReceivedComments:
          type: integer
          description: Number of calls where the user received comments.
        callsAccessedRecording:
          type: integer
          description: Number of calls where the user accessed the recording.
        callsScored:
          type: integer
          description: Number of calls scored by the user.
        ownCallsListenedTo:
          type: integer
          description: Number of own calls the user listened to.
        othersCallsListenedTo:
          type: integer
          description: Number of others' calls the user listened to.
    DailyActivityRequest:
      type: object
      properties:
        cursor:
          type: string
          description: Cursor for pagination.
        filter:
          type: object
          properties:
            fromDateTime:
              type: string
              format: date-time
              description: Start of the date range.
            toDateTime:
              type: string
              format: date-time
              description: End of the date range.
            userIds:
              type: array
              items:
                type: string
              description: Filter by specific user IDs.
          description: Filter criteria for daily activity.
    ErrorResponse:
      type: object
      properties:
        requestId:
          type: string
          description: A unique identifier for the request.
        errors:
          type: array
          items:
            type: string
          description: List of error messages.
    InteractionStatsResponse:
      type: object
      properties:
        requestId:
          type: string
          description: A unique identifier for the request.
        records:
          type: object
          properties:
            totalRecords:
              type: integer
            currentPageSize:
              type: integer
            cursor:
              type: string
        usersInteractionStats:
          type: array
          items:
            $ref: '#/components/schemas/UserInteractionStats'
          description: Interaction statistics per user.
    CoachingMetricsResponse:
      type: object
      properties:
        requestId:
          type: string
          description: A unique identifier for the request.
        metrics:
          type: array
          items:
            type: object
            properties:
              userId:
                type: string
                description: The user ID.
              callsListenedTo:
                type: integer
                description: Number of direct report calls listened to.
              commentsGiven:
                type: integer
                description: Number of comments given to direct reports.
              scorecardsFilled:
                type: integer
                description: Number of scorecards filled for direct reports.
          description: Coaching metrics data.
    InteractionStatsRequest:
      type: object
      properties:
        cursor:
          type: string
          description: Cursor for pagination.
        filter:
          type: object
          properties:
            fromDateTime:
              type: string
              format: date-time
              description: Start of the date range.
            toDateTime:
              type: string
              format: date-time
              description: End of the date range.
            userIds:
              type: array
              items:
                type: string
              description: Filter by specific user IDs.
          description: Filter criteria for interaction statistics.
    AggregatedActivityRequest:
      type: object
      properties:
        cursor:
          type: string
          description: Cursor for pagination.
        filter:
          type: object
          properties:
            fromDateTime:
              type: string
              format: date-time
              description: Start of the date range.
            toDateTime:
              type: string
              format: date-time
              description: End of the date range.
            userIds:
              type: array
              items:
                type: string
              description: Filter by specific user IDs.
          description: Filter criteria for activity retrieval.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: 'Basic authentication using your Gong API access key and secret. Format: base64(access_key:access_secret).'
    bearerAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 Bearer token authentication.