Context.ai
  • What is Context.ai?
  • List of Trackable Metrics
  • Product Analytics
    • Overview
    • Topic Categorisation
      • LLM Topics
    • User Engagement Tracking
    • Foreign Language Support
    • PII Filtering
    • Custom Metadata Filtering
    • Backfill Analytics Data
    • Custom Events
    • API Ingestion Methods
      • Log Conversation
      • [deprecated] Upsert Conversation
      • Thread Conversation
      • Patch Thread Message
      • API Resources
        • Chat Message
        • [deprecated] Tool Message
        • Custom Event
        • Metadata
        • Conversation
        • Thread
    • Embedded API
      • Multi-Tenancy
      • Conversations
        • Series Data
  • Integrations
    • Getting Started
    • Python SDK
    • Javascript SDK
    • LangChain Plugin
    • Haystack Plugin
    • Authorization
Powered by GitBook
On this page
  • List Conversations
  • All conversations
  • Get Conversation
  • Get a conversation

Was this helpful?

  1. Product Analytics
  2. Embedded API

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",
          }
        }
      ]
    }
  }

PreviousMulti-TenancyNextSeries Data

Last updated 1 year ago

Was this helpful?