openapi: 3.0.3 info: title: Chatlayer Analytics version: 1.0.0 license: name: MIT url: "https://www.sinch.com/toc" contact: name: Support url: www.sinch.com email: "support@sinch.com" servers: - url: https://analytics.api.chatlayer.ai description: Europe - url: https://analytics.api.prod.us-east4.gcp.chatlayer.ai description: US - url: https://analytics.api.prod.asia-south1.gcp.chatlayer.ai description: APAC security: - bearerAuth: [] paths: /v1/bots/{bot_id}/{version}/flows/{step_id}/edges: get: operationId: Analytics_GetFlowStepEdges responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/GetFlowStepEdgesResponse" parameters: - name: bot_id description: Identifies the bot. in: path required: true schema: type: string - name: version description: Identifies the bot version. in: path required: true schema: type: string - name: step_id description: Filter by specific step in the flow identified by dialogstate id in: path required: true schema: type: string - name: start_time description: The starting date for the time range of the data series. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the data series, exclusive. in: query required: true schema: type: string - name: channel_type description: Filter by specific channels, multiple values separated by comma. in: query required: false schema: type: string - name: language description: Filter by specific languages, multiple values separated by comma. in: query required: false schema: type: string - name: type description: The edge to return, one of 'sources' or 'targets' in: query required: true schema: type: string tags: - Flows /v1/bots/{bot_id}/conversations: get: summary: Get conversation analytics operationId: Analytics_GetConversations responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/GetConversationsResponse" parameters: - name: bot_id description: Identifies the bot. in: path required: true schema: type: string - name: version description: Identifies the bot version. in: query required: true schema: type: string - name: start_time description: The starting date for the time range of the data series. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the data series, exclusive. in: query required: true schema: type: string - name: channel_type description: Filter by specific channels, multiple values separated by comma. in: query required: false schema: type: string - name: language description: Filter by specific languages, multiple values separated by comma. in: query required: false schema: type: string - name: bucket description: |- Time interval in which results will be grouped. Supported values are 1h,1d,1w. The interval should be smaller than the range specified in the [start_time,end_time) in: query required: false schema: type: string - name: group_by description: Group by a specific category. Can be channel_type or language in: query required: false schema: type: string tags: - Conversations /v1/bots/{bot_id}/conversations/insights: get: operationId: Analytics_GetConversationsInsights responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/GetConversationsInsightsResponse" parameters: - name: bot_id description: Identifies the bot. in: path required: true schema: type: string - name: version description: Identifies the bot version. in: query required: true schema: type: string - name: start_time description: The starting date for the time range of the data series. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the data series, exclusive. in: query required: true schema: type: string - name: channel_type description: Filter by specific channels, multiple values separated by comma. in: query required: false schema: type: string - name: language description: Filter by specific languages, multiple values separated by comma. in: query required: false schema: type: string - name: stat description: The stat to return, one of 'num_conversations', 'duration_seconds', 'num_messages' in: query required: true schema: type: string tags: - Conversations /v1/bots/{bot_id}/events/definitions: get: operationId: Analytics_ListEventDefinitions responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/ListEventDefinitionsResponse" parameters: - name: bot_id in: path required: true schema: type: string - name: page_token in: query required: false schema: type: string - name: page_size in: query required: false schema: type: integer format: int32 tags: - Events post: operationId: Analytics_CreateEventDefinition requestBody: content: application/json: schema: type: object properties: event: type: string description: type: string responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/CreateEventDefinitionResponse" parameters: - name: bot_id in: path required: true schema: type: string tags: - Events /v1/bots/{bot_id}/events/stream: get: operationId: Analytics_ListEvents responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/ListEventsResponse" parameters: - name: bot_id description: The ID of the bot in: path required: true schema: type: string - name: version description: The version of the bot (either DRAFT or LIVE) in: query required: true schema: type: string - name: page_size description: |- The maximum number of events to return. The service may return fewer than this value. The maximum value allowed is 100; value above 100 will be coerced to 100. in: query required: false schema: type: integer format: int32 - name: page_token description: |- A page token, received from a previous ListEvent call. Provide this to retrieve a subsequent page. in: query required: false schema: type: string - name: start_time description: The starting date for the time range of the events, inclusive. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the events, exclusive. in: query required: true schema: type: string tags: - Events /v1/bots/{bot_id}/flows: get: operationId: Analytics_GetFlows responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/GetFlowsResponse" parameters: - name: bot_id description: Identifies the bot. in: path required: true schema: type: string - name: version description: Identifies the bot version. in: query required: true schema: type: string - name: start_time description: The starting date for the time range of the data series. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the data series, exclusive. in: query required: true schema: type: string - name: channel_type description: Filter by specific channels, multiple values separated by comma. in: query required: false schema: type: string - name: language description: Filter by specific languages, multiple values separated by comma. in: query required: false schema: type: string - name: path description: |- Filter by specific path, multiple values with each value specifying the nodes in that path. eg. path[0]=somepath&path[1]=someOtherPath or path=somepath&path=someOtherPath in: query required: false schema: type: array items: type: string tags: - Flows /v1/bots/{bot_id}/flows/{step_id}: get: operationId: Analytics_GetFlowStepDetails responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/GetFlowStepDetailsResponse" parameters: - name: bot_id description: Identifies the bot. in: path required: true schema: type: string - name: step_id description: Filter by specific step in the flow identified by dialogstate id in: path required: true schema: type: string - name: version description: Identifies the bot version. in: query required: true schema: type: string - name: start_time description: The starting date for the time range of the data series. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the data series, exclusive. in: query required: true schema: type: string - name: channel_type description: Filter by specific channels, multiple values separated by comma. in: query required: false schema: type: string - name: language description: Filter by specific languages, multiple values separated by comma. in: query required: false schema: type: string tags: - Flows /v1/bots/{bot_id}/intents: get: summary: Get most used intents operationId: Analytics_GetIntents responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/GetIntentsResponse" parameters: - name: bot_id description: Identifies the bot. in: path required: true schema: type: string - name: version description: Identifies the bot version. in: query required: true schema: type: string - name: start_time description: The starting date for the time range of the data series. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the data series, exclusive. in: query required: true schema: type: string - name: channel_type description: Filter by specific channels, multiple values separated by comma. in: query required: false schema: type: string - name: language description: Filter by specific languages, multiple values separated by comma. in: query required: false schema: type: string - name: bucket description: |- Time interval in which results will be grouped. Supported values are 1h,1d,1w. The interval should be smaller than the range specified in the [start_time,end_time) in: query required: false schema: type: string - name: after description: Pagination cursor in: query required: false schema: type: string - name: before description: Pagination cursor in: query required: false schema: type: string - name: first description: First x items. Used in combination with after in: query required: false schema: type: integer format: int64 - name: last description: Last x items. Used in combination with before in: query required: false schema: type: integer format: int64 tags: - Intents /v1/bots/{bot_id}/intents/insights: get: operationId: Analytics_GetIntentInsights responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/GetIntentInsightsResponse" parameters: - name: bot_id description: Identifies the bot. in: path required: true schema: type: string - name: version description: Identifies the bot version. in: query required: true schema: type: string - name: start_time description: The starting date for the time range of the data series. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the data series, exclusive. in: query required: true schema: type: string - name: channel_type description: Filter by specific channels, multiple values separated by comma. in: query required: false schema: type: string - name: language description: Filter by specific languages, multiple values separated by comma. in: query required: false schema: type: string - name: bucket description: |- Time interval in which results will be grouped. Supported values are 1h,1d,1w. The interval should be smaller than the range specified in the [start_time,end_time) in: query required: false schema: type: string tags: - Intents /v1/bots/{bot_id}/messages: get: summary: Get message analytics operationId: Analytics_GetMessages responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/GetMessagesResponse" parameters: - name: bot_id description: Identifies the bot. in: path required: true schema: type: string - name: version description: Identifies the bot version. in: query required: true schema: type: string - name: start_time description: The starting date for the time range of the data series. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the data series, exclusive. in: query required: true schema: type: string - name: channel_type description: Filter by specific channel. in: query required: false schema: type: string - name: language description: Filter by specific language. in: query required: false schema: type: string - name: bucket description: |- Time interval in which results will be grouped. Supported values are 1h, 1d, 1w. The interval should be smaller than the range specified in the [start_time,end_time). in: query required: false schema: type: string tags: - Messages /v1/bots/{bot_id}/subscriptions: get: operationId: Analytics_ListSubscriptions responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/ListSubscriptionsResponse" parameters: - name: bot_id in: path required: true schema: type: string - name: page_token in: query required: false schema: type: string - name: page_size in: query required: false schema: type: integer format: int32 tags: - Subscriptions post: operationId: Analytics_CreateSubscription requestBody: content: application/json: schema: type: object properties: target: type: string description: the target url to which the request will be sent secret: type: string description: the secret with which the request will be signed event_type: type: string description: the event type you want to be notified about event_names: type: array items: type: string description: |- when specified only the events with the given name will be sent only valid for TRACKING_EVENTS for now version: type: string description: |- identifies the definition of the subscription type to use.currently only the value "v1" is allowed responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/CreateSubscriptionResponse" parameters: - name: bot_id in: path required: true schema: type: string tags: - Subscriptions /v1/bots/{bot_id}/subscriptions/{subscription_id}: delete: operationId: Analytics_DeleteSubscription responses: "200": description: A successful response. content: application/json: schema: properties: {} parameters: - name: bot_id in: path required: true schema: type: string - name: subscription_id in: path required: true schema: type: string tags: - Subscriptions /v1/bots/{bot_id}/users: get: summary: Get user analytics operationId: Analytics_GetUsers responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/GetUsersResponse" parameters: - name: bot_id description: Identifies the bot. in: path required: true schema: type: string - name: version description: Identifies the bot version. in: query required: true schema: type: string - name: start_time description: The starting date for the time range of the data series. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the data series, exclusive. in: query required: true schema: type: string - name: channel_type description: Filter by specific channels, multiple values separated by comma. in: query required: false schema: type: string - name: language description: Filter by specific languages, multiple values separated by comma. in: query required: false schema: type: string - name: bucket description: |- Time interval in which results will be grouped. Supported values are 1h,1d,1w. The interval should be smaller than the range specified in the [start_time,end_time) in: query required: false schema: type: string tags: - Users /v1/bots/{bot_id}/users/activity: get: summary: Get user activity by day of week and time of day operationId: Analytics_GetUserActivity responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/GetUserActivityResponse" parameters: - name: bot_id description: Identifies the bot. in: path required: true schema: type: string - name: version description: Identifies the bot version. in: query required: true schema: type: string - name: start_time description: The starting date for the time range of the data series. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the data series, exclusive. in: query required: true schema: type: string - name: channel_type description: Filter by specific channels, multiple values separated by comma. in: query required: false schema: type: string - name: language description: Filter by specific languages, multiple values separated by comma. in: query required: false schema: type: string tags: - Users /v1/echo: post: summary: Check connectivity operationId: Analytics_Echo requestBody: content: application/json: schema: $ref: "#/components/schemas/EchoRequest" responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/EchoResponse" tags: - Analytics /v1/teams/{team_id}/conversations: get: operationId: Analytics_GetTeamConversationsUsage responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/GetTeamUsageResponse" parameters: - name: team_id description: Identifies the team. in: path required: true schema: type: string - name: start_time description: The starting date for the time range of the data series. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the data series, exclusive. in: query required: true schema: type: string - name: bucket description: |- Time interval in which results will be grouped. Supported values are 1d, 1w, 1m. The interval should be smaller than the range specified in the [start_time,end_time). in: query required: false schema: type: string - name: group_by description: Group data by field, comma separated. Can be any of [bot_id, bot_version, team_id, channel_type, language, campaign_id, campaign_source] in: query required: false schema: type: string tags: - Conversations /v1/teams/{team_id}/voice_minutes: get: operationId: Analytics_GetVoiceAnalytics responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/GetVoiceAnalyticsResponse" parameters: - name: team_id description: Identifies the team. in: path required: true schema: type: string - name: start_time description: The starting date for the time range of the data series. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the data series, exclusive. in: query required: true schema: type: string - name: language description: Filter by specific languages, multiple values separated by comma. in: query required: false schema: type: string - name: bucket description: |- Time interval in which results will be grouped. Supported values are 1h,1d,1w. The interval should be smaller than the range specified in the [start_time,end_time) in: query required: false schema: type: string tags: - Voice /v1beta1/teams/{team_id}/knowledge_base: get: operationId: Analytics_GetTeamKnowledgeBaseUsage responses: "200": description: A successful response. content: application/json: schema: $ref: "#/components/schemas/GetTeamKnowledgeBaseResponse" parameters: - name: team_id description: Identifies the team. in: path required: true schema: type: string - name: start_time description: The starting date for the time range of the data series. in: query required: true schema: type: string - name: end_time description: The ending date for the time range of the data series, exclusive. in: query required: true schema: type: string - name: bucket description: |- Time interval in which results will be grouped. Supported values are 1d, 1w, 1m. The interval should be smaller than the range specified in the [start_time,end_time). in: query required: true schema: type: string - name: channel_type description: Filter by specific channels, multiple values separated by comma. in: query required: false schema: type: string - name: language description: Filter by specific languages, multiple values separated by comma. in: query required: false schema: type: string tags: - Knowledge Base components: schemas: CreateEventDefinitionResponse: type: object properties: event_definition: $ref: "#/components/schemas/EventDefinition" CreateSubscriptionResponse: type: object properties: subscription: $ref: "#/components/schemas/Subscription" EchoRequest: type: object properties: message: type: string description: The message to echo back required: - message EchoResponse: type: object properties: message: type: string description: The echoed message Edge: type: object properties: count: type: integer format: int64 description: Total number of times this edge was invoked id: type: string description: The id of the dialog type: type: string description: The type of the dialog EventDefinition: type: object properties: id: type: string bot_id: type: string event: type: string description: type: string created_at: type: string format: date-time last_seen_at: type: string format: date-time volume_30_day: type: integer format: int32 FlowStep: type: object properties: occurrences: type: integer format: int64 description: The number of times this flow step occurred. id: type: string description: Identifies a bot dialog or a dropoff if the special value "DROPOFF" is used. GetConversationsInsightsResponse: type: object properties: data: $ref: "#/components/schemas/SeriesData" GetConversationsResponse: type: object properties: data: $ref: "#/components/schemas/SeriesData" GetFlowStepDetailsResponse: type: object properties: message_count: type: integer format: int64 description: Total number of times the specified step was invoked drop_off_count: type: integer format: int64 description: Number of dropoffs from the specified step conversation_count: type: integer format: int64 description: Number of conversations which includes the specified step GetFlowStepEdgesResponse: type: object properties: edges: type: array items: $ref: "#/components/schemas/Edge" GetFlowsResponse: type: object properties: nodes: type: array items: $ref: "#/components/schemas/FlowStep" GetIntentInsightsResponse: type: object properties: data: $ref: "#/components/schemas/SeriesData" GetIntentsResponse: type: object properties: data: type: array items: $ref: "#/components/schemas/IntentInfo" pagination: $ref: "#/components/schemas/Pagination" GetMessagesResponse: type: object properties: data: $ref: "#/components/schemas/SeriesData" GetTeamKnowledgeBaseResponse: type: object properties: data: $ref: '#/components/schemas/SeriesData' GetTeamUsageResponse: type: object properties: data: $ref: "#/components/schemas/SeriesData" GetUserActivityResponse: type: object properties: data: $ref: "#/components/schemas/SeriesData" GetUsersResponse: type: object properties: data: $ref: "#/components/schemas/SeriesData" GetVoiceAnalyticsResponse: type: object properties: data: $ref: "#/components/schemas/SeriesData" IntentInfo: type: object properties: intent_id: type: string description: Interval id of the intent. This is also the name of the intent count: type: integer format: int32 description: Total count of these intents rank: type: integer format: int32 description: Ordering position for this intent. Starts at 1 ListEventDefinitionsResponse: type: object properties: event_definitions: type: array items: $ref: "#/components/schemas/EventDefinition" next_page_token: type: string ListEventsResponse: type: object properties: events: type: array items: $ref: "#/components/schemas/TrackingEvent" next_page_token: type: string ListSubscriptionsResponse: type: object properties: subscriptions: type: array items: $ref: "#/components/schemas/Subscription" next_page_token: type: string Pagination: type: object properties: start_cursor: type: string description: Starting cursor for the returned dataset end_cursor: type: string description: Ending cursor for the returned dataset has_more: type: boolean description: Defines if there is more data. This means more data after the dataset when using after, or more data before the dataset when using before Serie: type: object properties: values: type: array items: type: integer format: int32 mean: type: integer format: int32 description: The mean value. max: type: integer format: int32 description: The max value. min: type: integer format: int32 description: The min value. sum: type: integer format: int32 description: The sum of all values. SeriesData: type: object properties: series: type: array items: $ref: "#/components/schemas/Serie" series_labels: type: array items: type: string x_values: type: array items: type: string Subscription: type: object properties: id: type: string description: identifies the subscription bot_id: type: string description: identifies the bot target: type: string description: the destination url where the events will be sent to event_type: type: string description: the event type you want to be notified about event_names: type: array items: type: string description: |- When specified only the events with the given name will be sent only valid for TRACKING_EVENTS for now. created_at: type: string format: date-time description: the time when the subscription was created version: type: string description: |- Identifies the definition of the subscription payload to use currently only the value "v1" is allowed. status: type: string TrackingEvent: type: object properties: id: type: string event: type: string bot_id: type: string version: type: string user_id: type: string channel_id: type: string channel_type: type: string conversation_id: type: string attributes: type: string timestamp: type: string format: date-time securitySchemes: bearerAuth: type: apiKey name: Authorization in: header