settings-v0
Start a cancel flow experiment
Splits the company’s customers between two published flow versions. A customer’s arm is the first 8 bytes of SHA-256 of “company_id:experiment_id:member_id”, mod 100, compared with variant_percent, so a customer sees the same version in every session of the experiment. While it runs, new sessions run the arm’s version instead of the latest published one and record the arm. Refused with 409 (experiment_running) while another experiment runs, and with 422 for versions the company has not published (unknown_flow_version) or an invalid split (invalid_experiment, or invalid parameters). Answers 404 while the company cannot use the cancel flow.
POST
/
api
/
subscription_pro
/
retention_experiments
Start a cancel flow experiment
curl --request POST \
--url https://api.fluid.app/api/subscription_pro/retention_experiments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"control_version": 2,
"variant_version": 3,
"variant_percent": 50
}
'import requests
url = "https://api.fluid.app/api/subscription_pro/retention_experiments"
payload = {
"control_version": 2,
"variant_version": 3,
"variant_percent": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({control_version: 2, variant_version: 3, variant_percent: 50})
};
fetch('https://api.fluid.app/api/subscription_pro/retention_experiments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/subscription_pro/retention_experiments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'control_version' => 2,
'variant_version' => 3,
'variant_percent' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/subscription_pro/retention_experiments"
payload := strings.NewReader("{\n \"control_version\": 2,\n \"variant_version\": 3,\n \"variant_percent\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/subscription_pro/retention_experiments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"control_version\": 2,\n \"variant_version\": 3,\n \"variant_percent\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/subscription_pro/retention_experiments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"control_version\": 2,\n \"variant_version\": 3,\n \"variant_percent\": 50\n}"
response = http.request(request)
puts response.read_body{
"retention_experiment": {
"id": 123,
"control_version": 2,
"variant_version": 2,
"variant_percent": 50,
"started_at": "2023-11-07T05:31:56Z",
"stopped_at": "2023-11-07T05:31:56Z",
"running": true
},
"status": 200,
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
Bearer token authentication
Body
application/json
⌘I
Start a cancel flow experiment
curl --request POST \
--url https://api.fluid.app/api/subscription_pro/retention_experiments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"control_version": 2,
"variant_version": 3,
"variant_percent": 50
}
'import requests
url = "https://api.fluid.app/api/subscription_pro/retention_experiments"
payload = {
"control_version": 2,
"variant_version": 3,
"variant_percent": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({control_version: 2, variant_version: 3, variant_percent: 50})
};
fetch('https://api.fluid.app/api/subscription_pro/retention_experiments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/subscription_pro/retention_experiments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'control_version' => 2,
'variant_version' => 3,
'variant_percent' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/subscription_pro/retention_experiments"
payload := strings.NewReader("{\n \"control_version\": 2,\n \"variant_version\": 3,\n \"variant_percent\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/subscription_pro/retention_experiments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"control_version\": 2,\n \"variant_version\": 3,\n \"variant_percent\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/subscription_pro/retention_experiments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"control_version\": 2,\n \"variant_version\": 3,\n \"variant_percent\": 50\n}"
response = http.request(request)
puts response.read_body{
"retention_experiment": {
"id": 123,
"control_version": 2,
"variant_version": 2,
"variant_percent": 50,
"started_at": "2023-11-07T05:31:56Z",
"stopped_at": "2023-11-07T05:31:56Z",
"running": true
},
"status": 200,
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}