Conversation Service

Our Conversation Service API comprehensively manages the entire lifecycle of conversations—enabling creation, updates (audio persistence, display name, language, sharing, skill, state, and metadata), retrieval, redaction or deletion of messages, tagging, event logging, batch operations, and final closure—providing robust end-to-end conversation management.

Languages
Servers
https://{api-domain}.cresta.com/

ConversationService

Operations

Samples Conversation Ids

Request

Samples conversation ids (using consistent hashing) from a given profile in order to, e.g., create training data for AI services. Notes:

  • The sample is deterministic (pseudorandom with a fixed seed dependent on the input request).
Path
parentstringrequired

Profile to sample conversations from.

Format: customers/{customer_id}/profiles/{profile_id}

Bodyapplication/jsonrequired
pageSizeinteger(int32)

The maximum number of conversation id to return in one page. If unspecified, at most 10000 conversations will be returned.

pageTokenstring

A page token, received from a previous SampleConversations call. Provide this to retrieve the subsequent page.

filterobject(SampleConversationsRequestFilter)

Filters for sampling.

samplingMethodstring(SampleConversationsRequestSamplingMethod)

Sampling method.

  • SAMPLING_METHOD_UNSPECIFIED: Unspecified sampling method. Defaults to UNIFORM.
  • UNIFORM: Uniform sampling across conversations. Note that if you specify max_messages in the filter this still indirectly depends on the length of the conversation.
Default "SAMPLING_METHOD_UNSPECIFIED"
Enum"SAMPLING_METHOD_UNSPECIFIED""UNIFORM"
disableMessageCountsboolean

Whether to disable counting the # of messages. Without counting messages, sampling is much much faster.

curl -i -X POST \
  'https://{api-domain}.cresta.com/v1/{parent=customers/*/profiles/*}/conversations:sample' \
  -H 'Content-Type: application/json' \
  -d '{
    "pageSize": 0,
    "pageToken": "string",
    "filter": {
      "startTime": "2019-08-24T14:15:22Z",
      "endTime": "2019-08-24T14:15:22Z",
      "maxConversationRatio": 0.1,
      "maxConversations": "string",
      "maxMessages": "string"
    },
    "samplingMethod": "SAMPLING_METHOD_UNSPECIFIED",
    "disableMessageCounts": true
  }'

Responses

A successful response.

Bodyapplication/json
sampledConversationsArray of objects(SampleConversationsResponseSampledConversation)

All sampled conversations ordered by start_time.

nextPageTokenstring

Token that is used to retrieve the next page.

parentstring

Profile that conversations were sampled from.

Format: customers/{customer_id}/profiles/{profile_id}

pageStartTimestring(date-time)required

Start time of this page (inclusive), i.e., start time of the base set of conversations that was sampled from.

pageEndTimestring(date-time)required

End time of this page (exclusive), i.e., end time of the base set of conversations that was sampled from.

pageConversationCountinteger(int32)

Total base set of conversations that were sampled from for this page.

Response
application/json
{ "sampledConversations": [ {} ], "nextPageToken": "string", "parent": "string", "pageStartTime": "2019-08-24T14:15:22Z", "pageEndTime": "2019-08-24T14:15:22Z", "pageConversationCount": 0 }

ListSuggestionUsage

Request

ListSuggestionUsage lists SuggestionUsage for a customer profile.

Path
parentstringrequired

Resource name of the parent.

Format: customers/{customer_id}/profiles/{profile_id}

Bodyapplication/jsonrequired
pageSizeinteger(int32)

The maximum number of SuggestionUsages to return. If unspecified, at most 50 SuggestionUsages will be returned.

pageTokenstring

A page token, received from a previous ListSuggestionUsages call. Provide this to retrieve the subsequent page.

filterobject(conversationSuggestionUsageFilter)

Filter for ListSuggestionUsageRequest Within a filter field, repeated conditions are OR. Between different filter fields, conditions are AND.

curl -i -X POST \
  'https://{api-domain}.cresta.com/v1/{parent=customers/*/profiles/*}/conversations:suggestionUsages' \
  -H 'Content-Type: application/json' \
  -d '{
    "pageSize": 0,
    "pageToken": "string",
    "filter": {
      "rangeStartTime": "2019-08-24T14:15:22Z",
      "rangeEndTime": "2019-08-24T14:15:22Z",
      "usersOrTeamsUsers": [
        "string"
      ],
      "usersOrTeamsTeams": [
        "string"
      ],
      "messageKeyword": "string",
      "usersOrGroupsUsers": [
        "string"
      ],
      "usersOrGroupsGroups": [
        "string"
      ]
    }
  }'

Responses

A successful response.

Bodyapplication/json
suggestionUsagesArray of objects(conversationSuggestionUsage)read-only

The returned SuggestionUsage.

nextPageTokenstring

Token is used to retrieve the next page.

Response
application/json
{ "suggestionUsages": [ {} ], "nextPageToken": "string" }