> ## Documentation Index
> Fetch the complete documentation index at: https://docs.operata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a contact summary (v2)

> Fetch the v2 summary for one contact, with account, contact, agent, WebRTC session, headset, billing, and insights objects.

Returns the v2 summary for one contact. It has the same objects as [List contact summaries (v2)](https://docs.operata.com/docs/api-v2-contact-summary.md), plus `insights` when Operata recorded any for the contact. For the v1 format, use [Get a contact summary](https://docs.operata.com/docs/api-call-summary.md).

## Endpoint

```http theme={null}
GET https://api.operata.io/v2/data/calls/{contactId}
```

## Parameters

### Path

| Name | Type | Required | Description |
| - | - | - | - |
| `contactId` | string | yes | Amazon Connect contact ID. |

## Response

`200 OK` with one JSON object.

```json theme={null}
{
  "accountProperties": {
    "service": "Amazon Connect",
    "serviceAccountNumber": "123456789012",
    "serviceInstanceId": "205474d3-428f-4473-82e3-4f80580ef5b9",
    "region": "ap-southeast-2",
    "operataGroupId": "0841f5f7-e9c0-4454-8cb3-0eb3230e899b"
  },
  "contact": {
    "id": {
      "current": "e5c6ca6a-a061-42e8-989d-a06d7cb09cbb",
      "previous": "",
      "next": "",
      "initial": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    },
    "systemEndpoint": "+61255500100",
    "durationSec": 11,
    "type": "VOICE",
    "direction": "Inbound",
    "initiation": "INBOUND",
    "events": {
      "enqueued": "2021-06-28T09:26:30Z",
      "incomingToPlatform": "2021-06-28T09:26:29Z",
      "connectingToAgent": "2021-06-28T09:26:30.807Z",
      "connectedToAgent": "2021-06-28T09:26:31Z",
      "disconnected": "2021-06-28T09:26:40Z"
    },
    "endedBy": "Customer",
    "disconnectReason": "CUSTOMER_DISCONNECT"
  },
  "serviceAgent": {
    "username": "agent_42",
    "serviceId": "1d6a6efa-cd42-469e-8846-af01255a03d8",
    "machine": {
      "cpu": {
        "modelName": "Intel Pentium 3.0",
        "idlePercentage": {
          "avg": 96.4
        },
        "utilisedPercentage": {
          "min": 3.4,
          "max": 3.7,
          "avg": 3.6
        }
      },
      "memory": {
        "availableGb": 32,
        "utilisedPercentage": {
          "min": 93.4,
          "max": 96.5,
          "avg": 94.4
        }
      }
    },
    "network": {
      "internetGatewayIp": "203.0.113.24",
      "mediaIpAddress": "e35e8a3b-2c57-4b28-8a1c-3946bdcd697f.local",
      "type": "wildcard",
      "availableInterfaces": [
        {
          "address": "e35e8a3b-2c57-4b28-8a1c-3946bdcd697f.local",
          "type": ""
        }
      ],
      "isp": "Google LLC",
      "geolocation": {
        "city": "Sydney",
        "region": "New South Wales",
        "country": "Australia"
      },
      "agentIpAddress": "",
      "agentIsp": ""
    },
    "browser": {
      "name": "Chrome",
      "version": "88.0.4298.0"
    },
    "softphone": {
      "softphoneUrl": "https://example.my.connect.aws/ccp-v2",
      "operataCollectorVersion": "v1.0.22",
      "connectStreamsVersion": "1.5.0"
    },
    "interaction": {
      "totalDurationSec": 9,
      "onHoldDurationSec": 0,
      "talkingDurationSec": 9,
      "onMuteDurationSec": 0
    }
  },
  "webRTCSession": {
    "metrics": {
      "inbound": {
        "packetsReceived": 331,
        "packetsLost": 0,
        "packetsLostPercentage": 0,
        "bytesReceived": 31401,
        "audioLevel": {
          "max": 13889,
          "avg": 3168
        },
        "jitterBufferMils": {
          "min": 0,
          "max": 0,
          "avg": 0
        }
      },
      "outbound": {
        "packetsSent": 445,
        "packetsLost": 0,
        "packetsLostPercentage": 0,
        "bytesSent": 15052,
        "audioLevel": {
          "max": 5709,
          "avg": 1064.75
        },
        "jitterBufferMils": {
          "min": 8,
          "max": 40,
          "avg": 24.13
        }
      },
      "rtt": {
        "max": 32,
        "avg": 29
      },
      "jitter": {
        "max": 3,
        "avg": 2
      },
      "mos": {
        "min": 3.48,
        "max": 4.43,
        "avg": 4.31
      }
    },
    "serviceEndpoint": {
      "fqdn": "wss://tufsuyburufn.transport.connect.ap-southeast-2.amazonaws.com/?[redacted]",
      "transportLifeTimeSeconds": 3942,
      "expiry": "2021-06-28T10:32:03.922Z"
    },
    "mediaEndpoint": {
      "fqdn": "turnnlb-93f2de0c97c4316b.elb.ap-southeast-2.amazonaws.com.",
      "destinationPort": "3478",
      "sourcePort": "55662",
      "transport": "udp",
      "privateIp": "10.4.3.192"
    },
    "signallingEndpoint": {
      "fqdn": "wss://rtc.connect-telecom.ap-southeast-2.amazonaws.com/LilyRTC"
    },
    "eventTimer": {
      "gumTimeMillis": 0,
      "initializationTimeMillis": 0,
      "iceCollectionTimeMillis": 0,
      "signallingConnectTimeMillis": 0,
      "handshakingTimeMillis": 0,
      "preTalkingTimeMillis": 0,
      "cleanupTimeMillis": 0
    },
    "eventFailure": {
      "iceCollectionFailure": false,
      "signallingConnectionFailure": false,
      "handshakingFailure": false,
      "gumOtherFailure": false,
      "gumTimeoutFailure": false,
      "createOfferFailure": false,
      "setLocalDescriptionFailure": false,
      "userBusyFailure": false,
      "invalidRemoteSDPFailure": false,
      "noRemoteIceCandidateFailure": false,
      "setRemoteDescriptionFailure": false
    }
  },
  "headset": {
    "modelName": "Jabra Link 380",
    "firmwareVersion": "1234ABCD",
    "serialNumber": "ABCD1234",
    "apiVersion": "3.0.0-beta.4",
    "metrics": {
      "speech": {
        "crossTalkTotal": 0,
        "crossTalkTotalPct": 0,
        "rxSpeechTotal": 0,
        "rxSpeechTotalPct": 0,
        "silenceTotal": 12.07,
        "silenceTotalPct": 100,
        "totalSeconds": 12.07,
        "txSpeechTotal": 0,
        "txSpeechTotalPct": 0
      },
      "exposureDb": {
        "min": 62,
        "max": 71,
        "avg": 66
      },
      "backgroundNoiseDb": {
        "min": 1,
        "max": 20,
        "avg": 2
      },
      "misalignedBoomArmCount": 3,
      "deviceMuteCount": 0,
      "deviceVolumeAdjustCount": 0
    }
  },
  "billing": {
    "durationRoundedMin": 1
  }
}
```

The response has every field described in [List contact summaries (v2)](https://docs.operata.com/docs/api-v2-contact-summary.md#response), plus this one:

| Field | Type | Description |
| - | - | - |
| `insights` | object | `count` of insights and their `tags`, each with `pattern`, `description`, and `type`. See [Insights](https://docs.operata.com/docs/insights.md). Omitted when the contact has none. |

## Example

```bash curl theme={null}
curl -u "$OPERATA_GROUP_ID:$OPERATA_API_TOKEN" \
  "https://api.operata.io/v2/data/calls/e5c6ca6a-a061-42e8-989d-a06d7cb09cbb"
```

```javascript Node.js theme={null}
const groupId = process.env.OPERATA_GROUP_ID;
const apiToken = process.env.OPERATA_API_TOKEN;
const auth = Buffer.from(`${groupId}:${apiToken}`).toString("base64");

const contactId = "e5c6ca6a-a061-42e8-989d-a06d7cb09cbb";
const response = await fetch(`https://api.operata.io/v2/data/calls/${contactId}`, {
  headers: { Authorization: `Basic ${auth}` },
});
const summary = await response.json();
```

```python Python theme={null}
import os, requests

contact_id = "e5c6ca6a-a061-42e8-989d-a06d7cb09cbb"
response = requests.get(
    f"https://api.operata.io/v2/data/calls/{contact_id}",
    auth=(os.environ["OPERATA_GROUP_ID"], os.environ["OPERATA_API_TOKEN"]),
)
response.raise_for_status()
summary = response.json()
```

## Errors

Error bodies are plain text.

| Status | Body | When | Recover |
| - | - | - | - |
| 401 | An HTML `401 Authorization Required` page | Credentials are missing or wrong. | See [Authentication](https://docs.operata.com/docs/api-authentication.md). |
| 404 | `Call Summary record could not be found` | Your Operata Group has no summary for this contact ID. | Check the ID with [List contact summaries (v2)](https://docs.operata.com/docs/api-v2-contact-summary.md). |
| 422 | `An error occurred while retrieving call stats log` | OpenSearch rejected or failed the lookup. | Retry later. Contact support if it persists. |

See [Errors](https://docs.operata.com/docs/api-errors.md) for errors every endpoint can return.

## Related

* [List contact summaries (v2)](https://docs.operata.com/docs/api-v2-contact-summary.md): find contact IDs in a time window.
* [Get detailed contact stats (v2)](https://docs.operata.com/docs/api-v2-contact-stats.md): per-second metrics for the same contact.
* [Get a contact summary](https://docs.operata.com/docs/api-call-summary.md): the same contact in the v1 format.


## OpenAPI

````yaml GET /v2/data/calls/{contactId}
openapi: 3.0.3
info:
  title: operata-api
  version: '1'
servers:
  - url: https://api.operata.io/
security:
  - sec0: []
paths:
  /v2/data/calls/{contactId}:
    get:
      summary: Get Contact Summary (v2)
      description: Returns the v2 summary for one contact, including insights when present.
      operationId: call-summary-v2
      parameters:
        - name: contactId
          in: path
          required: true
          description: Amazon Connect contact ID.
          schema:
            type: string
      responses:
        '200':
          description: The contact summary.
          content:
            application/json:
              schema:
                type: object
                properties:
                  accountProperties:
                    type: object
                    properties:
                      service:
                        type: string
                      serviceAccountNumber:
                        type: string
                      serviceInstanceId:
                        type: string
                      region:
                        type: string
                      operataGroupId:
                        type: string
                  contact:
                    type: object
                    properties:
                      id:
                        type: object
                        properties:
                          current:
                            type: string
                          previous:
                            type: string
                          next:
                            type: string
                          initial:
                            type: string
                      systemEndpoint:
                        type: string
                      durationSec:
                        type: integer
                      type:
                        type: string
                      direction:
                        type: string
                      initiation:
                        type: string
                      events:
                        type: object
                        properties:
                          enqueued:
                            type: string
                          incomingToPlatform:
                            type: string
                          connectingToAgent:
                            type: string
                          connectedToAgent:
                            type: string
                          disconnected:
                            type: string
                      endedBy:
                        type: string
                      disconnectReason:
                        type: string
                  serviceAgent:
                    type: object
                    properties:
                      username:
                        type: string
                      serviceId:
                        type: string
                      machine:
                        type: object
                        properties:
                          cpu:
                            type: object
                            properties:
                              modelName:
                                type: string
                              idlePercentage:
                                type: object
                                properties:
                                  avg:
                                    type: number
                              utilisedPercentage:
                                type: object
                                properties:
                                  min:
                                    type: number
                                  avg:
                                    type: number
                                  max:
                                    type: number
                          memory:
                            type: object
                            properties:
                              availableGb:
                                type: number
                              utilisedPercentage:
                                type: object
                                properties:
                                  min:
                                    type: number
                                  avg:
                                    type: number
                                  max:
                                    type: number
                      network:
                        type: object
                        properties:
                          internetGatewayIp:
                            type: string
                          mediaIpAddress:
                            type: string
                          type:
                            type: string
                          availableInterfaces:
                            type: array
                            items:
                              type: object
                              properties:
                                address:
                                  type: string
                                type:
                                  type: string
                          isp:
                            type: string
                          geolocation:
                            type: object
                            properties:
                              city:
                                type: string
                              region:
                                type: string
                              country:
                                type: string
                          agentIpAddress:
                            type: string
                          agentIsp:
                            type: string
                      browser:
                        type: object
                        properties:
                          name:
                            type: string
                          version:
                            type: string
                      softphone:
                        type: object
                        properties:
                          softphoneUrl:
                            type: string
                          operataCollectorVersion:
                            type: string
                          connectStreamsVersion:
                            type: string
                      interaction:
                        type: object
                        properties:
                          totalDurationSec:
                            type: integer
                          onHoldDurationSec:
                            type: integer
                          talkingDurationSec:
                            type: integer
                          onMuteDurationSec:
                            type: integer
                  webRTCSession:
                    type: object
                    properties:
                      metrics:
                        type: object
                        properties:
                          inbound:
                            type: object
                            properties:
                              packetsReceived:
                                type: integer
                              packetsLost:
                                type: integer
                              packetsLostPercentage:
                                type: number
                              bytesReceived:
                                type: integer
                              audioLevel:
                                type: object
                                properties:
                                  max:
                                    type: number
                                  avg:
                                    type: number
                              jitterBufferMils:
                                type: object
                                properties:
                                  min:
                                    type: number
                                  avg:
                                    type: number
                                  max:
                                    type: number
                          outbound:
                            type: object
                            properties:
                              packetsSent:
                                type: integer
                              packetsLost:
                                type: integer
                              packetsLostPercentage:
                                type: number
                              bytesSent:
                                type: integer
                              audioLevel:
                                type: object
                                properties:
                                  max:
                                    type: number
                                  avg:
                                    type: number
                              jitterBufferMils:
                                type: object
                                properties:
                                  min:
                                    type: number
                                  avg:
                                    type: number
                                  max:
                                    type: number
                          rtt:
                            type: object
                            properties:
                              max:
                                type: number
                              avg:
                                type: number
                          jitter:
                            type: object
                            properties:
                              max:
                                type: number
                              avg:
                                type: number
                          mos:
                            type: object
                            properties:
                              min:
                                type: number
                              avg:
                                type: number
                              max:
                                type: number
                      serviceEndpoint:
                        type: object
                        properties:
                          fqdn:
                            type: string
                          transportLifeTimeSeconds:
                            type: integer
                          expiry:
                            type: string
                      mediaEndpoint:
                        type: object
                        properties:
                          fqdn:
                            type: string
                          destinationPort:
                            type: string
                          sourcePort:
                            type: string
                          transport:
                            type: string
                          privateIp:
                            type: string
                      signallingEndpoint:
                        type: object
                        properties:
                          fqdn:
                            type: string
                      eventTimer:
                        type: object
                        properties:
                          gumTimeMillis:
                            type: integer
                          initializationTimeMillis:
                            type: integer
                          iceCollectionTimeMillis:
                            type: integer
                          signallingConnectTimeMillis:
                            type: integer
                          handshakingTimeMillis:
                            type: integer
                          preTalkingTimeMillis:
                            type: integer
                          cleanupTimeMillis:
                            type: integer
                      eventFailure:
                        type: object
                        properties:
                          iceCollectionFailure:
                            type: boolean
                          signallingConnectionFailure:
                            type: boolean
                          handshakingFailure:
                            type: boolean
                          gumOtherFailure:
                            type: boolean
                          gumTimeoutFailure:
                            type: boolean
                          createOfferFailure:
                            type: boolean
                          setLocalDescriptionFailure:
                            type: boolean
                          userBusyFailure:
                            type: boolean
                          invalidRemoteSDPFailure:
                            type: boolean
                          noRemoteIceCandidateFailure:
                            type: boolean
                          setRemoteDescriptionFailure:
                            type: boolean
                  headset:
                    type: object
                    properties:
                      modelName:
                        type: string
                      firmwareVersion:
                        type: string
                      serialNumber:
                        type: string
                      apiVersion:
                        type: string
                      metrics:
                        type: object
                        properties:
                          speech:
                            type: object
                            properties:
                              crossTalkTotal:
                                type: number
                              crossTalkTotalPct:
                                type: number
                              rxSpeechTotal:
                                type: number
                              rxSpeechTotalPct:
                                type: number
                              silenceTotal:
                                type: number
                              silenceTotalPct:
                                type: number
                              totalSeconds:
                                type: number
                              txSpeechTotal:
                                type: number
                              txSpeechTotalPct:
                                type: number
                          exposureDb:
                            type: object
                            properties:
                              min:
                                type: number
                              avg:
                                type: number
                              max:
                                type: number
                          backgroundNoiseDb:
                            type: object
                            properties:
                              min:
                                type: number
                              avg:
                                type: number
                              max:
                                type: number
                          misalignedBoomArmCount:
                            type: integer
                          deviceMuteCount:
                            type: integer
                          deviceVolumeAdjustCount:
                            type: integer
                  billing:
                    type: object
                    properties:
                      durationRoundedMin:
                        type: integer
                  insights:
                    type: object
                    properties:
                      count:
                        type: integer
                      tags:
                        type: array
                        items:
                          type: object
                          properties:
                            pattern:
                              type: string
                            description:
                              type: string
                            type:
                              type: string
              example:
                accountProperties:
                  service: Amazon Connect
                  serviceAccountNumber: '123456789012'
                  serviceInstanceId: 205474d3-428f-4473-82e3-4f80580ef5b9
                  region: ap-southeast-2
                  operataGroupId: 0841f5f7-e9c0-4454-8cb3-0eb3230e899b
                contact:
                  id:
                    current: e5c6ca6a-a061-42e8-989d-a06d7cb09cbb
                    previous: ''
                    next: ''
                    initial: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  systemEndpoint: '+61255500100'
                  durationSec: 11
                  type: VOICE
                  direction: Inbound
                  initiation: INBOUND
                  events:
                    enqueued: '2021-06-28T09:26:30Z'
                    incomingToPlatform: '2021-06-28T09:26:29Z'
                    connectingToAgent: '2021-06-28T09:26:30.807Z'
                    connectedToAgent: '2021-06-28T09:26:31Z'
                    disconnected: '2021-06-28T09:26:40Z'
                  endedBy: Customer
                  disconnectReason: CUSTOMER_DISCONNECT
                serviceAgent:
                  username: agent_42
                  serviceId: 1d6a6efa-cd42-469e-8846-af01255a03d8
                  machine:
                    cpu:
                      modelName: Intel Pentium 3.0
                      idlePercentage:
                        avg: 96.4
                      utilisedPercentage:
                        min: 3.4
                        max: 3.7
                        avg: 3.6
                    memory:
                      availableGb: 32
                      utilisedPercentage:
                        min: 93.4
                        max: 96.5
                        avg: 94.4
                  network:
                    internetGatewayIp: 203.0.113.24
                    mediaIpAddress: e35e8a3b-2c57-4b28-8a1c-3946bdcd697f.local
                    type: wildcard
                    availableInterfaces:
                      - address: e35e8a3b-2c57-4b28-8a1c-3946bdcd697f.local
                        type: ''
                    isp: Google LLC
                    geolocation:
                      city: Sydney
                      region: New South Wales
                      country: Australia
                    agentIpAddress: ''
                    agentIsp: ''
                  browser:
                    name: Chrome
                    version: 88.0.4298.0
                  softphone:
                    softphoneUrl: https://example.my.connect.aws/ccp-v2
                    operataCollectorVersion: v1.0.22
                    connectStreamsVersion: 1.5.0
                  interaction:
                    totalDurationSec: 9
                    onHoldDurationSec: 0
                    talkingDurationSec: 9
                    onMuteDurationSec: 0
                webRTCSession:
                  metrics:
                    inbound:
                      packetsReceived: 331
                      packetsLost: 0
                      packetsLostPercentage: 0
                      bytesReceived: 31401
                      audioLevel:
                        max: 13889
                        avg: 3168
                      jitterBufferMils:
                        min: 0
                        max: 0
                        avg: 0
                    outbound:
                      packetsSent: 445
                      packetsLost: 0
                      packetsLostPercentage: 0
                      bytesSent: 15052
                      audioLevel:
                        max: 5709
                        avg: 1064.75
                      jitterBufferMils:
                        min: 8
                        max: 40
                        avg: 24.13
                    rtt:
                      max: 32
                      avg: 29
                    jitter:
                      max: 3
                      avg: 2
                    mos:
                      min: 3.48
                      max: 4.43
                      avg: 4.31
                  serviceEndpoint:
                    fqdn: >-
                      wss://tufsuyburufn.transport.connect.ap-southeast-2.amazonaws.com/?[redacted]
                    transportLifeTimeSeconds: 3942
                    expiry: '2021-06-28T10:32:03.922Z'
                  mediaEndpoint:
                    fqdn: turnnlb-93f2de0c97c4316b.elb.ap-southeast-2.amazonaws.com.
                    destinationPort: '3478'
                    sourcePort: '55662'
                    transport: udp
                    privateIp: 10.4.3.192
                  signallingEndpoint:
                    fqdn: >-
                      wss://rtc.connect-telecom.ap-southeast-2.amazonaws.com/LilyRTC
                  eventTimer:
                    gumTimeMillis: 0
                    initializationTimeMillis: 0
                    iceCollectionTimeMillis: 0
                    signallingConnectTimeMillis: 0
                    handshakingTimeMillis: 0
                    preTalkingTimeMillis: 0
                    cleanupTimeMillis: 0
                  eventFailure:
                    iceCollectionFailure: false
                    signallingConnectionFailure: false
                    handshakingFailure: false
                    gumOtherFailure: false
                    gumTimeoutFailure: false
                    createOfferFailure: false
                    setLocalDescriptionFailure: false
                    userBusyFailure: false
                    invalidRemoteSDPFailure: false
                    noRemoteIceCandidateFailure: false
                    setRemoteDescriptionFailure: false
                headset:
                  modelName: Jabra Link 380
                  firmwareVersion: 1234ABCD
                  serialNumber: ABCD1234
                  apiVersion: 3.0.0-beta.4
                  metrics:
                    speech:
                      crossTalkTotal: 0
                      crossTalkTotalPct: 0
                      rxSpeechTotal: 0
                      rxSpeechTotalPct: 0
                      silenceTotal: 12.07
                      silenceTotalPct: 100
                      totalSeconds: 12.07
                      txSpeechTotal: 0
                      txSpeechTotalPct: 0
                    exposureDb:
                      min: 62
                      max: 71
                      avg: 66
                    backgroundNoiseDb:
                      min: 1
                      max: 20
                      avg: 2
                    misalignedBoomArmCount: 3
                    deviceMuteCount: 0
                    deviceVolumeAdjustCount: 0
                billing:
                  durationRoundedMin: 1
        '401':
          description: >-
            Missing or invalid credentials. The gateway returns an HTML `401
            Authorization Required` page.
          content:
            text/html:
              schema:
                type: string
        '404':
          description: >-
            No summary exists for this contact ID: `Call Summary record could
            not be found`.
          content:
            text/plain:
              schema:
                type: string
        '422':
          description: OpenSearch rejected or failed the lookup.
          content:
            text/plain:
              schema:
                type: string
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````

## Related topics

- [List contact summaries (v2)](https://docs.operata.com/docs/api-v2-contact-summary.md)
- [Get detailed contact stats (v2)](https://docs.operata.com/docs/api-v2-contact-stats.md)
- [Signals and observations](https://docs.operata.com/docs/concepts-signals-and-observations.md)
