Conversations

API methods for interacting with conversations and the associated analytics

List Conversations

All conversations

GET https://api.context.ai/api/v1/conversations

Fetches a list of all transcripts. If tenant_id is provided, fetches the conversations for the given tenant, otherwise fetches the conversations for the top level Context.ai account.

Query Parameters

Name
Type
Description

start_time

String

ISO-8601 timestamp indicating the start of when you would like to fetch conversations.

Defaults to 7 days ago.

end_time

String

ISO-8601 timestamp indicating the start of when you would like to fetch conversations.

Defaults to now.

tenant_id

String

The tenant_id for which you would like to fetch conversations.

{
  "count": 1,
  "conversations": [
    {
      "metadata": {
        "id": "pzbGrCEWgKi99HHnwWxUi",
        "metadata": {
          "model": "gpt-3.5-turbo",
          "user_id": 3242
        },
        "sentiment_trend": "up|flat|down",
        "topics": [
          {
            "id": "w4AnzB9iENa1_AVfWI3sr",
            "name": "football shoes",
          }
        ],
        "suggested_topics": [
          {
            "id": "QOAwUCRhhlpmDCH534lBu",
            "name": "opening hours",
          }
        ],
        "messages": [
          {
            "type": "message",
            "event_timestamp": "2022-09-27 18:00:00.000",
            "role": "system|assistant|user",
            "message": "hola mundo!",
            "rating": -1,
            "language": "es",
            "translation": "hello world!",
            "sentiment": 0.2,
            "topics": {
              "name": "football shoes",
              "id": "w4AnzB9iENa1_AVfWI3sr",
            },
            "suggested_topics": {
              "id": "QOAwUCRhhlpmDCH534lBu",
              "name": "opening hours",
            }
          }
        }
      ]
    }
  ]
}

Get Conversation

Get a conversation

GET https://api.context.ai/api/v1/conversations/:id

Fetches a single transcript by its ID. If tenant_id is provided, uses the permissions of the provided tenant, otherwise fetches the conversations for the top level Context.ai account.

Path Parameters

Name
Type
Description

id

String

Conversation ID to fetch.

Query Parameters

Name
Type
Description

start_time

String

ISO-8601 timestamp indicating the start of when you would like to fetch conversations.

Defaults to 7 days ago.

end_time

String

ISO-8601 timestamp indicating the start of when you would like to fetch conversations.

Defaults to now.

tenant_id

String

The tenant_id for which you would like to fetch conversations.

If tenant_id is passed, the conversation must be associated to the given tenant, else a permissions exception will be raised.

page

Integer

Page number of results to return. Defaults to 1.

per_page

Integer

Number of results to return per page. Defaults to 20.

{
  "conversation": {
    "metadata": {
      "id": "pzbGrCEWgKi99HHnwWxUi",
      "metadata": {
       "model": "gpt-3.5-turbo",
        "user_id": 3242
      },
      "sentiment_trend": "up|flat|down",
      "topics": [
        {
          "id": "w4AnzB9iENa1_AVfWI3sr",
          "name": "football shoes",
        }
      ],
      "suggested_topics": [
        {
          "id": "QOAwUCRhhlpmDCH534lBu",
          "name": "opening hours",
        }
      ],
      "messages": [
        {
          "type": "message",
          "event_timestamp": "2022-09-27 18:00:00.000",
          "role": "system|assistant|user",
          "message": "hola mundo!",
          "rating": -1,
          "language": "es",
          "translation": "hello world!",
          "sentiment": 0.2,
          "topics": {
            "name": "football shoes",
            "id": "w4AnzB9iENa1_AVfWI3sr",
          },
          "suggested_topics": {
            "id": "QOAwUCRhhlpmDCH534lBu",
            "name": "opening hours",
          }
        }
      ]
    }
  }

Last updated