Reactivation

Reactivation related endpoints

Get reactivation predictions

get

Returns reactivation predictions for the given date.

You can specify a single user to get predictions for by setting the user field or get predictions for all users. Notice that in the latter case the results will be paginated so you will need to query the endpoint multiple times in order to get the predictions for all users.

Specify product

Notice that you must specify the product query parameter in order to get retention predictions for a specific product. For example if both sports and casino retention predictions are generated you must set to the product, field one of sports, casino or combined.

If not set it defaults to sports.

This delegates to /api/crm/predictions/reactivation.

Returned values

The acquisition models predict the Reactivation Score of a user for the first 30 and 60 after the first active day.

The predictive fields are the following:

{
  "reactivation_score_030": 0.8,
  "reactivation_score_060": 1.24
}
Authorizations
Query parameters
userstringOptional

The user to get information for.

datestring · dateOptional

The date to get predictions for. Can be latest for latest available data. If not set, defaults to the current date.

Default: now
operatorstringOptional

The operator to use for querying data. Notice that this is applied only if your account has access to multiple operators. In a different case the assigned operator to your account is used and the value of this field is ignored.

bookmaker_idintegerOptional

The bookmaker id to use for querying data. Notice that this is applied only if your account has access to multiple operators. In a different case the assigned operator to your account is used and the value of this field is ignored. Note that this parameter is used together with the sub_bookmaker_id parameter.

sub_bookmaker_idintegerOptional

The sub-bookmaker id to use for querying data. Notice that this is applied only if your account has access to multiple operators. In a different case the assigned operator to your account is used and the value of this field is ignored. Note that this parameter is used together with the bookmaker_id parameter.

productstring · enumOptional

The type of product to get predictions for. If an operator has the CRM package for more than one products, then this must be set. Can be one of sports, casino, horses, combined. If not set it defaults to sports.

Default: sportsPossible values:
order_bystring · enumOptional

The columns to sort the results by. It expects a string adhering to the ordering format, as described in the ordering section, e.g. +reactivation_score_030,-reactivation_score_060.

Default: +user_idPossible values:
filtersstring · enumOptional

Optional filtering of the results. It expects a string adhering to the filtering format, as described in the filtering section, e.g. churn_score_007:gt:0.7;predicted_ggr_030:lt:5000.

Default: ""Possible values:
pageinteger · min: 1Optional

The page to retrieve. Notice that if set the random access pagination mechanism will be used. If not set the pagination mechanism default to the keyset mode.

page_sizeinteger · min: 1 · max: 1000Optional

The number of items ot include in each page.

Default: 100
page_cursorstringOptional

The cursor to get data from. It should be retrieved from the pagination section of a previous response in case of keyset pagination.

This value will be ignored if the page parameter has been provided and random access pagination will be used instead.

Notice that the the cursor is cryptographically signed and verified, make sure to set the exact value it was returned.

invalidate_cachebooleanOptional

If set then the cache will not be used and the computation of the underlying function will be enforced.

This parameter is for internal use only.

Default: false
schema_versionstring · enumOptional

The underlying schema version. Some endpoints can operate on multiple internal database schemas. Must be one of the allowed values. If not set it defaults to v2.

Default: v2Possible values:
Header parameters
x-vaix-client-idstringRequired

Custom client header, the value should be the name of the group the user belongs to

x-vaix-authentication-methodstringOptional

Authentication method to be used, supported values [vaix, iam]. Defaults to vaix

Responses
200

OK

