# Analytics

CRM analytics related endpoints

## Get sport betting related overall activity metrics

> Returns metrics relevant to betting activity per sport or league.\
> \
> By default betting activity will be calculated per sport. If you wish to\
> aggregate by league, you need to pass the \`group\_by=league\` query parameter.\
> \
> The metrics are calculated per sport and include values such as \`total\_bets\`,\
> \`total\_betted\_events\`, \`total\_uaps\`.\
> \
> {% hint style="info" %}\
> \
> \## Data for specific time period\
> \
> \
> Use the \`activity\_on\` filter, to fetch results for the desired time period,\
> and the \`grouping\_interval\` parameter to group them on the desired interval.\
> \
> {% endhint %}\
> \
> \
> {% hint style="info" %}\
> \
> \## Time intervals format\
> \
> \
> The \`activity\_on\` field is a date field, in the format \`YYYY-MM-DD\` which represents\
> the date of the activity. Given on the requested interval, the meaning of the \`activity\_on\` will vary.\
> \
> \* \`day\`: Returns results for a given date, e.g. \`2025-06-10\`.\
> \* \`week\`: Returns results for a given week. The returned date represents the start\
> day of this week (Monday based), e.g. \`2025-09-15\`.\
> \* \`month\`: Returns results for a given month where the returned date represents\
> the start date of this month, e.g. \`2025-06-01\` for June 2025.\
> \* \`overall\`: Returns metrics aggregated across the requested time period.\
> \
> {% endhint %}\ <br>

```json
{"openapi":"3.0.1","info":{"title":"","version":"0.1.0"},"tags":[{"description":"CRM analytics related endpoints","name":"Analytics"}],"servers":[{"description":"Production API","url":"https://api.vaix.ai"},{"description":"Staging (integration) API","url":"https://staging-api.vaix.ai"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"scheme":"bearer","type":"http"}},"schemas":{"AnalyticsSportBettingMetric":{"additionalProperties":false,"description":"CRM analytics sport betting metric","properties":{"activity_on":{"description":"The date the activity metrics are for","format":"date","nullable":true,"type":"string"},"league":{"description":"The league name the metrics are for if aggregated by league","type":"string"},"league_id":{"description":"The league id the metrics are for if aggregated by league","type":"string"},"sport":{"description":"The sport name the metrics are for","type":"string"},"sport_id":{"description":"The sport id the metrics are for","type":"string"},"subtenant_id":{"description":"The subtenant id the metric is for","type":"string"},"tenant_id":{"description":"The tenant id the metric is for","type":"string"},"total_bets":{"description":"The total bets placed in the given sport for the requested period","type":"integer"},"total_betted_events":{"description":"The total unique events of the given sport that were betted on for the requested period","type":"integer"},"total_tickets":{"description":"The total tickets placed having at least one bet in the given sport for the requested period","type":"integer"},"total_uaps":{"description":"The total unique active players of the given sport for the requested period","type":"integer"}},"type":"object"},"Error":{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},"Errors":{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"},"UnprocessableEntityError":{"oneOf":[{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"}]}}},"paths":{"/api/crm/analytics/betting/sports":{"get":{"description":"Returns metrics relevant to betting activity per sport or league.\n\nBy default betting activity will be calculated per sport. If you wish to\naggregate by league, you need to pass the `group_by=league` query parameter.\n\nThe metrics are calculated per sport and include values such as `total_bets`,\n`total_betted_events`, `total_uaps`.\n\n{% hint style=\"info\" %}\n\n## Data for specific time period\n\n\nUse the `activity_on` filter, to fetch results for the desired time period,\nand the `grouping_interval` parameter to group them on the desired interval.\n\n{% endhint %}\n\n\n{% hint style=\"info\" %}\n\n## Time intervals format\n\n\nThe `activity_on` field is a date field, in the format `YYYY-MM-DD` which represents\nthe date of the activity. Given on the requested interval, the meaning of the `activity_on` will vary.\n\n* `day`: Returns results for a given date, e.g. `2025-06-10`.\n* `week`: Returns results for a given week. The returned date represents the start\nday of this week (Monday based), e.g. `2025-09-15`.\n* `month`: Returns results for a given month where the returned date represents\nthe start date of this month, e.g. `2025-06-01` for June 2025.\n* `overall`: Returns metrics aggregated across the requested time period.\n\n{% endhint %}\n\n","operationId":"get_crm_analytics_sport_betting","parameters":[{"description":"Custom client header, the value should be the name of the group the user belongs to","in":"header","name":"x-vaix-client-id","required":true,"schema":{"type":"string"}},{"description":"Authentication method to be used, supported values [`vaix`, `iam`]. Defaults to `vaix`","in":"header","name":"x-vaix-authentication-method","required":false,"schema":{"type":"string"}},{"description":"Optional filtering of the results. It expects a string adhering to the\nfiltering format, as described in the filtering section.\n","in":"query","name":"filters","required":false,"schema":{"enum":["activity_on"],"type":"string"}},{"description":"The time interval for grouping the results.\n","in":"query","name":"grouping_interval","required":false,"schema":{"default":"month","enum":["day","week","month","overall"],"type":"string"}},{"description":"The dimension over which betting activity will be aggregated, can be one\nof `sport`, `league`\n","in":"query","name":"group_by","required":false,"schema":{"default":"sport","enum":["sport","league"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"description":"API response","properties":{"data":{"description":"Array of objects","items":{"$ref":"#/components/schemas/AnalyticsSportBettingMetric"},"type":"array"},"status":{"description":"The status of the request","enum":["success","error"],"type":"string"}},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"406":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Not Acceptable"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Request Entity Too Large"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityError"}}},"description":"Unprocessable Entity"},"425":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Too Early"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Internal Server Error"}},"summary":"Get sport betting related overall activity metrics","tags":["Analytics"]}}}}
```

## Get sports related overall activity metrics

> Returns sports related overall activity metrics.\
> \
> Includes sports related activity metrics, grouped on the specified interval.\
> \
> The calculated metrics include \`uaps\`, \`first\_time\_uaps\` and various monetary\
> stats for tickets.\
> \
> {% hint style="info" %}\
> \
> \## Local and standardized currency\
> \
> \
> Notice that monetary related metrics are all returned for each local currency\
> the operator supports.\
> \
> Along with that, aggregated metrics for the standardized currency \`(EUR)\` will\
> also be returned.\
> \
> For example, if an operator supports \`USD\` and \`MXN\` currencies, the results\
> will include:\
> \
> \* Statistics only regarding activity using \`USD\` currency.\
> \* Statistics only regarding activity using \`MXN\` currency.\
> \* Aggregated statistics regarding activity across all currencies.\
> In that case, all values will be converted and aggregated to \`EUR\` currency.\
> \
> {% endhint %}\
> \
> \
> {% hint style="info" %}\
> \
> \## Data for specific time period\
> \
> \
> Use the \`activity\_on\` filter, to fetch results for the desired time period,\
> and the \`grouping\_interval\` parameter to group them on the desired interval.\
> \
> {% endhint %}\
> \
> \
> {% hint style="info" %}\
> \
> \## Time intervals format\
> \
> \
> The \`activity\_on\` field is a date field, in the format \`YYYY-MM-DD\` which represents\
> the date of the activity. Given on the requested interval, the meaning of the \`activity\_on\` will vary.\
> \
> \* \`day\`: Returns results for a given date, e.g. \`2025-06-10\`.\
> \* \`week\`: Returns results for a given week where the returned date represents\
> the starting day of the week (Monday), e.g. \`2025-09-15\`.\
> \* \`month\`: Returns results for a given month where the returned date represents\
> the start date of this month, e.g. \`2025-06-01\` for June 2025.\
> \
> {% endhint %}\ <br>

```json
{"openapi":"3.0.1","info":{"title":"","version":"0.1.0"},"tags":[{"description":"CRM analytics related endpoints","name":"Analytics"}],"servers":[{"description":"Production API","url":"https://api.vaix.ai"},{"description":"Staging (integration) API","url":"https://staging-api.vaix.ai"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"scheme":"bearer","type":"http"}},"schemas":{"AnalyticsSportsActivityMetric":{"additionalProperties":false,"description":"CRM analytics sports activity metric","properties":{"activity_on":{"description":"The date the activity metrics are for","format":"date","type":"string"},"currency":{"description":"The currency the metrics are displayed in","type":"string"},"double_leg_ticket_count":{"description":"The number of double leg tickets for the requested period","type":"integer"},"double_leg_ticket_prize":{"description":"The total prize for double leg tickets for the requested period","type":"number"},"double_leg_ticket_stake":{"description":"The total stake for double leg tickets for the requested period","type":"number"},"first_time_uaps":{"description":"The number of unique active players for the first time in the requested period","type":"integer"},"local":{"description":"Whether the currency is local or not","type":"boolean"},"other_leg_ticket_count":{"description":"The number of other leg tickets for the requested period","type":"integer"},"other_leg_ticket_prize":{"description":"The total prize for other leg tickets for the requested period","type":"number"},"other_leg_ticket_stake":{"description":"The total stake for other leg tickets for the requested period","type":"number"},"single_leg_ticket_count":{"description":"The number of single leg tickets for the requested period","type":"integer"},"single_leg_ticket_prize":{"description":"The total prize for single leg tickets for the requested period","type":"number"},"single_leg_ticket_stake":{"description":"The total stake for single leg tickets for the requested period","type":"number"},"subtenant_id":{"description":"The subtenant id the metric is for","type":"string"},"tenant_id":{"description":"The tenant id the metric is for","type":"string"},"total_prize":{"description":"The total prize won for the requested period","type":"number"},"total_stake":{"description":"The total stake placed for the requested period","type":"number"},"triple_leg_ticket_count":{"description":"The number of triple leg tickets for the requested period","type":"integer"},"triple_leg_ticket_prize":{"description":"The total prize for triple leg tickets for the requested period","type":"number"},"triple_leg_ticket_stake":{"description":"The total stake for triple leg tickets for the requested period","type":"number"},"uaps":{"description":"The number of unique active players for the requested period","type":"integer"}},"type":"object"},"Error":{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},"Errors":{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"},"UnprocessableEntityError":{"oneOf":[{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"}]}}},"paths":{"/api/crm/analytics/sports_activity":{"get":{"description":"Returns sports related overall activity metrics.\n\nIncludes sports related activity metrics, grouped on the specified interval.\n\nThe calculated metrics include `uaps`, `first_time_uaps` and various monetary\nstats for tickets.\n\n{% hint style=\"info\" %}\n\n## Local and standardized currency\n\n\nNotice that monetary related metrics are all returned for each local currency\nthe operator supports.\n\nAlong with that, aggregated metrics for the standardized currency `(EUR)` will\nalso be returned.\n\nFor example, if an operator supports `USD` and `MXN` currencies, the results\nwill include:\n\n* Statistics only regarding activity using `USD` currency.\n* Statistics only regarding activity using `MXN` currency.\n* Aggregated statistics regarding activity across all currencies.\nIn that case, all values will be converted and aggregated to `EUR` currency.\n\n{% endhint %}\n\n\n{% hint style=\"info\" %}\n\n## Data for specific time period\n\n\nUse the `activity_on` filter, to fetch results for the desired time period,\nand the `grouping_interval` parameter to group them on the desired interval.\n\n{% endhint %}\n\n\n{% hint style=\"info\" %}\n\n## Time intervals format\n\n\nThe `activity_on` field is a date field, in the format `YYYY-MM-DD` which represents\nthe date of the activity. Given on the requested interval, the meaning of the `activity_on` will vary.\n\n* `day`: Returns results for a given date, e.g. `2025-06-10`.\n* `week`: Returns results for a given week where the returned date represents\nthe starting day of the week (Monday), e.g. `2025-09-15`.\n* `month`: Returns results for a given month where the returned date represents\nthe start date of this month, e.g. `2025-06-01` for June 2025.\n\n{% endhint %}\n\n","operationId":"get_crm_analytics_sports_activity","parameters":[{"description":"Custom client header, the value should be the name of the group the user belongs to","in":"header","name":"x-vaix-client-id","required":true,"schema":{"type":"string"}},{"description":"Authentication method to be used, supported values [`vaix`, `iam`]. Defaults to `vaix`","in":"header","name":"x-vaix-authentication-method","required":false,"schema":{"type":"string"}},{"description":"Optional filtering of the results. It expects a string adhering to the\nfiltering format, as described in the filtering section.\n","in":"query","name":"filters","required":false,"schema":{"enum":["currency","local","activity_on"],"type":"string"}},{"description":"The time interval for grouping the results.\n","in":"query","name":"grouping_interval","required":false,"schema":{"default":"month","enum":["day","week","month"],"type":"string"}},{"description":"The columns to sort the results by. It expects a string adhering to\nthe ordering format, as described in the ordering section, e.g.\n`+tenant_id,-subtenant_id`.\n","in":"query","name":"order_by","required":false,"schema":{"default":"+tenant_id,+subtenant_id,+currency,+local,-activity_on","enum":["tenant_id","subtenant_id","currency","local","activity_on"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"description":"API response","properties":{"data":{"description":"Array of objects","items":{"$ref":"#/components/schemas/AnalyticsSportsActivityMetric"},"type":"array"},"status":{"description":"The status of the request","enum":["success","error"],"type":"string"}},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"406":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Not Acceptable"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Request Entity Too Large"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityError"}}},"description":"Unprocessable Entity"},"425":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Too Early"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Internal Server Error"}},"summary":"Get sports related overall activity metrics","tags":["Analytics"]}}}}
```

## Get user cohort metrics for various types of users

> Returns metrics relevant to user cohorts.\
> \
> For each cohort period, metrics for the following activity periods\
> are returned. For example, if the cohort period is \`2025-01-01\`,\
> metrics for the activity periods of \`2025-01-01\`, \`2025-02-01\`,\
> \`2025-03-01\`, etc. are returned. Notice that through filters\
> you can get data for the desired cohort and activity periods.\
> \
> {% hint style="info" %}\
> \
> \## User type\
> \
> \
> The cohorts are calculated per user type.\
> \
> Use the \`user\_type\` filter to get data for the desired user type.\
> \
> Available user types are:\
> \
> \* \`new\`: Users who firstly registered during the cohort period.\
> \* \`active\`: Users who were active during the cohort period.\
> \
> {% endhint %}\
> \
> \
> {% hint style="info" %}\
> \
> \## Data for specific time period\
> \
> \
> Use the \`cohort\_on\` filter, to fetch results for the desired cohort period,\
> \`activity\_on\` filter to fetch results for the desired activity period based on\
> each cohort.\
> \
> {% endhint %}\
> \
> \
> {% hint style="info" %}\
> \
> \## Time intervals format\
> \
> \
> The \`cohort\_on\` and \`activity\_on\` fields are date fields, in the format \`YYYY-MM-DD\`\
> which represents the date of the cohort and activity respectively.\
> \
> If the results are grouped on \*\*monthly intervals\*\*, the returned dates represent\
> the start date of the month, e.g. \`2025-06-01\` for June 2025. Similarly if the\
> results are grouped on \*\*weekly intervals\*\* then the returned dates represent the\
> start of the corresponding week.\
> \
> {% endhint %}\ <br>

```json
{"openapi":"3.0.1","info":{"title":"","version":"0.1.0"},"tags":[{"description":"CRM analytics related endpoints","name":"Analytics"}],"servers":[{"description":"Production API","url":"https://api.vaix.ai"},{"description":"Staging (integration) API","url":"https://staging-api.vaix.ai"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"scheme":"bearer","type":"http"}},"schemas":{"AnalyticsUserCohortsMetric":{"additionalProperties":false,"description":"CRM analytics user cohorts metric","properties":{"activity_on":{"description":"The date the activity metrics are for","format":"date","type":"string"},"cohort_on":{"description":"The cohort date the metrics are for","format":"date","type":"string"},"subtenant_id":{"description":"The subtenant id the metric is for","type":"string"},"tenant_id":{"description":"The tenant id the metric is for","type":"string"},"user_count":{"description":"The total number of users in the given cohort for the requested period","type":"integer"},"user_type":{"description":"The type of users the metrics are for (e.g. `new`, `active`)","type":"string"}},"type":"object"},"Error":{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},"Errors":{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"},"UnprocessableEntityError":{"oneOf":[{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"}]}}},"paths":{"/api/crm/analytics/user_cohorts":{"get":{"description":"Returns metrics relevant to user cohorts.\n\nFor each cohort period, metrics for the following activity periods\nare returned. For example, if the cohort period is `2025-01-01`,\nmetrics for the activity periods of `2025-01-01`, `2025-02-01`,\n`2025-03-01`, etc. are returned. Notice that through filters\nyou can get data for the desired cohort and activity periods.\n\n{% hint style=\"info\" %}\n\n## User type\n\n\nThe cohorts are calculated per user type.\n\nUse the `user_type` filter to get data for the desired user type.\n\nAvailable user types are:\n\n* `new`: Users who firstly registered during the cohort period.\n* `active`: Users who were active during the cohort period.\n\n{% endhint %}\n\n\n{% hint style=\"info\" %}\n\n## Data for specific time period\n\n\nUse the `cohort_on` filter, to fetch results for the desired cohort period,\n`activity_on` filter to fetch results for the desired activity period based on\neach cohort.\n\n{% endhint %}\n\n\n{% hint style=\"info\" %}\n\n## Time intervals format\n\n\nThe `cohort_on` and `activity_on` fields are date fields, in the format `YYYY-MM-DD`\nwhich represents the date of the cohort and activity respectively.\n\nIf the results are grouped on **monthly intervals**, the returned dates represent\nthe start date of the month, e.g. `2025-06-01` for June 2025. Similarly if the\nresults are grouped on **weekly intervals** then the returned dates represent the\nstart of the corresponding week.\n\n{% endhint %}\n\n","operationId":"get_crm_analytics_user_cohorts","parameters":[{"description":"Custom client header, the value should be the name of the group the user belongs to","in":"header","name":"x-vaix-client-id","required":true,"schema":{"type":"string"}},{"description":"Authentication method to be used, supported values [`vaix`, `iam`]. Defaults to `vaix`","in":"header","name":"x-vaix-authentication-method","required":false,"schema":{"type":"string"}},{"description":"Optional filtering of the results. It expects a string adhering to the\nfiltering format, as described in the filtering section.\n","in":"query","name":"filters","required":false,"schema":{"enum":["cohort_on","activity_on","user_type"],"type":"string"}},{"description":"The columns to sort the results by. It expects a string adhering to\nthe ordering format, as described in the ordering section, e.g.\n`+tenant_id,-subtenant_id`.\n","in":"query","name":"order_by","required":false,"schema":{"default":"+tenant_id,+subtenant_id,+user_type,+cohort_on,+activity_on","enum":["tenant_id","subtenant_id","cohort_on","activity_on","user_type"],"type":"string"}},{"description":"The time interval for grouping the results.\n","in":"query","name":"grouping_interval","required":false,"schema":{"default":"month","enum":["week","month"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"description":"API response","properties":{"data":{"description":"Array of objects","items":{"$ref":"#/components/schemas/AnalyticsUserCohortsMetric"},"type":"array"},"status":{"description":"The status of the request","enum":["success","error"],"type":"string"}},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"406":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Not Acceptable"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Request Entity Too Large"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityError"}}},"description":"Unprocessable Entity"},"425":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Too Early"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Internal Server Error"}},"summary":"Get user cohort metrics for various types of users","tags":["Analytics"]}}}}
```

## Get user lifecycle metrics for the various lifecycle stages

> Returns metrics relevant to user lifecycles.\
> \
> {% hint style="info" %}\
> \
> \## Lifecycle stages\
> \
> \
> The following lifecycle stages are defined:\
> \
> \* \`active\`: Users who have been active during the activity period.\
> \* \`new\`: Users who firstly registered during the activity period.\
> \* \`dormant\`: Users who have not been active for a period of time.\
> \* \`lapsed\`: Users who have not been active for a longer period of time.\
> \* \`reactivated\`: Users who were previously dormant or lapsed but have\
> become active again during the activity period.\
> \
> Use the \`lifecycle\_status\` filter to get data for the desired lifecycle stage.\
> \
> {% endhint %}\
> \
> \
> {% hint style="info" %}\
> \
> \## Users transitioning between lifecycle stages\
> \
> \
> It is possible that during the same activity period, a user transitions\
> between different lifecycle stages. For example, a user may be \`active\` on\
> \`2025-08-12\` but change to \`dormant\` on \`2025-08-20\` if they do not\
> perform any activity after that date.\
> \
> In such case, only the latest lifecycle stage for the user within the activity period\
> will be considered for the metrics calculation. In the above example, the user\
> will be counted as \`dormant\` for the activity period of August 2025.\
> \
> {% endhint %}\
> \
> \
> {% hint style="info" %}\
> \
> \## Data grouping options\
> \
> \
> You can control how data is grouped using two parameters:\
> \
> \* Use the \`activity\_on\` filter to fetch results for the desired time period.\
> \* Use the \`grouping\_interval\` parameter to group data as either weekly or monthly aggregates.\
> &#x20; The default is \`month\` if not specified.\
> \
> {% endhint %}\
> \
> \
> {% hint style="info" %}\
> \
> \## Data for specific time period\
> \
> \
> The \`activity\_on\` field is a date field, in the format \`YYYY-MM-DD\` which represents\
> the date of the activity. Given on the requested interval,\
> the meaning of the \`activity\_on\` will vary.\
> \
> \* \`week\`: Returns results for a given week where the returned date represents\
> the starting day of the week (Monday), e.g. \`2025-09-15\`.\
> \* \`month\`: Returns results for a given month where the returned date represents\
> the start date of this month, e.g. \`2025-06-01\` for June 2025.\
> \
> {% endhint %}\ <br>

```json
{"openapi":"3.0.1","info":{"title":"","version":"0.1.0"},"tags":[{"description":"CRM analytics related endpoints","name":"Analytics"}],"servers":[{"description":"Production API","url":"https://api.vaix.ai"},{"description":"Staging (integration) API","url":"https://staging-api.vaix.ai"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"scheme":"bearer","type":"http"}},"schemas":{"AnalyticsUserLifecyclesMetric":{"additionalProperties":false,"description":"CRM analytics user lifecycles metric","properties":{"activity_on":{"description":"The date the activity metrics are for","format":"date","type":"string"},"lifecycle_status":{"description":"The lifecycles status of the users the metrics are for (e.g. `new`, `active`)","type":"string"},"subtenant_id":{"description":"The subtenant id the metric is for","type":"string"},"tenant_id":{"description":"The tenant id the metric is for","type":"string"},"user_count":{"description":"The total number of users in the given status for the requested period","type":"integer"}},"type":"object"},"Error":{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},"Errors":{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"},"UnprocessableEntityError":{"oneOf":[{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"}]}}},"paths":{"/api/crm/analytics/user_lifecycles":{"get":{"description":"Returns metrics relevant to user lifecycles.\n\n{% hint style=\"info\" %}\n\n## Lifecycle stages\n\n\nThe following lifecycle stages are defined:\n\n* `active`: Users who have been active during the activity period.\n* `new`: Users who firstly registered during the activity period.\n* `dormant`: Users who have not been active for a period of time.\n* `lapsed`: Users who have not been active for a longer period of time.\n* `reactivated`: Users who were previously dormant or lapsed but have\nbecome active again during the activity period.\n\nUse the `lifecycle_status` filter to get data for the desired lifecycle stage.\n\n{% endhint %}\n\n\n{% hint style=\"info\" %}\n\n## Users transitioning between lifecycle stages\n\n\nIt is possible that during the same activity period, a user transitions\nbetween different lifecycle stages. For example, a user may be `active` on\n`2025-08-12` but change to `dormant` on `2025-08-20` if they do not\nperform any activity after that date.\n\nIn such case, only the latest lifecycle stage for the user within the activity period\nwill be considered for the metrics calculation. In the above example, the user\nwill be counted as `dormant` for the activity period of August 2025.\n\n{% endhint %}\n\n\n{% hint style=\"info\" %}\n\n## Data grouping options\n\n\nYou can control how data is grouped using two parameters:\n\n* Use the `activity_on` filter to fetch results for the desired time period.\n* Use the `grouping_interval` parameter to group data as either weekly or monthly aggregates.\n  The default is `month` if not specified.\n\n{% endhint %}\n\n\n{% hint style=\"info\" %}\n\n## Data for specific time period\n\n\nThe `activity_on` field is a date field, in the format `YYYY-MM-DD` which represents\nthe date of the activity. Given on the requested interval,\nthe meaning of the `activity_on` will vary.\n\n* `week`: Returns results for a given week where the returned date represents\nthe starting day of the week (Monday), e.g. `2025-09-15`.\n* `month`: Returns results for a given month where the returned date represents\nthe start date of this month, e.g. `2025-06-01` for June 2025.\n\n{% endhint %}\n\n","operationId":"get_crm_analytics_user_lifecycles","parameters":[{"description":"Custom client header, the value should be the name of the group the user belongs to","in":"header","name":"x-vaix-client-id","required":true,"schema":{"type":"string"}},{"description":"Authentication method to be used, supported values [`vaix`, `iam`]. Defaults to `vaix`","in":"header","name":"x-vaix-authentication-method","required":false,"schema":{"type":"string"}},{"description":"Optional filtering of the results. It expects a string adhering to the\nfiltering format, as described in the filtering section.\n","in":"query","name":"filters","required":false,"schema":{"enum":["activity_on","lifecycle_status"],"type":"string"}},{"description":"The columns to sort the results by. It expects a string adhering to\nthe ordering format, as described in the ordering section, e.g.\n`+tenant_id,-subtenant_id`.\n","in":"query","name":"order_by","required":false,"schema":{"default":"+tenant_id,+subtenant_id,+activity_on,+lifecycle_status","enum":["tenant_id","subtenant_id","activity_on","lifecycle_status"],"type":"string"}},{"description":"The time interval for grouping the results.\n","in":"query","name":"grouping_interval","required":false,"schema":{"default":"month","enum":["week","month"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"description":"API response","properties":{"data":{"description":"Array of objects","items":{"$ref":"#/components/schemas/AnalyticsUserLifecyclesMetric"},"type":"array"},"status":{"description":"The status of the request","enum":["success","error"],"type":"string"}},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"406":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Not Acceptable"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Request Entity Too Large"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityError"}}},"description":"Unprocessable Entity"},"425":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Too Early"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Internal Server Error"}},"summary":"Get user lifecycle metrics for the various lifecycle stages","tags":["Analytics"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sportradar.com/retention/api-reference/analytics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
