{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/webex/main/json-schema/webex-agent-api-response-schema.json",
  "title": "AgentApiResponse",
  "description": "Response wrapper for agent statistics.",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/webex-agents-api-openapi.yml#/components/schemas/AgentApiResponse",
  "required": [
    "data",
    "meta"
  ],
  "type": "object",
  "properties": {
    "meta": {
      "description": "Response metadata.",
      "$ref": "#/$defs/Meta"
    },
    "data": {
      "type": "array",
      "description": "List of Agent Statistics records retrieved according to query parameters.",
      "items": {
        "$ref": "#/$defs/OutAgentStatistics"
      }
    }
  },
  "$defs": {
    "ChannelResponse": {
      "type": "object",
      "properties": {
        "channelType": {
          "type": "string",
          "description": "Channel Type"
        },
        "totalAssignedTasks": {
          "type": "integer",
          "description": "Number of tasks assigned within the channel during the agent session.",
          "format": "int32"
        },
        "totalOfferedTasks": {
          "type": "integer",
          "description": "Number of offered tasks within this channel during the agent's session.",
          "format": "int32"
        },
        "totalAcceptedTasks": {
          "type": "integer",
          "description": "Number of assigned tasks that were accepted by the agent.",
          "format": "int32"
        },
        "totalRejectedTasks": {
          "type": "integer",
          "description": "Number of assigned tasks that were rejected by the agent.",
          "format": "int32"
        },
        "totalTransferredTasks": {
          "type": "integer",
          "description": "Number of tasks that the agent transferred to another agent.",
          "format": "int32"
        },
        "totalEngagedDuration": {
          "type": "integer",
          "description": "The amount of time the agent was engaged with a customer (in milliseconds).\nNote :-\n- Does not include wrap-up time and consult duration\n- Includes conferencing duration since the customer is involved",
          "format": "int32"
        },
        "totalHoldDuration": {
          "type": "integer",
          "description": "The amount of time for which the customer(s) was put on hold (in milliseconds).",
          "format": "int64"
        },
        "totalWrapUpDuration": {
          "type": "integer",
          "description": "The amount of time spent by the agent wrapping up customer interactions (in milliseconds).\ni.e Sum of all wrap-up time metric for a given agent",
          "format": "int64"
        },
        "totalAvailableTime": {
          "type": "integer",
          "description": "Duration of time(in milliseconds) outside of the idle time when an agent was available and handling contacts after logging in.",
          "format": "int64"
        },
        "totalUnAvailableTime": {
          "type": "integer",
          "description": "Amount of time the agent was unavailable (in milliseconds).",
          "format": "int64"
        },
        "averageHandledTime": {
          "type": "number",
          "description": "This is the average of the total handle time by an agent (in milliseconds)\ni.e avg(engagedDuration(connected state) + hold-duration  + wrap-up time)",
          "format": "double"
        }
      },
      "description": "Statistics for a specific channel."
    },
    "Meta": {
      "type": "object",
      "properties": {
        "orgId": {
          "type": "string",
          "description": "Organization ID to which resources belong."
        }
      },
      "description": "Response metadata."
    },
    "OutAgentStatistics": {
      "required": [
        "channels"
      ],
      "type": "object",
      "properties": {
        "intervalStartTime": {
          "type": "integer",
          "description": "Time in GMT",
          "format": "int64"
        },
        "agentId": {
          "type": "string",
          "description": "The ID of the agent."
        },
        "agentName": {
          "type": "string",
          "description": "The name of the agent"
        },
        "teamId": {
          "type": "string",
          "description": "The ID of the team."
        },
        "teamName": {
          "type": "string",
          "description": "Name of the team to which agent belongs."
        },
        "channels": {
          "type": "array",
          "description": "Channel-level statistics for the agent.",
          "items": {
            "$ref": "#/$defs/ChannelResponse"
          }
        }
      },
      "description": "List of Agent Statistics records retrieved according to query parameters."
    }
  }
}