{"openapi":"3.0.0","info":{"title":"Mindlytics API","version":"1.0.0"},"servers":[{"url":"https://app.mindlytics.ai"}],"security":[{"APIKey":[],"APPId":[]}],"paths":{"/bc/v1/charts/segmentation-chart":{"get":{"tags":["Charts"],"summary":"Get a Segmentation Chart","description":"Get a Segmentation Chart","parameters":[{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}},{"name":"chartControls","in":"query","description":"Chart Controls","required":true,"schema":{"type":"object","properties":{"range":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"Time range for the chart.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z","period":"day","tz":"America/New_York"}},"eventFilters":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"]},"description":"Event filters for the segmentation."},"userFilters":{"type":"array","items":{"type":"object","properties":{"cohort":{"type":"string","description":"The name of the cohort.  Can be \"All Users\" to match any user."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the user must have the trait/values specified."},"shown_intents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"If specified, the user must have expressed the intents."},"performed_events":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"]},"description":"If specified, the user must have performed the events."},"combine_previous_operation":{"type":"string","enum":["and","or"],"description":"If specified, the operation to use when combining any previous user filters.  Defaults to \"or\"."}},"description":"A filter for selecting users","example":{"cohort":"cohort_name","with":[{"property_name":"trait_name","operator":"eq","values":["trait_value"]}],"shown_intents":[{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}],"performed_events":[{"event_name":"event_name","within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}]}},"description":"User filters for the segmentation."},"shownIntents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"Users who have shown this intent."}},"required":["range","eventFilters"],"description":"Inputs for the segmentation chart","title":"SegmentationChartInput"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"Name of the event"},"points":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"total":{"type":"number","description":"Total number of events in this period"},"unique":{"type":"number","description":"Number of unique users in this period"},"average":{"type":"number","description":"Average number of events per unique user in this period"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"}},"required":["start","end","total","unique","average"]},"description":"Points of the segmentation chart, if no group by was used."},"groups":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","description":"Group name"},"points":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"total":{"type":"number","description":"Total number of events in this period"},"unique":{"type":"number","description":"Number of unique users in this period"},"average":{"type":"number","description":"Average number of events per unique user in this period"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"}},"required":["start","end","total","unique","average"]},"description":"Points for the group"}},"required":["group","points"]},"description":"Groups of points in the segmentation chart, if group by was used."},"highlights":{"type":"object","properties":{"average_events":{"type":"number","description":"Average number of events per period"},"average_unique_users":{"type":"number","description":"Average number of unique users per period"}},"required":["average_events","average_unique_users"],"description":"Highlights for the chart, if not grouped."}},"required":["event_name"],"description":"Segmentation chart result"},"title":"SegmentationChartResult","description":"Results for the segmentation chart"}}}}}}},"/bc/v1/charts/retention-chart":{"get":{"tags":["Charts"],"summary":"Get a Retention Chart","description":"Get a Retention Chart","parameters":[{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}},{"name":"chartControls","in":"query","description":"Chart Controls","required":true,"schema":{"type":"object","properties":{"range":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"Time range for the chart.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z","period":"day","tz":"America/New_York"}},"startingEvent":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"],"description":"The event to start the retention chart from."},"returnEvents":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"]},"description":"The events to check for in the following periods."},"userFilters":{"type":"array","items":{"type":"object","properties":{"cohort":{"type":"string","description":"The name of the cohort.  Can be \"All Users\" to match any user."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the user must have the trait/values specified."},"shown_intents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"If specified, the user must have expressed the intents."},"performed_events":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"]},"description":"If specified, the user must have performed the events."},"combine_previous_operation":{"type":"string","enum":["and","or"],"description":"If specified, the operation to use when combining any previous user filters.  Defaults to \"or\"."}},"description":"A filter for selecting users","example":{"cohort":"cohort_name","with":[{"property_name":"trait_name","operator":"eq","values":["trait_value"]}],"shown_intents":[{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}],"performed_events":[{"event_name":"event_name","within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}]}},"description":"User filters for the chart."},"shownIntents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"Users who have shown this intent."},"groupBy":{"type":"object","properties":{"trait_name":{"type":"string"},"trait_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["trait_name"],"description":"Group by user trait.","example":{"trait_name":"gender","trait_values":["male","female"]}}},"required":["range","startingEvent"],"description":"Inputs for the retention chart","title":"RetentionChartInput"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"chart_name":{"type":"string","description":"Name of the chart"},"rows":{"type":"array","items":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"count":{"type":"number","description":"Number of users in this period"},"percent":{"type":"number","description":"Percentage of users that completed this event with respect to the starting event users."},"drilldown_id":{"type":"string","description":"Drilldown id for this event."}},"required":["start","end","count","percent"]},"description":"Rows of the retention chart"},"description":"Rows of the retention chart, if no group by was used."},"column_headers":{"type":"array","items":{"type":"object","properties":{"count":{"type":"number","description":"Number of users in this period"},"average":{"type":"number","description":"Average percentage of users that completed the event with respect to the starting event users."}},"required":["count","average"]},"description":"Headers for the columns of the chart; the average percentage and total users in each column."},"row_headers":{"type":"array","items":{"type":"number"},"description":"Headers for the rows of the chart; the number of users in each row."},"total_users":{"type":"number","description":"Total number of users in the chart represented in the chart."}},"required":["chart_name","column_headers","row_headers","total_users"],"description":"Retention chart result"},"description":"Results for the retention chart","title":"RetentionChartResult"}}}}}}},"/bc/v1/charts/session-chart":{"get":{"tags":["Charts"],"summary":"Get a Session Chart","description":"Get a Session Chart","parameters":[{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}},{"name":"chartControls","in":"query","description":"Chart Controls","required":true,"schema":{"type":"object","properties":{"range":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"Time range for the chart.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z","period":"day","tz":"America/New_York"}},"eventFilters":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"]},"description":"Event filters for the chart."},"userFilters":{"type":"array","items":{"type":"object","properties":{"cohort":{"type":"string","description":"The name of the cohort.  Can be \"All Users\" to match any user."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the user must have the trait/values specified."},"shown_intents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"If specified, the user must have expressed the intents."},"performed_events":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"]},"description":"If specified, the user must have performed the events."},"combine_previous_operation":{"type":"string","enum":["and","or"],"description":"If specified, the operation to use when combining any previous user filters.  Defaults to \"or\"."}},"description":"A filter for selecting users","example":{"cohort":"cohort_name","with":[{"property_name":"trait_name","operator":"eq","values":["trait_value"]}],"shown_intents":[{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}],"performed_events":[{"event_name":"event_name","within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}]}},"description":"User filters for the chart."},"shownIntents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"Users who have shown this intent."},"groupBy":{"type":"object","properties":{"trait_name":{"type":"string"},"trait_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["trait_name"],"description":"Group by user trait.","example":{"trait_name":"gender","trait_values":["male","female"]}}},"required":["range"],"description":"Get a chart of session counts over time","title":"Session Chart Input"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"chart_name":{"type":"string","description":"Name of the chart"},"points":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"sessions":{"type":"number","description":"Number of sessions in this period"},"session_ids":{"type":"array","items":{"type":"string"},"description":"Session ids in this period"},"conversations":{"type":"number","description":"Number of conversations in this period"},"average_length":{"type":"number","description":"Average session length in this period"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"}},"required":["start","end","sessions","session_ids","conversations","average_length"]},"description":"Points of the session chart, if no group by was used."},"groups":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","description":"Group name"},"points":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"sessions":{"type":"number","description":"Number of sessions in this period"},"session_ids":{"type":"array","items":{"type":"string"},"description":"Session ids in this period"},"conversations":{"type":"number","description":"Number of conversations in this period"},"average_length":{"type":"number","description":"Average session length in this period"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"}},"required":["start","end","sessions","session_ids","conversations","average_length"]},"description":"Points for the group"}},"required":["group","points"]},"description":"Groups of points in the session chart, if group by was used."}},"required":["chart_name"],"description":"A chart of session counts over time","title":"Session Chart Result"}}}}}}},"/bc/v1/charts/user-composition-chart":{"get":{"tags":["Charts"],"summary":"Get a User Composition Chart","description":"Get a User Composition Chart","parameters":[{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}},{"name":"chartControls","in":"query","description":"Chart Controls","required":true,"schema":{"type":"object","properties":{"range":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"Time range for the chart.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z","period":"day","tz":"America/New_York"}},"selectedTrait":{"type":"object","properties":{"trait_name":{"type":"string"},"trait_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["trait_name"],"description":"The trait to group by.","example":{"trait_name":"gender","trait_values":["male","female"]}},"userFilters":{"type":"array","items":{"type":"object","properties":{"cohort":{"type":"string","description":"The name of the cohort.  Can be \"All Users\" to match any user."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the user must have the trait/values specified."},"shown_intents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"If specified, the user must have expressed the intents."},"performed_events":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"]},"description":"If specified, the user must have performed the events."},"combine_previous_operation":{"type":"string","enum":["and","or"],"description":"If specified, the operation to use when combining any previous user filters.  Defaults to \"or\"."}},"description":"A filter for selecting users","example":{"cohort":"cohort_name","with":[{"property_name":"trait_name","operator":"eq","values":["trait_value"]}],"shown_intents":[{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}],"performed_events":[{"event_name":"event_name","within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}]}},"description":"User filters for the chart."},"shownIntents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"Users who have shown this intent."},"groupBy":{"type":"object","properties":{"trait_name":{"type":"string"},"trait_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["trait_name"],"description":"Group by user trait.","example":{"trait_name":"gender","trait_values":["male","female"]}}},"required":["range","selectedTrait"],"description":"Inputs for the user composition chart","title":"UserCompositionChartInput"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"chart_name":{"type":"string","description":"Name of the chart"},"groups":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","description":"Group name"},"slices":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Label for the slice"},"value":{"type":"number","description":"Value for the slice"},"percent":{"type":"number","description":"Percentage of the slice"},"drilldown_id":{"type":"string","description":"Drilldown id for this slice"}},"required":["label","value","percent"],"description":"A slice of a pie chart"},"description":"Pie chart for the group"}},"required":["group","slices"]},"description":"Groups of pie charts, if group by was used."},"slices":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Label for the slice"},"value":{"type":"number","description":"Value for the slice"},"percent":{"type":"number","description":"Percentage of the slice"},"drilldown_id":{"type":"string","description":"Drilldown id for this slice"}},"required":["label","value","percent"],"description":"A slice of a pie chart"},"description":"Pie chart, if no group by was used."},"highlights":{"type":"object","properties":{"max_percent":{"type":"number","description":"Maximum percentage of a pie slice"},"min_percent":{"type":"number","description":"Minimum percentage of a pie slice"},"max_count":{"type":"number","description":"Maximum count of a pie slice"},"min_count":{"type":"number","description":"Minimum count of a pie slice"}},"required":["max_percent","min_percent","max_count","min_count"],"description":"Highlights of the user composition chart, if not grouped."}},"required":["chart_name"],"description":"Results for the user composition chart","title":"UserCompositionChartResult"}}}}}}},"/bc/v1/charts/intent-distribution-chart":{"get":{"tags":["Charts"],"summary":"Get a Intent Distribution Chart","description":"Get a Intent Distribution Chart","parameters":[{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}},{"name":"chartControls","in":"query","description":"Chart Controls","required":true,"schema":{"type":"object","properties":{"range":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"Time range for the chart.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z","period":"day","tz":"America/New_York"}},"userFilters":{"type":"array","items":{"type":"object","properties":{"cohort":{"type":"string","description":"The name of the cohort.  Can be \"All Users\" to match any user."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the user must have the trait/values specified."},"shown_intents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"If specified, the user must have expressed the intents."},"performed_events":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"]},"description":"If specified, the user must have performed the events."},"combine_previous_operation":{"type":"string","enum":["and","or"],"description":"If specified, the operation to use when combining any previous user filters.  Defaults to \"or\"."}},"description":"A filter for selecting users","example":{"cohort":"cohort_name","with":[{"property_name":"trait_name","operator":"eq","values":["trait_value"]}],"shown_intents":[{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}],"performed_events":[{"event_name":"event_name","within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}]}},"description":"User filters for the chart."},"groupBy":{"type":"object","properties":{"trait_name":{"type":"string"},"trait_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["trait_name"],"description":"Group by user trait.","example":{"trait_name":"gender","trait_values":["male","female"]}}},"required":["range"],"description":"Get a distribution of intents for matching users","title":"IntentDistributionChartInput"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"chart_name":{"type":"string","description":"Name of the chart"},"groups":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","description":"Group name"},"slices":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Label for the slice"},"value":{"type":"number","description":"Value for the slice"},"percent":{"type":"number","description":"Percentage of the slice"},"drilldown_id":{"type":"string","description":"Drilldown id for this slice"}},"required":["label","value","percent"],"description":"A slice of a pie chart"},"description":"Slices for the group"}},"required":["group","slices"]},"description":"Groups of pie charts, if group by was used."},"slices":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Label for the slice"},"value":{"type":"number","description":"Value for the slice"},"percent":{"type":"number","description":"Percentage of the slice"},"drilldown_id":{"type":"string","description":"Drilldown id for this slice"}},"required":["label","value","percent"],"description":"A slice of a pie chart"},"description":"Slices of the pie chart, if no group by was used."},"highlights":{"type":"object","properties":{"max_percent":{"type":"number","description":"Maximum percentage of a pie slice"},"min_percent":{"type":"number","description":"Minimum percentage of a pie slice"},"max_count":{"type":"number","description":"Maximum count of a pie slice"},"min_count":{"type":"number","description":"Minimum count of a pie slice"}},"required":["max_percent","min_percent","max_count","min_count"],"description":"Highlights of the intent distribution chart, if not grouped."}},"required":["chart_name"],"description":"A distribution of intents for matching users","title":"IntentDistributionChartResult"}}}}}}},"/bc/v1/charts/funnel-chart":{"get":{"tags":["Charts"],"summary":"Get a Funnel Chart","description":"Get a Funnel Chart","parameters":[{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}},{"name":"chartControls","in":"query","description":"Chart Controls","required":true,"schema":{"type":"object","properties":{"range":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"Time range for the chart.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z","period":"day","tz":"America/New_York"}},"eventFilters":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"]},"description":"Event filters for the funnel."},"userFilters":{"type":"array","items":{"type":"object","properties":{"cohort":{"type":"string","description":"The name of the cohort.  Can be \"All Users\" to match any user."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the user must have the trait/values specified."},"shown_intents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"If specified, the user must have expressed the intents."},"performed_events":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"]},"description":"If specified, the user must have performed the events."},"combine_previous_operation":{"type":"string","enum":["and","or"],"description":"If specified, the operation to use when combining any previous user filters.  Defaults to \"or\"."}},"description":"A filter for selecting users","example":{"cohort":"cohort_name","with":[{"property_name":"trait_name","operator":"eq","values":["trait_value"]}],"shown_intents":[{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}],"performed_events":[{"event_name":"event_name","within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}]}},"description":"User filters for the funnel."},"shownIntents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"Users who have shown this intent."},"groupBy":{"type":"object","properties":{"trait_name":{"type":"string"},"trait_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["trait_name"],"description":"Group by user trait.","example":{"trait_name":"gender","trait_values":["male","female"]}}},"required":["range","eventFilters"],"description":"Input for a funnel chart","title":"FunnelChartInput"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"chart_name":{"type":"string","description":"Name of the chart."},"events":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string","description":"Event name."},"count":{"type":"number","description":"Number of users that completed this event."},"percent":{"type":"number","description":"Percentage of users that completed this event with respect to the starting event users."},"drilldown_id":{"type":"string","description":"Drilldown id for this event."}},"required":["event","count","percent"]},"description":"Events in the funnel, if no group by was specified."},"groups":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","description":"Group name."},"events":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string","description":"Event name."},"count":{"type":"number","description":"Number of users that completed this event."},"percent":{"type":"number","description":"Percentage of users that completed this event with respect to the starting event users."},"drilldown_id":{"type":"string","description":"Drilldown id for this event."}},"required":["event","count","percent"]},"description":"Events in the funnel, for this group."}},"required":["group","events"]},"description":"Groups of events in the funnel, if group by was specified."},"highlights":{"type":"object","properties":{"number_of_users":{"type":"number","description":"Number of users in the funnel."},"conversion_rate":{"type":"number","description":"Conversion rate of the funnel."}},"required":["number_of_users","conversion_rate"],"description":"Highlights of the funnel chart, if not grouped"}},"required":["chart_name"],"description":"Result of a funnel chart","title":"FunnelChartResult"}}}}}}},"/bc/v1/charts/conversation-analysis":{"get":{"tags":["Charts"],"summary":"Get a Conversation Analysis","description":"Get a Conversation Analysis","parameters":[{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}},{"name":"chartControls","in":"query","description":"Chart Controls","required":true,"schema":{"type":"object","properties":{"range":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"Time range for the chart.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z","period":"day","tz":"America/New_York"}},"userFilters":{"type":"array","items":{"type":"object","properties":{"cohort":{"type":"string","description":"The name of the cohort.  Can be \"All Users\" to match any user."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the user must have the trait/values specified."},"shown_intents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"If specified, the user must have expressed the intents."},"performed_events":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"]},"description":"If specified, the user must have performed the events."},"combine_previous_operation":{"type":"string","enum":["and","or"],"description":"If specified, the operation to use when combining any previous user filters.  Defaults to \"or\"."}},"description":"A filter for selecting users","example":{"cohort":"cohort_name","with":[{"property_name":"trait_name","operator":"eq","values":["trait_value"]}],"shown_intents":[{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}],"performed_events":[{"event_name":"event_name","within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}]}},"description":"User filters for the chart."},"shownIntents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"Users who have shown this intent."},"groupBy":{"type":"object","properties":{"trait_name":{"type":"string"},"trait_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["trait_name"],"description":"Group by user trait.","example":{"trait_name":"gender","trait_values":["male","female"]}},"analyse":{"type":"string","enum":["intentConversion","firstIntentFriction","newIntents","sentiment","duration","prompts"],"description":"Analysis option"}},"required":["range","analyse"],"description":"Conversation analysis chart controls","title":"Conversation Analysis Chart"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"chart_name":{"type":"string","description":"Name of the chart"},"points":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"conversion":{"type":"number","description":"Conversion percent"},"count":{"type":"number","description":"Total fulfilled intents"}},"required":["start","end","conversion","count"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"average_friction_percent":{"type":"number","description":"Average first fulfilled intent friction"}},"required":["start","end","average_friction_percent"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"unique_users":{"type":"number","description":"Unique users who expressed these intents"},"new_intents":{"type":"number","description":"Total new intents"},"average":{"type":"number","description":"Number of new intents expressed / Number of unique users"}},"required":["start","end","unique_users","new_intents","average"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"count":{"type":"number","description":"Total sentiments"}},"required":["start","end","count"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"average_sec":{"type":"number","description":"Average duration/conversation in seconds"},"total_sec":{"type":"number","description":"Total duration of all conversations in seconds"}},"required":["start","end","average_sec","total_sec"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"total":{"type":"number","description":"Total prompts"},"average_sec":{"type":"number","description":"Average duration of each prompt in seconds"}},"required":["start","end","total","average_sec"]}]},"description":"Points of the chart, if no group by was used."},"groups":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","description":"Group name"},"points":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"conversion":{"type":"number","description":"Conversion percent"},"count":{"type":"number","description":"Total fulfilled intents"}},"required":["start","end","conversion","count"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"average_friction_percent":{"type":"number","description":"Average first fulfilled intent friction"}},"required":["start","end","average_friction_percent"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"unique_users":{"type":"number","description":"Unique users who expressed these intents"},"new_intents":{"type":"number","description":"Total new intents"},"average":{"type":"number","description":"Number of new intents expressed / Number of unique users"}},"required":["start","end","unique_users","new_intents","average"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"count":{"type":"number","description":"Total sentiments"}},"required":["start","end","count"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"average_sec":{"type":"number","description":"Average duration/conversation in seconds"},"total_sec":{"type":"number","description":"Total duration of all conversations in seconds"}},"required":["start","end","average_sec","total_sec"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"total":{"type":"number","description":"Total prompts"},"average_sec":{"type":"number","description":"Average duration of each prompt in seconds"}},"required":["start","end","total","average_sec"]}]},"description":"Points for the group"}},"required":["group","points"]},"description":"Groups of points in the chart, if group by was used."},"highlights":{"anyOf":[{"type":"object","properties":{"conversion":{"type":"number","description":"Conversion percent"},"count":{"type":"number","description":"Total fulfilled intents"}},"required":["conversion","count"]},{"type":"object","properties":{"average_friction_percent":{"type":"number","description":"Average first fulfilled intent friction"},"total_conversations":{"type":"number","description":"Total conversations"},"total_first_intents_fulfilled":{"type":"number","description":"Total first intents fulfilled"}},"required":["average_friction_percent","total_conversations","total_first_intents_fulfilled"]},{"type":"object","properties":{"unique_users":{"type":"number","description":"Unique users who expressed these intents"},"new_intents":{"type":"number","description":"Total new intents"},"average":{"type":"number","description":"Number of new intents expressed / Number of unique users"}},"required":["unique_users","new_intents","average"]},{"type":"object","properties":{"count":{"type":"number","description":"Total sentiments"},"positive":{"type":"number","description":"Positive sentiment for the period"},"negative":{"type":"number","description":"Negative sentiment for the period"},"neutral":{"type":"number","description":"Neutral sentiment for the period"}},"required":["count","positive","negative","neutral"]},{"type":"object","properties":{"average_sec":{"type":"number","description":"Average duration/conversation in seconds"},"total_sec":{"type":"number","description":"Total duration of all conversations in seconds"}},"required":["average_sec","total_sec"]},{"type":"object","properties":{"total":{"type":"number","description":"Total prompts"},"average_sec":{"type":"number","description":"Average duration of each prompt in seconds"}},"required":["total","average_sec"]}],"description":"Highlights of the chart, if not grouped."}},"required":["chart_name","highlights"],"description":"Conversation analysis chart result"}}}}}}},"/bc/v1/charts/intent-analysis":{"get":{"tags":["Charts"],"summary":"Get a Intent Analysis","description":"Get a Intent Analysis","parameters":[{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}},{"name":"chartControls","in":"query","description":"Chart Controls","required":true,"schema":{"type":"object","properties":{"range":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"Time range for the chart.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z","period":"day","tz":"America/New_York"}},"userFilters":{"type":"array","items":{"type":"object","properties":{"cohort":{"type":"string","description":"The name of the cohort.  Can be \"All Users\" to match any user."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the user must have the trait/values specified."},"shown_intents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"If specified, the user must have expressed the intents."},"performed_events":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"]},"description":"If specified, the user must have performed the events."},"combine_previous_operation":{"type":"string","enum":["and","or"],"description":"If specified, the operation to use when combining any previous user filters.  Defaults to \"or\"."}},"description":"A filter for selecting users","example":{"cohort":"cohort_name","with":[{"property_name":"trait_name","operator":"eq","values":["trait_value"]}],"shown_intents":[{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}],"performed_events":[{"event_name":"event_name","within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}]}},"description":"User filters for the chart."},"shownIntents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"Users who have shown this intent."},"groupBy":{"type":"object","properties":{"trait_name":{"type":"string"},"trait_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["trait_name"],"description":"Group by user trait.","example":{"trait_name":"gender","trait_values":["male","female"]}},"analyse":{"type":"string","enum":["intentFulfillmentFriction","intentFulfillmentRate","intentFulfillmentSentiment","intentAcceptanceRate","attributeAcceptanceRate","intentFulfillmentEfficiency"],"description":"Analysis option"}},"required":["range","analyse"],"description":"Intent analysis chart controls","title":"Intent Analysis Chart"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"chart_name":{"type":"string","description":"Name of the chart"},"points":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"average_number_turns_per_fulfilled":{"type":"number","description":"Average number of turns per fulfilled intents"},"total_turns_for_fulfilled_intents":{"type":"number","description":"Total number of turns per fulfilled intents"}},"required":["start","end","average_number_turns_per_fulfilled","total_turns_for_fulfilled_intents"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"conversion_percent":{"type":"number","description":"Fulfillment rate"},"count":{"type":"number","description":"Number of intents"}},"required":["start","end","conversion_percent","count"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"count":{"type":"number","description":"Number of fulfilled intents"}},"required":["start","end","count"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"conversion_percent":{"type":"number","description":"Acceptance rate"},"count":{"type":"number","description":"Number of intents"}},"required":["start","end","conversion_percent","count"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"conversion_percent":{"type":"number","description":"Acceptance rate"},"count":{"type":"number","description":"Number of intents"}},"required":["start","end","conversion_percent","count"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"conversion_percent":{"type":"number","description":"Fulfillment efficiency"}},"required":["start","end","conversion_percent"]}]},"description":"Points of the chart, if no group by was used."},"groups":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","description":"Group name"},"points":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"average_number_turns_per_fulfilled":{"type":"number","description":"Average number of turns per fulfilled intents"},"total_turns_for_fulfilled_intents":{"type":"number","description":"Total number of turns per fulfilled intents"}},"required":["start","end","average_number_turns_per_fulfilled","total_turns_for_fulfilled_intents"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"conversion_percent":{"type":"number","description":"Fulfillment rate"},"count":{"type":"number","description":"Number of intents"}},"required":["start","end","conversion_percent","count"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"count":{"type":"number","description":"Number of fulfilled intents"}},"required":["start","end","count"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"conversion_percent":{"type":"number","description":"Acceptance rate"},"count":{"type":"number","description":"Number of intents"}},"required":["start","end","conversion_percent","count"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"conversion_percent":{"type":"number","description":"Acceptance rate"},"count":{"type":"number","description":"Number of intents"}},"required":["start","end","conversion_percent","count"]},{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"drilldown_id":{"type":"string","description":"Drilldown id for this point"},"conversion_percent":{"type":"number","description":"Fulfillment efficiency"}},"required":["start","end","conversion_percent"]}]},"description":"Points for the group"}},"required":["group","points"]},"description":"Groups of points in the chart, if group by was used."},"highlights":{"anyOf":[{"type":"object","properties":{"average_number_turns_per_fulfilled":{"type":"number","description":"Average number of turns per fulfilled intents"},"unique_fulfilled_intents":{"type":"number","description":"Number of unique fulfilled intents"},"total_fulfilled_intents":{"type":"number","description":"Total number of fulfilled intents"}},"required":["average_number_turns_per_fulfilled","unique_fulfilled_intents","total_fulfilled_intents"]},{"type":"object","properties":{"average_fulfillment_rate":{"type":"number","description":"Average fulfillment rate"},"unique_fulfilled_intents":{"type":"number","description":"Number of unique fulfilled intents"},"total_fulfilled_intents":{"type":"number","description":"Total number of fulfilled intents"}},"required":["average_fulfillment_rate","unique_fulfilled_intents","total_fulfilled_intents"]},{"type":"object","properties":{"positive_count":{"type":"number","description":"Number of positive intents"},"negative_count":{"type":"number","description":"Number of negative intents"},"neutral_count":{"type":"number","description":"Number of neutral intents"},"unique_fulfilled_intents":{"type":"number","description":"Number of unique fulfilled intents"},"total_fulfilled_intents":{"type":"number","description":"Total number of fulfilled intents"}},"required":["positive_count","negative_count","neutral_count","unique_fulfilled_intents","total_fulfilled_intents"]},{"type":"object","properties":{"total_intents_offered":{"type":"number","description":"Total number of intents offered"},"unique_intents_offered":{"type":"number","description":"Number of unique intents offered"},"average_acceptance_rate":{"type":"number","description":"Average acceptance rate"}},"required":["total_intents_offered","unique_intents_offered","average_acceptance_rate"]},{"type":"object","properties":{"total_attributes_offered":{"type":"number","description":"Total number of attributes offered"},"unique_attributes_offered":{"type":"number","description":"Number of unique attributes offered"},"average_acceptance_rate":{"type":"number","description":"Average acceptance rate"}},"required":["total_attributes_offered","unique_attributes_offered","average_acceptance_rate"]},{"type":"object","properties":{"total_intents_fulfilled":{"type":"number","description":"Total number of intents fulfilled"},"unique_intents_fulfilled":{"type":"number","description":"Number of unique intents fulfilled"},"average_number_turns_to_fulfill":{"type":"number","description":"Average number of turns to fulfill"}},"required":["total_intents_fulfilled","unique_intents_fulfilled","average_number_turns_to_fulfill"]}],"description":"Highlights of the chart, if not grouped."}},"required":["chart_name","highlights"],"description":"Intent analysis chart result"}}}}}}},"/bc/v1/charts/sentiment-analysis":{"get":{"tags":["Charts"],"summary":"Get a Sentiment Analysis","description":"Get a Sentiment Analysis","parameters":[{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}},{"name":"chartControls","in":"query","description":"Chart Controls","required":true,"schema":{"type":"object","properties":{"range":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"Time range for the chart","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z","period":"day","tz":"America/New_York"}},"intentFilter":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"Intent(s) to consider","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"userFilters":{"type":"array","items":{"type":"object","properties":{"cohort":{"type":"string","description":"The name of the cohort.  Can be \"All Users\" to match any user."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the user must have the trait/values specified."},"shown_intents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous intent filters.  Defaults to \"and\"."}},"required":["intent"],"description":"A filter for intents that the user has expressed","example":{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"description":"If specified, the user must have expressed the intents."},"performed_events":{"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"groupBy":{"type":"object","properties":{"property_name":{"type":"string"},"property_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["property_name","property_values"],"description":"If specified, the events will be grouped by this property for the values specified."},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."},"combine_previous_operation":{"type":"string","enum":["and","or","then"],"description":"If specified, the operation to use when combining any previous event filters.  Defaults to \"and\"."}},"required":["event_name"]},"description":"If specified, the user must have performed the events."},"combine_previous_operation":{"type":"string","enum":["and","or"],"description":"If specified, the operation to use when combining any previous user filters.  Defaults to \"or\"."}},"description":"A filter for selecting users","example":{"cohort":"cohort_name","with":[{"property_name":"trait_name","operator":"eq","values":["trait_value"]}],"shown_intents":[{"intent":"intent_name","with":[{"property_name":"attribute_name","operator":"eq","values":["attribute_value"]}],"within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}],"performed_events":[{"event_name":"event_name","within":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}]}},"description":"Filter users"},"groupBy":{"type":"object","properties":{"trait_name":{"type":"string"},"trait_values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["trait_name"],"description":"Group by user trait","example":{"trait_name":"gender","trait_values":["male","female"]}}},"required":["range","intentFilter"],"title":"Sentiment Analysis Chart","description":"Sentiment analysis chart controls"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"chart_name":{"type":"string","description":"Name of the chart"},"groups":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","description":"Group name"},"slices":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Label for the slice"},"value":{"type":"number","description":"Value for the slice"},"percent":{"type":"number","description":"Percentage of the slice"},"drilldown_id":{"type":"string","description":"Drilldown id for this slice"}},"required":["label","value","percent"],"description":"A slice of a pie chart"},"description":"Slices for the group"}},"required":["group","slices"]},"description":"Groups of pie charts, if group by was used."},"slices":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Label for the slice"},"value":{"type":"number","description":"Value for the slice"},"percent":{"type":"number","description":"Percentage of the slice"},"drilldown_id":{"type":"string","description":"Drilldown id for this slice"}},"required":["label","value","percent"],"description":"A slice of a pie chart"},"description":"Slices of the pie chart, if no group by was used."},"highlights":{"type":"object","properties":{"positive_percent":{"type":"number","description":"Percentage of positive sentiment"},"positive_total":{"type":"number","description":"Total count of positive sentiment"},"negative_percent":{"type":"number","description":"Percentage of negative sentiment"},"negative_total":{"type":"number","description":"Total count of negative sentiment"},"neutral_percent":{"type":"number","description":"Percentage of neutral sentiment"},"neutral_total":{"type":"number","description":"Total count of neutral sentiment"}},"required":["positive_percent","positive_total","negative_percent","negative_total","neutral_percent","neutral_total"],"description":"Highlights of the sentiment analysis chart, if not grouped."}},"required":["chart_name"],"description":"Sentiment analysis chart result"}}}}}}},"/bc/v1/agg/event-names":{"get":{"tags":["Aggregation"],"summary":"Get Event Names","description":"Get Event Names","parameters":[{"name":"event_regex","in":"query","description":"Event Regex","required":false,"schema":{"type":"string"}},{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Event Names","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/bc/v1/agg/property-names":{"get":{"tags":["Aggregation"],"summary":"Get Property Names","description":"Get Property Names","parameters":[{"name":"event_regex","in":"query","description":"Event Regex","required":false,"schema":{"type":"string"}},{"name":"picks","in":"query","description":"Existing Picks","required":false,"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Previously picked proerty, trait or attribute name."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"number"}}],"description":"Previously picked property, trait or attribute value."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"Previous operator for the pick.  Defaults to \"eq\".","example":"eq"}},"required":["name","value"]},"description":"Existing picks.  Will narrow down current return values.","example":[{"name":"name","value":"John Doe"},{"name":"age","value":30,"operator":"gte"}]}},{"name":"property_regex","in":"query","description":"Property Regex","required":false,"schema":{"type":"string"}},{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Property Names","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/bc/v1/agg/property-values":{"get":{"tags":["Aggregation"],"summary":"Get Property Values","description":"Get Property Values","parameters":[{"name":"event_regex","in":"query","description":"Event Regex","required":false,"schema":{"type":"string"}},{"name":"property_name_regex","in":"query","description":"Property Name Regex","required":false,"schema":{"type":"string"}},{"name":"property_value_regex","in":"query","description":"Property Value Regex","required":false,"schema":{"type":"string"}},{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Property Values","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/bc/v1/agg/trait-names":{"get":{"tags":["Aggregation"],"summary":"Get Trait Names","description":"Get Trait Names","parameters":[{"name":"event_regex","in":"query","description":"Event Regex","required":false,"schema":{"type":"string"}},{"name":"picks","in":"query","description":"Existing Picks","required":false,"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Previously picked proerty, trait or attribute name."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"number"}}],"description":"Previously picked property, trait or attribute value."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"Previous operator for the pick.  Defaults to \"eq\".","example":"eq"}},"required":["name","value"]},"description":"Existing picks.  Will narrow down current return values.","example":[{"name":"name","value":"John Doe"},{"name":"age","value":30,"operator":"gte"}]}},{"name":"trait_regex","in":"query","description":"Trait Regex","required":false,"schema":{"type":"string"}},{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Trait Names","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/bc/v1/agg/trait-values":{"get":{"tags":["Aggregation"],"summary":"Get Trait Values","description":"Get Trait Values","parameters":[{"name":"event_regex","in":"query","description":"Event Regex","required":false,"schema":{"type":"string"}},{"name":"trait_name_regex","in":"query","description":"Trait Name Regex","required":false,"schema":{"type":"string"}},{"name":"trait_value_regex","in":"query","description":"Trait Value Regex","required":false,"schema":{"type":"string"}},{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Trait Values","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/bc/v1/agg/intent-names":{"get":{"tags":["Aggregation"],"summary":"Get Intents","description":"Get Intents","parameters":[{"name":"intent_regex","in":"query","description":"Intent Regex","required":false,"schema":{"type":"string"}},{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Intents","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/bc/v1/agg/intent-attribute-names":{"get":{"tags":["Aggregation"],"summary":"Get Intent Attribute Names","description":"Get Intent Attribute Names","parameters":[{"name":"intent_regex","in":"query","description":"Intent Regex","required":false,"schema":{"type":"string"}},{"name":"picks","in":"query","description":"Existing Picks","required":false,"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Previously picked proerty, trait or attribute name."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"number"}}],"description":"Previously picked property, trait or attribute value."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"Previous operator for the pick.  Defaults to \"eq\".","example":"eq"}},"required":["name","value"]},"description":"Existing picks.  Will narrow down current return values.","example":[{"name":"name","value":"John Doe"},{"name":"age","value":30,"operator":"gte"}]}},{"name":"attribute_regex","in":"query","description":"Attribute Regex","required":false,"schema":{"type":"string"}},{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Intent Attribute Names","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/bc/v1/agg/intent-attribute-values":{"get":{"tags":["Aggregation"],"summary":"Get Intent Attribute Values","description":"Get Intent Attribute Values","parameters":[{"name":"intent_regex","in":"query","description":"Intent Regex","required":false,"schema":{"type":"string"}},{"name":"attribute_name_regex","in":"query","description":"Attribute Name Regex","required":false,"schema":{"type":"string"}},{"name":"attribute_value_regex","in":"query","description":"Attribute Value Regex","required":false,"schema":{"type":"string"}},{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Intent Attribute Values","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/bc/v1/agg/user-trait-names":{"get":{"tags":["Aggregation"],"summary":"Get User Trait Names","description":"Get User Trait Names","parameters":[{"name":"id_regex","in":"query","description":"ID Regex","required":false,"schema":{"type":"string"}},{"name":"picks","in":"query","description":"Existing Picks","required":false,"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Previously picked proerty, trait or attribute name."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"number"}}],"description":"Previously picked property, trait or attribute value."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"Previous operator for the pick.  Defaults to \"eq\".","example":"eq"}},"required":["name","value"]},"description":"Existing picks.  Will narrow down current return values.","example":[{"name":"name","value":"John Doe"},{"name":"age","value":30,"operator":"gte"}]}},{"name":"trait_regex","in":"query","description":"Trait Regex","required":false,"schema":{"type":"string"}},{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"User Trait Names","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/bc/v1/agg/user-trait-values":{"get":{"tags":["Aggregation"],"summary":"Get User Trait Values","description":"Get User Trait Values","parameters":[{"name":"id_regex","in":"query","description":"ID Regex","required":false,"schema":{"type":"string"}},{"name":"trait_regex","in":"query","description":"Trait Regex","required":false,"schema":{"type":"string"}},{"name":"trait_value_regex","in":"query","description":"Trait Value Regex","required":false,"schema":{"type":"string"}},{"name":"organization_id","in":"query","description":"organization_id","required":false,"schema":{"type":"string"}},{"name":"app_id","in":"query","description":"app_id","required":false,"schema":{"type":"string"}},{"name":"session_id","in":"query","description":"session_id","required":false,"schema":{"type":"string"}},{"name":"conversation_id","in":"query","description":"conversation_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"User Trait Values","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/bc/v1/db/retrieve_data":{"get":{"tags":["Database"],"summary":"Retrieve drilldown data","description":"Retrieve drilldown data","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","title":"id","description":"Data object id"}}],"responses":{"200":{"description":"Successful response.  A JSON object or array."}}}},"/bc/v1/db/import_demo_data":{"get":{"tags":["Database"],"summary":"Import demo data","description":"Import demo data into the database.  This is used for testing and development purposes.","responses":{"200":{"description":"Successful response.  A JSON object with a status of \"ok\".","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","title":"Status","description":"The status of the import operation"}},"required":["status"]}}}}}}},"/bc/v1/db/{collection}/{op}":{"get":{"tags":["Database"],"summary":"Query a collection","description":"Query a collection","parameters":[{"name":"collection","in":"path","required":true,"schema":{"type":"string","enum":["users","events","sessions","conversations","messages","orgkeys","organizations","apps"],"title":"Collection","description":"The collection to query"}},{"name":"op","in":"path","required":true,"schema":{"type":"string","enum":["find","findOne"],"title":"Operation","description":"The operation to perform"}},{"name":"filter","in":"query","required":false,"schema":{"type":"string","title":"Filter","description":"The filter to apply to the query. A JSON object."}},{"name":"projection","in":"query","required":false,"schema":{"type":"string","title":"Projection","description":"The projection to apply to the query. A JSON object."}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","title":"Sort","description":"The sort to apply to the query. A JSON object."}},{"name":"skip","in":"query","required":false,"schema":{"type":"number","title":"Skip","description":"The number of documents to skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"number","title":"Limit","description":"The maximum number of documents to return"}},{"name":"include","in":"query","required":false,"schema":{"type":"string","title":"Include","description":"The related collections to include. A JSON object."}}],"responses":{"200":{"description":"Successful response.  Either an array of documents (if find) or a single document (if findOne)"}}}},"/bc/v1/orgkeys":{"get":{"tags":["Organization Keys"],"summary":"List organization keys","description":"List all organization keys for an organization.","responses":{"200":{"description":"List of organization keys","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"organization_id":{"type":"string","title":"Organization ID"},"apikey":{"type":"string","title":"API Key"}},"required":["organization_id","apikey"],"title":"API Key, Organization ID association"}}}}}}},"post":{"tags":["Organization Keys"],"summary":"Create organization key","description":"Create an api key for an orgaization.  The POST method takes an organization_id from the request body, and then creates a new api key and associates it with the organization.  The Authorization header can be the super admin key, or another valid organization api key.  When creating the very first api key for an organization, the Authorization header would have to be the super admin key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string","title":"Organization ID"}},"required":["organization_id"]}}}},"responses":{"200":{"description":"Created organization key","content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string","title":"Organization ID"},"apikey":{"type":"string","title":"API Key"}},"required":["organization_id","apikey"],"title":"API Key, Organization ID association"}}}}}},"put":{"tags":["Organization Keys"],"summary":"Associate organization key","description":"Associate an organization api key with an organization.  The PUT method takes both api key and organization_id from the request body.  The Authorization header can be the super admin key, or another valid organization api key.  When creating the very first api key for an organization,  the Authorization header would have to be the super admin key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string","title":"Organization ID"},"apikey":{"type":"string","title":"API key"}},"required":["organization_id","apikey"]}}}},"responses":{"200":{"description":"Associated organization key","content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string","title":"Organization ID"},"apikey":{"type":"string","title":"API Key"}},"required":["organization_id","apikey"],"title":"API Key, Organization ID association"}}}}}},"delete":{"tags":["Organization Keys"],"summary":"Delete organization key","description":"Delete an organization api key.  The Authorization header can contain another valid api key for this organization, or can contain the api key being deleted, or the super admin key.","parameters":[{"name":"apikey","in":"query","required":false,"schema":{"type":"string","title":"API Key","description":"The API key to delete.  If not provided, all keys are deleted."}}],"responses":{"200":{"description":"Delete an organization api key"}}}},"/bc/v1/udi":{"post":{"tags":["User Defined Intents"],"summary":"Create a User Defined Intent","description":"Create a User Defined Intent","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"intent":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"],"description":"The intent name and description."},"attributes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"]},"description":"The attributes of the intent.  Slot names and descriptions."},"archived":{"type":"boolean","description":"Whether the intent is archived or not."}},"required":["intent","attributes"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"user_defined_intent_id":{"type":"string","description":"The user defined intent id."},"intent":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"],"description":"The intent name and description."},"attributes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"]},"description":"The attributes of the intent.  Slot names and descriptions."},"archived":{"type":"boolean","description":"Whether the intent is archived or not."}},"required":["user_defined_intent_id","intent","attributes"]}}}}}},"get":{"tags":["User Defined Intents"],"summary":"List User Defined Intents","description":"List User Defined Intents","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"user_defined_intent_id":{"type":"string","description":"The user defined intent id."},"intent":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"],"description":"The intent name and description."},"attributes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"]},"description":"The attributes of the intent.  Slot names and descriptions."},"archived":{"type":"boolean","description":"Whether the intent is archived or not."}},"required":["user_defined_intent_id","intent","attributes"]}}}}}}}},"/bc/v1/udi/{user_defined_intent_id}":{"get":{"tags":["User Defined Intents"],"summary":"Get a User Defined Intent","description":"Get a User Defined Intent","parameters":[{"name":"user_defined_intent_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"user_defined_intent_id":{"type":"string","description":"The user defined intent id."},"intent":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"],"description":"The intent name and description."},"attributes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"]},"description":"The attributes of the intent.  Slot names and descriptions."},"archived":{"type":"boolean","description":"Whether the intent is archived or not."}},"required":["user_defined_intent_id","intent","attributes"]}}}}}},"put":{"tags":["User Defined Intents"],"summary":"Update a User Defined Intent","description":"Update a User Defined Intent","parameters":[{"name":"user_defined_intent_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"intent":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"],"description":"The intent name and description."},"attributes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"]},"description":"The attributes of the intent.  Slot names and descriptions."},"archived":{"type":"boolean","description":"Whether the intent is archived or not."}},"required":["intent","attributes"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"user_defined_intent_id":{"type":"string","description":"The user defined intent id."},"intent":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"],"description":"The intent name and description."},"attributes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"]},"description":"The attributes of the intent.  Slot names and descriptions."},"archived":{"type":"boolean","description":"Whether the intent is archived or not."}},"required":["user_defined_intent_id","intent","attributes"]}}}}}},"delete":{"tags":["User Defined Intents"],"summary":"Delete a User Defined Intent","description":"Delete a User Defined Intent","parameters":[{"name":"user_defined_intent_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}}},"/bc/v1/events/event":{"post":{"tags":["Events"],"summary":"Handle an event","description":"Handle an event.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["start_session","end_session","identify","alias","track"],"title":"Event Type","description":"The type of event being sent."}},"required":["type"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"title":"Other properties","description":"Propties that depend on the event type."}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["start_session","end_session","identify","alias","track"],"title":"Event Type","description":"The type of event being sent."}},"required":["type"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"title":"Other properties","description":"Propties that depend on the event type."},"title":"Events","description":"The events that were generated by the Mindlytics service as a result of this event."}}}}}}},"/bc/v1/events/event/identify":{"post":{"tags":["Events"],"summary":"Identify a user","description":"Identify a user by their unique ID.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string","description":"A unique session ID generated by caller"},"timestamp":{"type":"string","description":"The timestamp of the event, defaults to \"now\" if not specified."},"user_id":{"type":"string","description":"The unique ID of the user"},"device_id":{"type":"string","description":"The ID of the device, if applicable"},"id":{"type":"string","description":"The unique ID of the user"},"type":{"type":"string","enum":["identify"],"description":"The event that identifies a user"},"traits":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Any additional traits to be associated with the user (name, gender, etc)"}},"required":["session_id","type"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["start_session","end_session","identify","alias","track"],"title":"Event Type","description":"The type of event being sent."}},"required":["type"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"title":"Other properties","description":"Propties that depend on the event type."},"title":"Events","description":"The events that were generated by the Mindlytics service as a result of this event."}}}}}}},"/bc/v1/events/event/alias":{"post":{"tags":["Events"],"summary":"Alias a user","description":"Alias a user by their unique ID.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string","description":"A unique session ID generated by caller"},"timestamp":{"type":"string","description":"The timestamp of the event, defaults to \"now\" if not specified."},"user_id":{"type":"string","description":"The unique ID of the user"},"device_id":{"type":"string","description":"The ID of the device, if applicable"},"id":{"type":"string","description":"The unique ID of the user"},"type":{"type":"string","enum":["alias"],"description":"The event that aliases a user"},"previous_id":{"type":"string","description":"The previous ID of the user"}},"required":["session_id","type","previous_id"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["start_session","end_session","identify","alias","track"],"title":"Event Type","description":"The type of event being sent."}},"required":["type"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"title":"Other properties","description":"Propties that depend on the event type."},"title":"Events","description":"The events that were generated by the Mindlytics service as a result of this event."}}}}}}},"/bc/v1/events/event/start-session":{"post":{"tags":["Events"],"summary":"Start a session","description":"Start a session for a user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string","description":"A unique session ID generated by caller"},"timestamp":{"type":"string","description":"The timestamp of the event, defaults to \"now\" if not specified."},"user_id":{"type":"string","description":"The unique ID of the user"},"device_id":{"type":"string","description":"The ID of the device, if applicable"},"id":{"type":"string","description":"The unique ID of the user"},"type":{"type":"string","enum":["start_session"],"description":"The event that starts a session"},"attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Any additional attributes to be associated with the session"}},"required":["session_id","type"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["start_session","end_session","identify","alias","track"],"title":"Event Type","description":"The type of event being sent."}},"required":["type"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"title":"Other properties","description":"Propties that depend on the event type."},"title":"Events","description":"The events that were generated by the Mindlytics service as a result of this event."}}}}}}},"/bc/v1/events/event/end-session":{"post":{"tags":["Events"],"summary":"End a session","description":"End a session for a user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string","description":"A unique session ID generated by caller"},"timestamp":{"type":"string","description":"The timestamp of the event, defaults to \"now\" if not specified."},"user_id":{"type":"string","description":"The unique ID of the user"},"device_id":{"type":"string","description":"The ID of the device, if applicable"},"type":{"type":"string","enum":["end_session"],"description":"The event that ends a session"},"attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Any additional attributes to be associated with the session"}},"required":["session_id","type"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["start_session","end_session","identify","alias","track"],"title":"Event Type","description":"The type of event being sent."}},"required":["type"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"title":"Other properties","description":"Propties that depend on the event type."},"title":"Events","description":"The events that were generated by the Mindlytics service as a result of this event."}}}}}}},"/bc/v1/events/event/track":{"post":{"tags":["Events"],"summary":"Track an event","description":"Track an event for a user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string","description":"A unique session ID generated by caller"},"timestamp":{"type":"string","description":"The timestamp of the event, defaults to \"now\" if not specified."},"user_id":{"type":"string","description":"The unique ID of the user"},"device_id":{"type":"string","description":"The ID of the device, if applicable"},"type":{"type":"string","enum":["track"],"description":"The event that tracks an arbitray event"},"event":{"type":"string","description":"The name of the event"},"conversation_id":{"type":"string","description":"The ID of the conversation, if applicable"},"properties":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Any additional properties to be associated with the event"}},"required":["session_id","type","event"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["start_session","end_session","identify","alias","track"],"title":"Event Type","description":"The type of event being sent."}},"required":["type"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"title":"Other properties","description":"Propties that depend on the event type."},"title":"Events","description":"The events that were generated by the Mindlytics service as a result of this event."}}}}}}},"/bc/v1/events/event/start-conversation":{"post":{"tags":["Events"],"summary":"Start a conversation","description":"Start a conversation for a user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string","description":"A unique session ID generated by caller"},"timestamp":{"type":"string","description":"The timestamp of the event, defaults to \"now\" if not specified."},"user_id":{"type":"string","description":"The unique ID of the user"},"device_id":{"type":"string","description":"The ID of the device, if applicable"},"type":{"type":"string","enum":["track"],"description":"The event that tracks an arbitray event"},"event":{"type":"string","enum":["Conversation Started"],"description":"The event that starts a conversation"},"conversation_id":{"type":"string","description":"The ID of the conversation"},"properties":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Any additional properties to be associated with the event"},"attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Any additional attributes to be associated with the conversation"}},"required":["session_id","type","event","conversation_id"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["start_session","end_session","identify","alias","track"],"title":"Event Type","description":"The type of event being sent."}},"required":["type"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"title":"Other properties","description":"Propties that depend on the event type."},"title":"Events","description":"The events that were generated by the Mindlytics service as a result of this event."}}}}}}},"/bc/v1/events/event/end-conversation":{"post":{"tags":["Events"],"summary":"End a conversation","description":"End a conversation for a user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string","description":"A unique session ID generated by caller"},"timestamp":{"type":"string","description":"The timestamp of the event, defaults to \"now\" if not specified."},"user_id":{"type":"string","description":"The unique ID of the user"},"device_id":{"type":"string","description":"The ID of the device, if applicable"},"type":{"type":"string","enum":["track"],"description":"The event that tracks an arbitray event"},"event":{"type":"string","enum":["Conversation Ended"],"description":"The event that ends a conversation"},"conversation_id":{"type":"string","description":"The ID of the conversation"},"properties":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Any additional properties to be associated with the event"},"attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Any additional attributes to be associated with the conversation"},"conversation_analysis":{"type":"object","properties":{"summary":{"type":"string","description":"A summary of the conversation."},"sentiment":{"type":"string","enum":["positive","negative","neutral"],"description":"The overall sentiment of the conversation."},"cost":{"type":"number"}},"required":["summary","sentiment","cost"]},"intent_analysis":{"type":"object","properties":{"summary":{"type":"string","description":"A summary of the user's intent."},"sentiment":{"type":"string","enum":["positive","negative","neutral"],"description":"The sentiment associated with the intent."},"intent_fulfilled":{"type":"string","enum":["yes","no"],"description":"Whether the intent was successfully fulfilled."},"cost":{"type":"number"}},"required":["summary","sentiment","intent_fulfilled","cost"]}},"required":["session_id","type","event","conversation_id"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["start_session","end_session","identify","alias","track"],"title":"Event Type","description":"The type of event being sent."}},"required":["type"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"title":"Other properties","description":"Propties that depend on the event type."},"title":"Events","description":"The events that were generated by the Mindlytics service as a result of this event."}}}}}}},"/bc/v1/events/event/conversation-turn":{"post":{"tags":["Events"],"summary":"Conversation turn","description":"A turn in a conversation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string","description":"A unique session ID generated by caller"},"timestamp":{"type":"string","description":"The timestamp of the event, defaults to \"now\" if not specified."},"user_id":{"type":"string","description":"The unique ID of the user"},"device_id":{"type":"string","description":"The ID of the device, if applicable"},"type":{"type":"string","enum":["track"],"description":"The event that tracks an arbitray event"},"event":{"type":"string","enum":["Conversation Turn"],"description":"The event that represents a turn in a conversation"},"conversation_id":{"type":"string","description":"The ID of the conversation"},"properties":{"type":"object","properties":{"user":{"type":"string"},"assistant":{"type":"string"},"assistant_id":{"type":"string","description":"The ID of the assistant, if applicable"},"model":{"type":"string","description":"The model name"},"prompt_tokens":{"type":"number","description":"The number of tokens in the prompt"},"completion_tokens":{"type":"number","description":"The number of tokens in the completion"},"cost":{"type":"number","description":"The cost of the event"}},"required":["user","assistant"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Properties of a turn event"}},"required":["session_id","type","event","conversation_id","properties"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["start_session","end_session","identify","alias","track"],"title":"Event Type","description":"The type of event being sent."}},"required":["type"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"title":"Other properties","description":"Propties that depend on the event type."},"title":"Events","description":"The events that were generated by the Mindlytics service as a result of this event."}}}}}}},"/bc/v1/events/event/conversation-usage":{"post":{"tags":["Events"],"summary":"Conversation usage","description":"Usage of a conversation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string","description":"A unique session ID generated by caller"},"timestamp":{"type":"string","description":"The timestamp of the event, defaults to \"now\" if not specified."},"user_id":{"type":"string","description":"The unique ID of the user"},"device_id":{"type":"string","description":"The ID of the device, if applicable"},"type":{"type":"string","enum":["track"],"description":"The event that tracks an arbitray event"},"event":{"type":"string","enum":["Conversation Usage"],"description":"The event that represents a usage in a conversation"},"conversation_id":{"type":"string","description":"The ID of the conversation"},"properties":{"oneOf":[{"type":"object","properties":{"model":{"type":"string","description":"The model name"},"prompt_tokens":{"type":"number","description":"The number of tokens in the prompt"},"completion_tokens":{"type":"number","description":"The number of tokens in the completion"}},"required":["model","prompt_tokens","completion_tokens"],"description":"Common models have costs that are provided by a service on the web.  If you are using one of these models, you can provide the model name and the number of tokens in the prompt and completion, and the cost will be calculated for you."},{"type":"object","properties":{"cost":{"type":"number","description":"The cost of the event"}},"required":["cost"],"description":"If you know the cost of a conversation turn, you can provide it directly. This will be accumulated in the conversation analysis."}],"description":"Properties of a usage event.  Either model and tokens (cost will be calculated if model is known), or cost directly."}},"required":["session_id","type","event","conversation_id","properties"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["start_session","end_session","identify","alias","track"],"title":"Event Type","description":"The type of event being sent."}},"required":["type"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"title":"Other properties","description":"Propties that depend on the event type."},"title":"Events","description":"The events that were generated by the Mindlytics service as a result of this event."}}}}}}},"/bc/v1/events/event/conversation-function":{"post":{"tags":["Events"],"summary":"Conversation function","description":"A function in a conversation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string","description":"A unique session ID generated by caller"},"timestamp":{"type":"string","description":"The timestamp of the event, defaults to \"now\" if not specified."},"user_id":{"type":"string","description":"The unique ID of the user"},"device_id":{"type":"string","description":"The ID of the device, if applicable"},"type":{"type":"string","enum":["track"],"description":"The event that tracks an arbitray event"},"event":{"type":"string","enum":["Conversation Function"],"description":"The event that represents a function in a conversation"},"conversation_id":{"type":"string","description":"The ID of the conversation"},"properties":{"type":"object","properties":{"name":{"type":"string","description":"The name of the function"},"args":{"type":"string","description":"The arguments of the function in JSON format"},"result":{"type":"string","description":"The result of the function execution in JSON format"},"runtime":{"type":"number","description":"The runtime of the function in milliseconds"}},"required":["name"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Properties of a function event.  Allows additional keys."}},"required":["session_id","type","event","conversation_id","properties"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["start_session","end_session","identify","alias","track"],"title":"Event Type","description":"The type of event being sent."}},"required":["type"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"title":"Other properties","description":"Propties that depend on the event type."},"title":"Events","description":"The events that were generated by the Mindlytics service as a result of this event."}}}}}}},"/bc/v1/events/queue":{"post":{"tags":["Events"],"summary":"Queue events","description":"Queue events for processing.  Instead of processing the events immediately, they are sent to a queue for offline processing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["start_session","end_session","identify","alias","track"],"title":"Event Type","description":"The type of event being sent."}},"required":["type"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"title":"Other properties","description":"Propties that depend on the event type."}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}}}}},"/bc/v1/summary/top-intents":{"get":{"tags":["Summary"],"summary":"Get Top Intents","description":"Get a summary of top intents within a given time range","parameters":[{"in":"query","name":"range","description":"Time range for the summary","schema":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"Time range for the summary","example":{"start":"2023-01-01T00:00:00.000Z","end":"2023-01-31T23:59:59.000Z","period":"day","tz":"UTC"}},"required":true},{"in":"query","name":"session_id","description":"Scope rerult to this session id.","schema":{"type":"string","description":"Scope rerult to this session id."}},{"in":"query","name":"conversation_id","description":"Scope result to this conversation id.","schema":{"type":"string","description":"Scope result to this conversation id."}}],"responses":{"200":{"description":"Top Intents Summary.  An array of objects with intent names as keys and counts as values, sorted by count descending.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string"},"count":{"type":"number"}},"required":["intent","count"],"example":[{"intent":"intent_name1","count":200},{"intent":"intent_name2","count":100}]}}}}}}}},"/bc/v1/summary/user-sentiment":{"get":{"tags":["Summary"],"summary":"Get User Sentiment","description":"Get a summary of user sentiment within a given time range","parameters":[{"in":"query","name":"range","description":"Time range for the summary","schema":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"Time range for the summary","example":{"start":"2023-01-01T00:00:00.000Z","end":"2023-01-31T23:59:59.000Z","period":"day","tz":"UTC"}},"required":true},{"in":"query","name":"session_id","description":"Scope rerult to this session id.","schema":{"type":"string","description":"Scope rerult to this session id."}},{"in":"query","name":"conversation_id","description":"Scope result to this conversation id.","schema":{"type":"string","description":"Scope result to this conversation id."}}],"responses":{"200":{"description":"User Sentiment Chart.","content":{"application/json":{"schema":{"type":"object","properties":{"chart_name":{"type":"string","description":"Name of the chart"},"groups":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","description":"Group name"},"slices":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Label for the slice"},"value":{"type":"number","description":"Value for the slice"},"percent":{"type":"number","description":"Percentage of the slice"},"drilldown_id":{"type":"string","description":"Drilldown id for this slice"}},"required":["label","value","percent"],"description":"A slice of a pie chart"},"description":"Slices for the group"}},"required":["group","slices"]},"description":"Groups of pie charts, if group by was used."},"slices":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Label for the slice"},"value":{"type":"number","description":"Value for the slice"},"percent":{"type":"number","description":"Percentage of the slice"},"drilldown_id":{"type":"string","description":"Drilldown id for this slice"}},"required":["label","value","percent"],"description":"A slice of a pie chart"},"description":"Slices of the pie chart, if no group by was used."},"highlights":{"type":"object","properties":{"positive_percent":{"type":"number","description":"Percentage of positive sentiment"},"positive_total":{"type":"number","description":"Total count of positive sentiment"},"negative_percent":{"type":"number","description":"Percentage of negative sentiment"},"negative_total":{"type":"number","description":"Total count of negative sentiment"},"neutral_percent":{"type":"number","description":"Percentage of neutral sentiment"},"neutral_total":{"type":"number","description":"Total count of neutral sentiment"}},"required":["positive_percent","positive_total","negative_percent","negative_total","neutral_percent","neutral_total"],"description":"Highlights of the sentiment analysis chart, if not grouped."}},"required":["chart_name"],"description":"Sentiment analysis chart result"}}}}}}},"/bc/v1/summary/user-conversations":{"get":{"tags":["Summary"],"summary":"Get User Conversations","description":"Get a summary of user conversations within a given time range","parameters":[{"in":"query","name":"range","description":"Time range for the summary","schema":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"Time range for the summary","example":{"start":"2023-01-01T00:00:00.000Z","end":"2023-01-31T23:59:59.000Z","period":"day","tz":"UTC"}},"required":true},{"in":"query","name":"session_id","description":"Scope rerult to this session id.","schema":{"type":"string","description":"Scope rerult to this session id."}},{"in":"query","name":"conversation_id","description":"Scope result to this conversation id.","schema":{"type":"string","description":"Scope result to this conversation id."}}],"responses":{"200":{"description":"User Conversations Chart.","content":{"application/json":{"schema":{"type":"object","properties":{"chart_name":{"type":"string","description":"The name of the chart"},"points":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"user_count":{"type":"number","description":"The number of users who have had a conversation in the given range"},"unique_user_count":{"type":"number","description":"The number of unique users who have had a conversation in the given range"},"conversation_count":{"type":"number","description":"The number of conversations in the given range"},"average_duration":{"type":"number","description":"The average duration of the conversations in milliseconds"},"average_prompt_count":{"type":"number","description":"The average number of prompts in the conversations"},"average_intents_per_conversation":{"type":"number","description":"The average number of intents per conversation"}},"required":["start","end","user_count","unique_user_count","conversation_count","average_duration","average_prompt_count","average_intents_per_conversation"]},"description":"The points of the chart"},"highlights":{"type":"object","properties":{"average_duration":{"type":"object","properties":{"value":{"type":"number","description":"The average duration of the conversations in milliseconds"},"delta_percent":{"type":"number","description":"The percent change from the previous period."}},"required":["value","delta_percent"]},"average_prompt_count":{"type":"object","properties":{"value":{"type":"number","description":"The average number of prompts in the conversations"},"delta_percent":{"type":"number","description":"The percent change from the previous period."}},"required":["value","delta_percent"]},"average_intents_per_conversation":{"type":"object","properties":{"value":{"type":"number","description":"The average number of intents per conversation"},"delta_percent":{"type":"number","description":"The percent change from the previous period."}},"required":["value","delta_percent"]}},"required":["average_duration","average_prompt_count","average_intents_per_conversation"],"description":"The highlights of the chart"}},"required":["chart_name","points","highlights"]}}}}}}},"/bc/v1/summary/engagement":{"get":{"tags":["Summary"],"summary":"Get Engagement","description":"Get a summary of user engagement within a given time range","parameters":[{"in":"query","name":"range","description":"Time range for the summary","schema":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"Time range for the summary","example":{"start":"2023-01-01T00:00:00.000Z","end":"2023-01-31T23:59:59.000Z","period":"day","tz":"UTC"}},"required":true},{"in":"query","name":"session_id","description":"Scope rerult to this session id.","schema":{"type":"string","description":"Scope rerult to this session id."}},{"in":"query","name":"conversation_id","description":"Scope result to this conversation id.","schema":{"type":"string","description":"Scope result to this conversation id."}}],"responses":{"200":{"description":"User engagement Chart.","content":{"application/json":{"schema":{"type":"object","properties":{"chart_name":{"type":"string","description":"The name of the chart"},"points":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","description":"Start timestamp of the point"},"end":{"type":"string","description":"End timestamp of the point"},"user_count":{"type":"number","description":"Active users during this period"},"new_user_count":{"type":"number","description":"New users during this period"},"conversation_count":{"type":"number","description":"The number of conversations in this period"},"intent_count":{"type":"number","description":"The number of intents in this period"}},"required":["start","end","user_count","new_user_count","conversation_count","intent_count"]},"description":"The points of the chart"},"highlights":{"type":"object","properties":{"total_user_count":{"type":"object","properties":{"value":{"type":"number","description":"The total number of users"},"delta_percent":{"type":"number","description":"The percentage change in the total number of users"}},"required":["value","delta_percent"]},"total_new_user_count":{"type":"object","properties":{"value":{"type":"number","description":"The total number of new users"},"delta_percent":{"type":"number","description":"The percentage change in the total number of new users"}},"required":["value","delta_percent"]},"total_conversation_count":{"type":"object","properties":{"value":{"type":"number","description":"The total number of conversations"},"delta_percent":{"type":"number","description":"The percentage change in the total number of conversations"}},"required":["value","delta_percent"]},"total_intent_count":{"type":"object","properties":{"value":{"type":"number","description":"The total number of intents"},"delta_percent":{"type":"number","description":"The percentage change in the total number of intents"}},"required":["value","delta_percent"]}},"required":["total_user_count","total_new_user_count","total_conversation_count","total_intent_count"],"description":"The highlights of the chart"}},"required":["chart_name","points","highlights"]}}}}}}},"/bc/v1/summary/event-counts":{"get":{"tags":["Summary"],"summary":"Get Project Event Counts","description":"Get a count of events for each passed in range.","parameters":[{"in":"query","name":"ranges","description":"Array of ranges","schema":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","description":"The start of the range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"string","enum":["day","week","month"],"description":"The size of the bins, or points, in a chart","example":"day"},"tz":{"type":"string","description":"The browser's timezone","example":"America/New_York"}},"required":["start","end","period","tz"],"description":"The chart date picker","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z","period":"day","tz":"America/New_York"}},"description":"Array of ranges","example":[{"start":"2023-01-01T00:00:00.000Z","end":"2023-01-31T23:59:59.000Z","period":"day","tz":"UTC"},{"start":"2023-02-01T00:00:00.000Z","end":"2023-03-02T23:59:59.000Z","period":"day","tz":"UTC"}]},"required":true},{"in":"query","name":"session_id","description":"Scope rerult to this session id.","schema":{"type":"string","description":"Scope rerult to this session id."}},{"in":"query","name":"conversation_id","description":"Scope result to this conversation id.","schema":{"type":"string","description":"Scope result to this conversation id."}}],"responses":{"200":{"description":"Array of event counts for each range.","content":{"application/json":{"schema":{"type":"array","items":{"type":"number"},"example":[100,200]}}}}}}},"/bc/v1/summary/new-intents":{"get":{"tags":["Summary"],"summary":"Get New Intents","description":"Get a list of new (unknown) intent names.","responses":{"200":{"description":"Array of new intent names","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"description":"Array of new intent names","example":["intent_name1","intent_name2"]}}}}}}},"/bc/v1/user/list":{"get":{"tags":["User"],"summary":"List users","description":"List users","parameters":[{"in":"query","name":"regex","description":"Regex to search for in user_id and traits.  This is a lucene style syntax.","schema":{"type":"string","description":"Regex to search for in user_id and traits.  This is a lucene style syntax."}},{"in":"query","name":"limit","description":"Limit the number of results to return.  Default is 100000","schema":{"type":"number","description":"Limit the number of results to return.  Default is 100000"}},{"in":"query","name":"offset","description":"Offset the results by this number.  Default is 0","schema":{"type":"number","description":"Offset the results by this number.  Default is 0"}},{"in":"query","name":"sort","description":"Sort the results by this specification.","schema":{"type":"object","properties":{"value":{"type":"string","description":"Field to sort by"},"order":{"type":"string","enum":["asc","desc"],"description":"Order to sort by"}},"required":["value","order"],"example":{"value":"created_at","order":"asc"},"description":"Sort the results by this specification."}}],"responses":{"200":{"description":"List of users","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"User ID to display"},"user_id":{"type":"string","description":"The user ID in the database"},"aliases":{"type":"array","items":{"type":"string"},"description":"List of aliases for the user"},"created_at":{"type":"string","description":"Date the user was created"},"traits":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"User traits"}},"required":["id","user_id","aliases","created_at","traits"],"description":"User object"},"description":"List of matching users, limited by the limit and offset parameters"},"total":{"type":"number","description":"Total number of users matching the query with no limit"}},"required":["users","total"],"description":"List of users"}}}}}}},"/bc/v1/user/details":{"get":{"tags":["User"],"summary":"Get user details","description":"Get user details","parameters":[{"in":"query","name":"user_id","description":"User database ID","schema":{"type":"string","description":"User database ID"},"required":true},{"in":"query","name":"limit","description":"Limit the number of results to return.  Default is 100000","schema":{"type":"number","description":"Limit the number of results to return.  Default is 100000"}},{"in":"query","name":"offset","description":"Offset the results by this number.  Default is 0","schema":{"type":"number","description":"Offset the results by this number.  Default is 0"}}],"responses":{"200":{"description":"User details","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"type":"object","properties":{"session_id":{"type":"string","description":"Session ID"},"user_id":{"type":"string","description":"User ID"},"started_at":{"type":"string","description":"Session start date"},"ended_at":{"type":"string","description":"Session end date"},"duration":{"type":"number","description":"Session duration in milliseconds"},"attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Session attributes"},"user_traits":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"User traits at the time of the session"},"events":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string","description":"User ID"},"event_id":{"type":"string","description":"Event ID"},"session_id":{"type":"string","description":"Session ID"},"conversation_id":{"type":"string","description":"Conversation ID"},"timestamp":{"type":"string","description":"Event timestamp"},"event":{"type":"string","description":"Event name"},"properties":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"number"}}]},"description":"Event properties"},"user_traits":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"User traits at the time of the event"}},"required":["user_id","event_id","session_id","timestamp","event","properties","user_traits"],"description":"Event object"},"description":"List of events in the session"}},"required":["session_id","user_id","started_at","ended_at","attributes","user_traits","events"],"description":"Session object"},"description":"List of sessions for the user"},"id":{"type":"string","description":"User ID to display"},"user_id":{"type":"string","description":"The user ID in the database"},"aliases":{"type":"array","items":{"type":"string"},"description":"List of aliases for the user"},"created_at":{"type":"string","description":"Date the user was created"},"traits":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"User traits"}},"required":["sessions","id","user_id","aliases","created_at","traits"]}}}}}}},"/bc/v1/user/insights":{"get":{"tags":["User"],"summary":"Get user insights","description":"Get user insights","parameters":[{"in":"query","name":"user_id","description":"User database ID","schema":{"type":"string","description":"User database ID"},"required":true},{"in":"query","name":"limit","description":"Limit the number of results to return.  Default is 100000","schema":{"type":"number","description":"Limit the number of results to return.  Default is 100000"}},{"in":"query","name":"offset","description":"Offset the results by this number.  Default is 0","schema":{"type":"number","description":"Offset the results by this number.  Default is 0"}}],"responses":{"200":{"description":"User insights","content":{"application/json":{"schema":{"type":"object","properties":{"conversations":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string","description":"User ID"},"session_id":{"type":"string","description":"Session ID"},"conversation_id":{"type":"string","description":"Conversation ID"},"started_at":{"type":"string","description":"Conversation start date"},"duration":{"type":"number","description":"Conversation duration in milliseconds"},"sentiment":{"type":"string","description":"Sentiment of the conversation"},"summary":{"type":"string","description":"Summary of the conversation"},"successful_intents":{"type":"number","description":"Number of successful intents in the conversation"},"unsuccessful_intents":{"type":"number","description":"Number of unsuccessful intents in the conversation"}},"required":["user_id","session_id","conversation_id","started_at","sentiment","summary","successful_intents","unsuccessful_intents"],"description":"Conversation object"},"description":"List of conversations for the user"},"id":{"type":"string","description":"User ID to display"},"user_id":{"type":"string","description":"The user ID in the database"},"aliases":{"type":"array","items":{"type":"string"},"description":"List of aliases for the user"},"created_at":{"type":"string","description":"Date the user was created"},"traits":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"User traits"}},"required":["conversations","id","user_id","aliases","created_at","traits"]}}}}}}},"/bc/v1/user/conversation":{"get":{"tags":["User"],"summary":"Get user conversation","description":"Get user conversation","parameters":[{"in":"query","name":"conversation_id","description":"Conversation ID to fetch messages from","schema":{"type":"string","description":"Conversation ID to fetch messages from"},"required":true},{"in":"query","name":"user_id","description":"User database ID","schema":{"type":"string","description":"User database ID"},"required":true},{"in":"query","name":"limit","description":"Limit the number of results to return.  Default is 100000","schema":{"type":"number","description":"Limit the number of results to return.  Default is 100000"}},{"in":"query","name":"offset","description":"Offset the results by this number.  Default is 0","schema":{"type":"number","description":"Offset the results by this number.  Default is 0"}}],"responses":{"200":{"description":"User conversation","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"user":{"type":"string","description":"User message content"},"assistant":{"type":"string","description":"Assistant message content"}},"required":["user","assistant"]},"description":"List of user/assistent turns"}}}}}}},"/bc/v1/user/event":{"get":{"tags":["User"],"summary":"Get event details","description":"Get event details","parameters":[{"in":"query","name":"event_id","description":"Event ID","schema":{"type":"string","description":"Event ID"},"required":true}],"responses":{"200":{"description":"Event details","content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string"},"app_id":{"type":"string"},"session_id":{"type":"string"},"user_id":{"type":"string"},"event_id":{"type":"string"},"conversation_id":{"type":"string"},"origin_event_id":{"type":"string"},"timestamp":{"type":"string"},"event":{"type":"string"},"properties":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"number"}}]}},"user_traits":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["organization_id","app_id","session_id","user_id","event_id"]}}}}}}},"/bc/v1/user/identify":{"post":{"tags":["User"],"summary":"Identify user","description":"Identify user.  The user id, or the user's device id, or both must be provided","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the user"},"device_id":{"type":"string","description":"The ID of the device, if applicable"},"traits":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Any additional traits to be associated with the user (name, gender, etc)"}},"description":"User identification - requires either id or device_id (or both)"}}}},"responses":{"200":{"description":"User identified","content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string"},"app_id":{"type":"string"},"user_id":{"type":"string"},"id":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"traits":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["organization_id","app_id","user_id","id","aliases","created_at","traits"]}}}}}}},"/bc/v1/user/alias":{"post":{"tags":["User"],"summary":"Alias user","description":"Alias user","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The new ID of the user"},"previous_id":{"type":"string","description":"The previous ID of the user"}},"required":["id","previous_id"],"description":"User alias - requires previous_id and id"}}}},"responses":{"200":{"description":"User aliased","content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string"},"app_id":{"type":"string"},"user_id":{"type":"string"},"id":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"traits":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["organization_id","app_id","user_id","id","aliases","created_at","traits"]}}}}}}},"/bc/v1/live-events/events":{"get":{"tags":["Live Events"],"summary":"Get events in a time range, with optional limit.  Returns events in descending order.","description":"Get live events.  The start and end timestamps are required. The limit is optional and defaults to 150.","parameters":[{"in":"query","name":"start","description":"The start timestamp of the events to retrieve","schema":{"type":"string","title":"Start Timestamp","description":"The start timestamp of the events to retrieve"},"required":true},{"in":"query","name":"end","description":"The end timestamp of the events to retrieve","schema":{"type":"string","title":"End Timestamp","description":"The end timestamp of the events to retrieve"},"required":true},{"in":"query","name":"limit","description":"The maximum number of events to retrieve (default is 150)","schema":{"type":"number","title":"Limit","description":"The maximum number of events to retrieve (default is 150)"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"organization_id":{"type":"string"},"app_id":{"type":"string"},"session_id":{"type":"string"},"user_id":{"type":"string"},"event_id":{"type":"string"},"conversation_id":{"type":"string"},"origin_event_id":{"type":"string"},"timestamp":{"type":"string"},"event":{"type":"string"},"properties":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"number"}}]}},"user_traits":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["organization_id","app_id","session_id","user_id","event_id"]},"title":"Live Events","description":"Array of events."}}}}}}},"/bc/v1/live-events/realtime":{"get":{"tags":["Live Events"],"summary":"Get authorization key for WebSocket connection","description":"Get authorization key for WebSocket connection.  Specify a session_id to scope events to a specific session.","parameters":[{"in":"query","name":"session_id","description":"The session ID of the events to listen for.  If not specified, all events will be sent.","schema":{"type":"string","title":"Session ID","description":"The session ID of the events to listen for.  If not specified, all events will be sent."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"authorization_key":{"type":"string","title":"Authorization Key","description":"The authorization key for the WebSocket connection"}},"required":["authorization_key"]}}}}}}},"/bc/v1/cohorts/byName":{"get":{"tags":["Cohorts"],"summary":"Get a cohort by name","description":"Get a cohort by name","parameters":[{"in":"query","name":"name","description":"Cohort name","schema":{"type":"string","description":"Cohort name"},"required":true}],"responses":{"200":{"description":"Cohort found","content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string","description":"The organization id of the cohort."},"app_id":{"type":"string","description":"The app id of the cohort."},"cohort_id":{"type":"string","description":"The cohort id of the cohort."},"created_at":{"type":"string","description":"The date the cohort was created."},"updated_at":{"type":"string","description":"The date the cohort was updated."},"name":{"type":"string","description":"The name of the cohort."},"description":{"type":"string","description":"The description of the cohort."},"terms":{"type":"array","items":{"type":"object","properties":{"operator":{"type":"string","enum":["and","or"],"default":"and","description":"The operator to use when combining this term with other terms.  The default is \"and\"."},"termFilter":{"oneOf":[{"$ref":"#/components/schemas/CohortEventFilter"},{"$ref":"#/components/schemas/CohortIntentFilter"},{"$ref":"#/components/schemas/CohortTraitFilter"},{"$ref":"#/components/schemas/CohortCohortFilter"}],"discriminator":{"propertyName":"type","mapping":{"event":"#/components/schemas/CohortEventFilter","intent":"#/components/schemas/CohortIntentFilter","trait":"#/components/schemas/CohortTraitFilter","cohort":"#/components/schemas/CohortCohortFilter"}}}},"required":["operator","termFilter"]},"minItems":1,"description":"The terms that make up the cohort.  There must be at least one term in the array."}},"required":["organization_id","app_id","cohort_id","created_at","updated_at","name","terms"]}}}},"404":{"description":"Cohort not found"}}}},"/bc/v1/cohorts/byId":{"get":{"tags":["Cohorts"],"summary":"Get a cohort by id","description":"Get a cohort by id","parameters":[{"in":"query","name":"cohort_id","description":"Cohort id","schema":{"type":"string","description":"Cohort id"},"required":true}],"responses":{"200":{"description":"Cohort found","content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string","description":"The organization id of the cohort."},"app_id":{"type":"string","description":"The app id of the cohort."},"cohort_id":{"type":"string","description":"The cohort id of the cohort."},"created_at":{"type":"string","description":"The date the cohort was created."},"updated_at":{"type":"string","description":"The date the cohort was updated."},"name":{"type":"string","description":"The name of the cohort."},"description":{"type":"string","description":"The description of the cohort."},"terms":{"type":"array","items":{"type":"object","properties":{"operator":{"type":"string","enum":["and","or"],"default":"and","description":"The operator to use when combining this term with other terms.  The default is \"and\"."},"termFilter":{"oneOf":[{"$ref":"#/components/schemas/CohortEventFilter"},{"$ref":"#/components/schemas/CohortIntentFilter"},{"$ref":"#/components/schemas/CohortTraitFilter"},{"$ref":"#/components/schemas/CohortCohortFilter"}],"discriminator":{"propertyName":"type","mapping":{"event":"#/components/schemas/CohortEventFilter","intent":"#/components/schemas/CohortIntentFilter","trait":"#/components/schemas/CohortTraitFilter","cohort":"#/components/schemas/CohortCohortFilter"}}}},"required":["operator","termFilter"]},"minItems":1,"description":"The terms that make up the cohort.  There must be at least one term in the array."}},"required":["organization_id","app_id","cohort_id","created_at","updated_at","name","terms"]}}}},"404":{"description":"Cohort not found"}}}},"/bc/v1/cohorts/evaluate":{"get":{"tags":["Cohorts"],"summary":"Evaluate cohort","description":"Evaluate cohort, get a list of users in the cohort","parameters":[{"in":"query","name":"cohort_id","description":"Cohort id","schema":{"type":"string","description":"Cohort id"},"required":true},{"in":"query","name":"skip","description":"Number of users to skip","schema":{"type":"number","description":"Number of users to skip"}},{"in":"query","name":"limit","description":"Number of users to return","schema":{"type":"number","description":"Number of users to return"}}],"responses":{"200":{"description":"Cohort evaluated","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"organization_id":{"type":"string"},"app_id":{"type":"string"},"user_id":{"type":"string"},"id":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"traits":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["organization_id","app_id","user_id","id","aliases","created_at","traits"]},"description":"List of users in the cohort"}}}},"404":{"description":"Cohort not found"}}}},"/bc/v1/cohorts":{"post":{"tags":["Cohorts"],"summary":"Create cohort","description":"Create cohort","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the cohort."},"description":{"type":"string","description":"The description of the cohort."},"terms":{"type":"array","items":{"type":"object","properties":{"operator":{"type":"string","enum":["and","or"],"default":"and","description":"The operator to use when combining this term with other terms.  The default is \"and\"."},"termFilter":{"oneOf":[{"$ref":"#/components/schemas/CohortEventFilter"},{"$ref":"#/components/schemas/CohortIntentFilter"},{"$ref":"#/components/schemas/CohortTraitFilter"},{"$ref":"#/components/schemas/CohortCohortFilter"}],"discriminator":{"propertyName":"type","mapping":{"event":"#/components/schemas/CohortEventFilter","intent":"#/components/schemas/CohortIntentFilter","trait":"#/components/schemas/CohortTraitFilter","cohort":"#/components/schemas/CohortCohortFilter"}}}},"required":["termFilter"]},"minItems":1,"description":"The terms that make up the cohort.  There must be at least one term in the array."}},"required":["name","terms"],"description":"A cohort is a group of users that meet certain criteria."}}}},"responses":{"200":{"description":"Cohort created","content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string","description":"The organization id of the cohort."},"app_id":{"type":"string","description":"The app id of the cohort."},"cohort_id":{"type":"string","description":"The cohort id of the cohort."},"created_at":{"type":"string","description":"The date the cohort was created."},"updated_at":{"type":"string","description":"The date the cohort was updated."},"name":{"type":"string","description":"The name of the cohort."},"description":{"type":"string","description":"The description of the cohort."},"terms":{"type":"array","items":{"type":"object","properties":{"operator":{"type":"string","enum":["and","or"],"default":"and","description":"The operator to use when combining this term with other terms.  The default is \"and\"."},"termFilter":{"oneOf":[{"$ref":"#/components/schemas/CohortEventFilter"},{"$ref":"#/components/schemas/CohortIntentFilter"},{"$ref":"#/components/schemas/CohortTraitFilter"},{"$ref":"#/components/schemas/CohortCohortFilter"}],"discriminator":{"propertyName":"type","mapping":{"event":"#/components/schemas/CohortEventFilter","intent":"#/components/schemas/CohortIntentFilter","trait":"#/components/schemas/CohortTraitFilter","cohort":"#/components/schemas/CohortCohortFilter"}}}},"required":["operator","termFilter"]},"minItems":1,"description":"The terms that make up the cohort.  There must be at least one term in the array."}},"required":["organization_id","app_id","cohort_id","created_at","updated_at","name","terms"]}}}}}},"put":{"tags":["Cohorts"],"summary":"Update cohort","description":"Update cohort","parameters":[{"in":"query","name":"cohort_id","description":"Cohort id","schema":{"type":"string","description":"Cohort id"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the cohort."},"description":{"type":"string","description":"The description of the cohort."},"terms":{"type":"array","items":{"type":"object","properties":{"operator":{"type":"string","enum":["and","or"],"default":"and","description":"The operator to use when combining this term with other terms.  The default is \"and\"."},"termFilter":{"oneOf":[{"$ref":"#/components/schemas/CohortEventFilter"},{"$ref":"#/components/schemas/CohortIntentFilter"},{"$ref":"#/components/schemas/CohortTraitFilter"},{"$ref":"#/components/schemas/CohortCohortFilter"}],"discriminator":{"propertyName":"type","mapping":{"event":"#/components/schemas/CohortEventFilter","intent":"#/components/schemas/CohortIntentFilter","trait":"#/components/schemas/CohortTraitFilter","cohort":"#/components/schemas/CohortCohortFilter"}}}},"required":["termFilter"]},"minItems":1,"description":"The terms that make up the cohort.  There must be at least one term in the array."}},"required":["name","terms"],"description":"A cohort is a group of users that meet certain criteria."}}}},"responses":{"200":{"description":"Cohort updated","content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string","description":"The organization id of the cohort."},"app_id":{"type":"string","description":"The app id of the cohort."},"cohort_id":{"type":"string","description":"The cohort id of the cohort."},"created_at":{"type":"string","description":"The date the cohort was created."},"updated_at":{"type":"string","description":"The date the cohort was updated."},"name":{"type":"string","description":"The name of the cohort."},"description":{"type":"string","description":"The description of the cohort."},"terms":{"type":"array","items":{"type":"object","properties":{"operator":{"type":"string","enum":["and","or"],"default":"and","description":"The operator to use when combining this term with other terms.  The default is \"and\"."},"termFilter":{"oneOf":[{"$ref":"#/components/schemas/CohortEventFilter"},{"$ref":"#/components/schemas/CohortIntentFilter"},{"$ref":"#/components/schemas/CohortTraitFilter"},{"$ref":"#/components/schemas/CohortCohortFilter"}],"discriminator":{"propertyName":"type","mapping":{"event":"#/components/schemas/CohortEventFilter","intent":"#/components/schemas/CohortIntentFilter","trait":"#/components/schemas/CohortTraitFilter","cohort":"#/components/schemas/CohortCohortFilter"}}}},"required":["operator","termFilter"]},"minItems":1,"description":"The terms that make up the cohort.  There must be at least one term in the array."}},"required":["organization_id","app_id","cohort_id","created_at","updated_at","name","terms"]}}}}}},"delete":{"tags":["Cohorts"],"summary":"Delete cohort","description":"Delete cohort","parameters":[{"in":"query","name":"cohort_id","description":"Cohort id","schema":{"type":"string","description":"Cohort id"},"required":true}],"responses":{"200":{"description":"Cohort deleted"}}},"get":{"tags":["Cohorts"],"summary":"Get cohorts","description":"Get cohorts","responses":{"200":{"description":"Cohorts found","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"organization_id":{"type":"string","description":"The organization id of the cohort."},"app_id":{"type":"string","description":"The app id of the cohort."},"cohort_id":{"type":"string","description":"The cohort id of the cohort."},"created_at":{"type":"string","description":"The date the cohort was created."},"updated_at":{"type":"string","description":"The date the cohort was updated."},"name":{"type":"string","description":"The name of the cohort."},"description":{"type":"string","description":"The description of the cohort."},"terms":{"type":"array","items":{"type":"object","properties":{"operator":{"type":"string","enum":["and","or"],"default":"and","description":"The operator to use when combining this term with other terms.  The default is \"and\"."},"termFilter":{"oneOf":[{"$ref":"#/components/schemas/CohortEventFilter"},{"$ref":"#/components/schemas/CohortIntentFilter"},{"$ref":"#/components/schemas/CohortTraitFilter"},{"$ref":"#/components/schemas/CohortCohortFilter"}],"discriminator":{"propertyName":"type","mapping":{"event":"#/components/schemas/CohortEventFilter","intent":"#/components/schemas/CohortIntentFilter","trait":"#/components/schemas/CohortTraitFilter","cohort":"#/components/schemas/CohortCohortFilter"}}}},"required":["operator","termFilter"]},"minItems":1,"description":"The terms that make up the cohort.  There must be at least one term in the array."}},"required":["organization_id","app_id","cohort_id","created_at","updated_at","name","terms"]}}}}}}}}},"components":{"securitySchemes":{"APIKey":{"type":"apiKey","in":"header","name":"Authorization","description":"API Key for your organization"},"APPId":{"type":"apiKey","in":"header","name":"X-App-ID","description":"Project ID"}},"schemas":{"CohortEventFilter":{"type":"object","properties":{"type":{"type":"string","enum":["event"]},"event_name":{"type":"string","description":"The name of the event.  Can be \"Any Event\" to match any event."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified the event must have all the property/values specified.  User traits on the event are also valid."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the event must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of events of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."}},"required":["type","event_name"]},"CohortIntentFilter":{"type":"object","properties":{"type":{"type":"string","enum":["intent"]},"intent":{"type":"string","description":"The name of the intent.  Can be \"Any Intent\" to match any intent."},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the intent must have the attribute/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the intent must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}},"number_of":{"type":"number","description":"If specified, the number of intents of this type that must have occurred within the time range. The default is 1."},"number_of_operator":{"type":"string","enum":["eq","gt","gte","lt","lte"],"description":"If specified, the operator to use when filtering the number of events.  The default is \"gte\"."}},"required":["type","intent"]},"CohortTraitFilter":{"type":"object","properties":{"type":{"type":"string","enum":["trait"]},"with":{"type":"array","items":{"type":"object","properties":{"property_name":{"type":"string","description":"The name of the property whose values are being filtered.  This is typically a trait or event property."},"operator":{"type":"string","enum":["eq","neq","in","nin","case_insensitive_eq","case_insensitive_neq","regex","not_regex","between","gt","gte","lt","lte"],"description":"The comparison operator to use when filtering the property values.  If not specified, the default is \"eq\".","example":"eq"},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The values to filter the property by.  This can be an array of one, in which case all operators are supported, or an array of multiple values, in which case only \"in\" and \"nin\" are supported."}},"required":["property_name","values"]},"description":"If specified, the trait must have the trait/values specified."},"within":{"type":"object","properties":{"start":{"type":"string","description":"The start of the time range as an ISO date string","example":"2021-01-01T00:00:00Z"},"end":{"type":"string","description":"The end of the time range as an ISO date string","example":"2021-01-02T00:00:00Z"},"period":{"type":"object","properties":{"number":{"type":"number","description":"The number of time units","example":1},"unit":{"type":"string","enum":["day","week","month"],"description":"The time unit","example":"day"},"tz":{"type":"string","description":"The timezone","example":"America/New_York"}},"required":["number","unit","tz"],"description":"The period of time to use when filtering the data.  If specified, overrides start and end.  This is typically used for events.","example":{"number":1,"unit":"day","tz":"America/New_York"}}},"description":"If specified, the trait must have occurred within this time range.","example":{"start":"2021-01-01T00:00:00Z","end":"2021-01-02T00:00:00Z"}}},"required":["type"]},"CohortCohortFilter":{"type":"object","properties":{"type":{"type":"string","enum":["cohort"]},"name":{"type":"string","description":"The name of the cohort.  Can be \"All Users\" to match all users."}},"required":["type","name"]}}}}