Archive a Rule
DELETE https://api.fraudio.com/v1/rules/{rule_id}
Endpoint Overview
The "Archive Rule" endpoint allows you to archive, rather than delete, a fraud detection rule. This deactivates the rule from active detection while preserving its historical data.
tip
Archiving a rule ensures it's no longer actively used for fraud detection but keeps the rule's historical data intact. If you're unsure about this action or need further insights into this endpoint, our Support Team is available to assist.
Request Parameters
Path Parameters
The endpoint requires the following path parameter:
- rule_id: The unique identifier (UUID) of the rule you wish to archive.
Example Request With Path Parameter
DELETE https://api.fraudio.com/v1/rules/123e4567-e89b-12d3-a456-426614174000
Response Parameters
Status Code | Status Message | Description | Schema |
---|---|---|---|
204 | No Content | Standard response for successful HTTP requests when archiving a rule. The server has successfully processed the request and there is no additional content to send in the response payload body. | 204 No Content - No Response Body |
404 | Not Found | Response when the specified rule ID does not exist. | Problem response |
500 , 501 , 502 , 503 , 504 | error | Various error messages for unsuccessful HTTP requests. | Problem response |
Code Samples
- Shell
- Python
- Java
- Perl
- PHP
curl -X DELETE 'https://api.fraudio.com/v1/rules/YOUR_RULE_ID_HERE' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer $ACCESS_TOKEN"
import os
import requests
rule_id = "YOUR_RULE_ID_HERE"
rules_endpoint = f"https://api.fraudio.com/v1/rules/{rule_id}"
access_token = os.environ["ACCESS_TOKEN"]
headers = {
"authorization": f"Bearer {access_token}",
"Content-Type": "application/json",
}
r = requests.delete(rules_endpoint, headers=headers)
if r.status_code == 204:
print("Rule successfully archived!")
else:
print(r.text)
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 ArchiveRule {
public static void main(String[] args) throws IOException, URISyntaxException, InterruptedException {
String ruleId = "YOUR_RULE_ID_HERE";
String ruleEndpoint = "https://api.fraudio.com/v1/rules/" + ruleId;
String accessToken = System.getenv("ACCESS_TOKEN");
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI(ruleEndpoint))
.header("authorization", String.format("Bearer %s", accessToken))
.header("Content-Type", "application/json")
.DELETE()
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.discarding());
if (response.statusCode() == 204) {
System.out.println("Rule successfully archived!");
} else {
System.out.println("Error archiving rule: " + response.body());
}
}
}
use LWP::UserAgent;
use HTTP::Request::Common;
my $rule_id = "YOUR_RULE_ID_HERE"; # Replace with your specific rule ID
my $rule_endpoint = 'https://api.fraudio.com/v1/rules/' . $rule_id;
my $access_token = $ENV{"ACCESS_TOKEN"};
my $req = HTTP::Request->new(DELETE => $rule_endpoint);
$req->header('authorization' => "Bearer $access_token", "Content-Type" => "application/json");
my $ua = LWP::UserAgent->new;
my $resp = $ua->request($req);
if ($resp->code == 204) {
print "Rule successfully archived!";
} else {
print "Error archiving rule: " . $resp->decoded_content;
}
<?php
$rule_id = "YOUR_RULE_ID_HERE"; // Replace with your specific rule ID
$rule_endpoint = "https://api.fraudio.com/v1/rules/" . $rule_id;
$access_token = $_SERVER["ACCESS_TOKEN"];
$options = [
"http" => [
"header" =>
"authorization: Bearer $access_token\r\n" .
"Content-Type: application/json\r\n",
"method" => "DELETE"
],
];
$context = stream_context_create($options);
$result = @file_get_contents($rule_endpoint, false, $context);
if ($http_response_header[0] == "HTTP/1.1 204 No Content") {
print "Rule successfully archived!";
} else {
print "Error archiving rule: " . $result;
}
?>