Create a Value List
POST https://api.fraudio.com/v1/value-lists
Endpoint Overview
The Value List creation endpoint is part of our Rules Management API, designed to streamline the way you define reusable collections of values for fraud detection rules. With this endpoint, you can programmatically create a named list of values that rules can reference in their triggers, so you update values in one place instead of editing every rule.
tip
For any questions or uncertainties regarding this endpoint, our Support Team is available for assistance.
Request Parameters
Request parameters in JSON format
Toggle to view an example of request parameters in JSON format for creating a value list
json
{
"displayName": "Blocked countries",
"entries": ["ru", "kp"],
"matchType": "exact",
"slug": "blocked_countries"
}
Request parameters: Field Reference Table
| Field | Data Type | Description |
|---|---|---|
| displayName | String | Human-readable name of the value list. Required. |
| entries | Array of String | Values in the list. Required. Entries are trimmed; blank values and exact duplicates are removed. Exact-match lists support at most 5000 entries. |
| matchType | String | Comparison mode for membership checks. Required. |
| slug | String | Stable identifier used when referencing the list from a rule. Letters, digits, and underscores only ( [A-Za-z0-9_]+). Optional; if omitted, derived from displayName. |
Response Parameters
| Status Code | Status Message | Description | Schema |
|---|---|---|---|
200 | OK | Standard response for successful HTTP requests. | 200 OK - Value List creation response |
4xx, 500, 501, 502, 503, 504 | error | Various error messages for unsuccessful HTTP requests. | Problem response |
Code Samples
- Shell
- Python
- Java
- Perl
- PHP
curl -X POST 'https://api.fraudio.com/v1/value-lists' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer $ACCESS_TOKEN" \
--data-raw '{
"displayName":"Blocked countries",
"entries":["ru","kp"],
"matchType":"exact",
"slug":"blocked_countries"
}'
import json
import os
import requests
value_lists_endpoint = "https://api.fraudio.com/v1/value-lists"
access_token = os.environ["ACCESS_TOKEN"]
value_list = {
"displayName": "Blocked countries",
"entries": ["ru", "kp"],
"matchType": "exact",
"slug": "blocked_countries"
}
headers = {
"authorization": f"Bearer {access_token}",
"Content-Type": "application/json",
}
r = requests.post(value_lists_endpoint, headers=headers, data=json.dumps(value_list))
print(r.json())
package com.fraudio;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class CreateValueList {
public static void main(String[] args) throws IOException, URISyntaxException, InterruptedException {
String createValueListEndpoint = "https://api.fraudio.com/v1/value-lists";
String accessToken = System.getenv("ACCESS_TOKEN");
String valueList = "{\"displayName\":\"Blocked countries\",\"entries\":[\"ru\",\"kp\"],\"matchType\":\"exact\",\"slug\":\"blocked_countries\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI(createValueListEndpoint))
.header("authorization", String.format("Bearer %s", accessToken))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(valueList))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse < String > response = client.send(request, HttpResponse.BodyHandlers.ofString());
String responseBody = response.body();
System.out.println("Response Code: " + response.statusCode() + "\nResponse Body: " + responseBody);
}
}
use LWP::UserAgent;
use HTTP::Request::Common;
my $create_value_list_endpoint = 'https://api.fraudio.com/v1/value-lists';
my $access_token = $ENV{"ACCESS_TOKEN"};
my $value_list = '{"displayName":"Blocked countries","entries":["ru","kp"],"matchType":"exact","slug":"blocked_countries"}';
my $req = HTTP::Request -> new(POST => $create_value_list_endpoint);
$req -> header('authorization' => "Bearer $access_token", "Content-Type" => "application/json");
$req -> content($value_list);
my $ua = LWP::UserAgent -> new;
my $resp = $ua -> request($req);
my $message = $resp -> decoded_content;
print "Received reply: $message";
<?php
$create_value_list_endpoint = "https://api.fraudio.com/v1/value-lists";
$access_token = $_SERVER["ACCESS_TOKEN"];
$value_list =
"{\"displayName\":\"Blocked countries\",\"entries\":[\"ru\",\"kp\"],\"matchType\":\"exact\",\"slug\":\"blocked_countries\"}";
$options = [
"http" => [
"header" =>
"authorization: Bearer $access_token\r\n" .
"Content-Type: application/json\r\n",
"method" => "POST",
"content" => $value_list,
],
];
$context = stream_context_create($options);
$result = file_get_contents($create_value_list_endpoint, false, $context);
print $result;
?>