application/json
get
GET /api/crm/predictions/reactivation HTTP/1.1
Host: api.vaix.ai
Authorization: Bearer YOUR_SECRET_TOKEN
x-vaix-client-id: text
Accept: */*
{
  "data": [
    {
      "acquisition_source": "NCWVVFBF",
      "apds": 4,
      "apds_last_30": 2,
      "avg_stake_last_active_30": 0.035590000000000004,
      "country": "ng",
      "currency": null,
      "gender": null,
      "inactive_days": 16,
      "last_active_date": "2021-01-03",
      "last_deposit_date": "2021-01-01",
      "player_value_segment": "Low",
      "prediction_date": "2021-01-20",
      "product": "sports",
      "reactivation_score_030": 0.10999999940395355,
      "reactivation_score_060": 0.5400000214576721,
      "reactivation_segment_030": "Most Unlikely",
      "reactivation_segment_060": "Unlikely",
      "signup_date": "2020-06-30",
      "stake_last_active_30": 1.0677,
      "state": null,
      "total_ggr": 1.3198,
      "user_id": "1112642"
    },
    {
      "acquisition_source": "NSWVVSYS",
      "apds": 8,
      "apds_last_30": 4,
      "avg_stake_last_active_30": 0.1419,
      "country": "ng",
      "currency": null,
      "gender": null,
      "inactive_days": 7,
      "last_active_date": "2021-01-12",
      "last_deposit_date": "2021-01-12",
      "player_value_segment": "Low",
      "prediction_date": "2021-01-20",
      "product": "sports",
      "reactivation_score_030": 0.10000000149011612,
      "reactivation_score_060": 0.14000000059604645,
      "reactivation_segment_030": "Most Unlikely",
      "reactivation_segment_060": "Most Unlikely",
      "signup_date": "2020-07-10",
      "stake_last_active_30": 4.257,
      "state": null,
      "total_ggr": 1.9599,
      "user_id": "1110225"
    },
    {
      "acquisition_source": "KSWVVSYS",
      "apds": 25,
      "apds_last_30": 4,
      "avg_stake_last_active_30": 0.046529999999999995,
      "country": "ke",
      "currency": null,
      "gender": null,
      "inactive_days": 10,
      "last_active_date": "2021-01-09",
      "last_deposit_date": "2020-12-08",
      "player_value_segment": "Low",
      "prediction_date": "2021-01-20",
      "product": "sports",
      "reactivation_score_030": 0.4000000059604645,
      "reactivation_score_060": 0.699999988079071,
      "reactivation_segment_030": "Unlikely",
      "reactivation_segment_060": "Medium",
      "signup_date": "2020-06-16",
      "stake_last_active_30": 1.3959,
      "state": null,
      "total_ggr": 1.7043,
      "user_id": "1109119"
    },
    {
      "acquisition_source": "KSWVVSYS",
      "apds": 2,
      "apds_last_30": 2,
      "avg_stake_last_active_30": 0.022619999999999998,
      "country": "ke",
      "currency": null,
      "gender": null,
      "inactive_days": 24,
      "last_active_date": "2020-12-26",
      "last_deposit_date": "2020-12-24",
      "player_value_segment": "Low",
      "prediction_date": "2021-01-20",
      "product": "sports",
      "reactivation_score_030": 0.20000000298023224,
      "reactivation_score_060": 0.23999999463558197,
      "reactivation_segment_030": "Most Unlikely",
      "reactivation_segment_060": "Most Unlikely",
      "signup_date": "2020-12-24",
      "stake_last_active_30": 0.6786,
      "state": null,
      "total_ggr": 0.6786,
      "user_id": "1108467"
    }
  ],
  "pagination": {
    "page": 1,
    "page_count": 1,
    "page_size": 5,
    "total_count": 4
  },
  "status": "success"
}

Get CRM Reactivation statistics

get

This is a generic endpoint for retrieving CRM reactivation related statistics.

You can apply any filtering you want on the CRM data, group them in many ways and apply multiple aggregations on the prediction fields.

Aggregations

By setting the aggregations parameter you can select the set of aggregations to be applied on the given fields. The following aggregation operations are supported:

  • avg: return the average value

  • sum: return the sum

Multiple aggregations

You can apply multiple aggregations at once by providing a comma separated list of aggregation operations. For example if you wanted to get the avg, and sum value of reactivation_score_030 you could simply call the endpoint with the following parameters:

aggregations=avg,sum
fields=reactivation_score_030
{
    "data": [
        {
            "avg_reactivation_score_030": 0.2025000024586916,
            "count": 4,
            "sum_reactivation_score_030": 0.8100000619888306
        }
    ],
    "status": "success"
}

Implied count

As you will notice a count is always returned no matter what aggregations or fields you select. If you run the endpoint without any parameters you simply run a count(*) on the underlying database table.

Grouping results

You can group the results by any supported field or any combination of fields, by using the group_by parameter. A comma separated list of fields to group by is expected.

Counts by segment

Imagine that you want to get the counts of users, by country and current segment for a specific prediction date. You can simply do it by using the following query parameters:

filters=prediction_date:eq:2021-07-21
group_by=reactivation_segment_030,player_value_segment

which would give the following results

{
  "data": [
    {
      "count": 3,
      "player_value_segment": "Low",
      "reactivation_segment_030": "Most Unlikely"
    },
    {
      "count": 1,
      "player_value_segment": "Low",
      "reactivation_segment_030": "Unlikely"
    },
    ...
  ],
}

Filtering the result set

Similarly to many other endpoints the stats/crm/reactivation endpoint supports filtering of the result set. By setting the filters parameter you can apply any combination of filters you may wish.

Average predictions for churn score cohorts

Assume you want to get the average, minimum and maximum APDs predictions for users with predicted churn score for the next 7 days between 0.25 and 0.5 grouped by the current player segment for a specific prediction date.

You can use the following parameters:

aggregations=avg,sum,
fields=reactivation_score_030,reactivation_score_060,reactivation_score_090,
filters=prediction_date:eq:2021-01-20,
group_by=player_value_segment

and you will get results of the form:

{
    "data": [
      {
        "avg_reactivation_score_030": 0.2025000024586916,
        "avg_reactivation_score_060": 0.4050000011920929,
        "avg_reactivation_score_090": 0.6250000149011612,
        "count": 4,
        "player_value_segment": "Low",
        "sum_reactivation_score_030": 0.8100000619888306,
        "sum_reactivation_score_060": 1.6200001239776611,
        "sum_reactivation_score_090": 2.5
      }
      ...
    ]
}

Avoid empty filters

Authorizations
Query parameters
group_bystring · enumOptional

The columns to group the results by. It should be a comma separated list with the columns to use for grouping in the format col1,col2.

Possible values:
fieldsstring · enumOptional

The columns to use in aggregations. It should be a comma separated list, e.g. predicted_apds_030,predicted_ggr_030.

Possible values:
aggregationsstring · enumOptional

The aggregations to be applied on all selected fields. You can pass more than one aggregations through a comma separated list, e.g. min,max,avg.

Possible values:
productstring · enumOptional

The type of product to get predictions for. If an operator has the CRM package for more than one products, then this must be set. Can be one of sports, casino, horses, combined. If not set it defaults to sports.

Default: sportsPossible values:
filtersstring · enumOptional

Optional filtering of the results. It expects a string adhering to the filtering format, as described in the filtering section, e.g. churn_score_007:gt:0.7;predicted_ggr_030:lt:5000.

Default: ""Possible values:
schema_versionstring · enumOptional

The underlying schema version. Some endpoints can operate on multiple internal database schemas. Must be one of the allowed values. If not set it defaults to v2.

Default: v2Possible values:
Header parameters
x-vaix-client-idstringRequired

Custom client header, the value should be the name of the group the user belongs to

x-vaix-authentication-methodstringOptional

Authentication method to be used, supported values [vaix, iam]. Defaults to vaix

Responses
200

OK

application/json
get
GET /api/stats/crm/reactivation HTTP/1.1
Host: api.vaix.ai
Authorization: Bearer YOUR_SECRET_TOKEN
x-vaix-client-id: text
Accept: */*
{
  "data": [
    {
      "count": 4
    }
  ],
  "status": "success"
}

Was this helpful?