{
"SubscriberId": "SID-C7AB61E0-9AD9-4512-ACA8-EDA284131441",
"Phone": "+1234567890",
"FilterMode": "ACTIVE",
"AllowedContacts": ["+1111111111", "+2222222222"],
"BlockedContacts": ["+3333333333"],
"KeywordFilter": "{\"CustomKeywords\":[\"inappropriate\",\"banned\"],\"SystemKeywords\":{\"Profanity\":[\"word1\",\"word2\"],\"Violence\":[\"threat1\"]},\"SeverityMap\":{\"Word1\":\"HIGH\",\"Inappropriate\":\"MEDIUM\"}}",
"NotificationPhones": ["+9999999999"],
"ApplyToOutbound": true,
"ApplyToInbound": true,
"BlockUnknownNumbers": true,
"BlockLinks": true,
"BlockMedia": true
}curl -X POST https://api.telegent.com/v1.0/subscribers/message-filter \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"SubscriberId": "SID-C7AB61E0-9AD9-4512-ACA8-EDA284131441",
"Phone": "+1234567890",
"FilterMode": "ACTIVE",
"AllowedContacts": ["+1111111111", "+2222222222"],
"BlockedContacts": ["+3333333333"],
"NotificationPhones": ["+9999999999"],
"ApplyToOutbound": true,
"ApplyToInbound": true,
"BlockUnknownNumbers": true,
"BlockLinks": true,
"BlockMedia": true
}'import requests
url = "https://api.telegent.com/v1.0/subscribers/message-filter"
payload = {
"SubscriberId": "TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441",
"Phone": "+1234567890",
"FilterMode": "ACTIVE",
"AllowedContacts": ["<string>"],
"BlockedContacts": ["<string>"],
"KeywordFilter": "<string>",
"NotificationPhones": ["<string>"],
"ApplyToOutbound": True,
"ApplyToInbound": True,
"BlockUnknownNumbers": True,
"BlockLinks": True,
"BlockMedia": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
SubscriberId: 'TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441',
Phone: '+1234567890',
FilterMode: 'ACTIVE',
AllowedContacts: ['<string>'],
BlockedContacts: ['<string>'],
KeywordFilter: '<string>',
NotificationPhones: ['<string>'],
ApplyToOutbound: true,
ApplyToInbound: true,
BlockUnknownNumbers: true,
BlockLinks: true,
BlockMedia: true
})
};
fetch('https://api.telegent.com/v1.0/subscribers/message-filter', 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.telegent.com/v1.0/subscribers/message-filter",
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([
'SubscriberId' => 'TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441',
'Phone' => '+1234567890',
'FilterMode' => 'ACTIVE',
'AllowedContacts' => [
'<string>'
],
'BlockedContacts' => [
'<string>'
],
'KeywordFilter' => '<string>',
'NotificationPhones' => [
'<string>'
],
'ApplyToOutbound' => true,
'ApplyToInbound' => true,
'BlockUnknownNumbers' => true,
'BlockLinks' => true,
'BlockMedia' => true
]),
CURLOPT_HTTPHEADER => [
"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.telegent.com/v1.0/subscribers/message-filter"
payload := strings.NewReader("{\n \"SubscriberId\": \"TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441\",\n \"Phone\": \"+1234567890\",\n \"FilterMode\": \"ACTIVE\",\n \"AllowedContacts\": [\n \"<string>\"\n ],\n \"BlockedContacts\": [\n \"<string>\"\n ],\n \"KeywordFilter\": \"<string>\",\n \"NotificationPhones\": [\n \"<string>\"\n ],\n \"ApplyToOutbound\": true,\n \"ApplyToInbound\": true,\n \"BlockUnknownNumbers\": true,\n \"BlockLinks\": true,\n \"BlockMedia\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.telegent.com/v1.0/subscribers/message-filter")
.header("Content-Type", "application/json")
.body("{\n \"SubscriberId\": \"TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441\",\n \"Phone\": \"+1234567890\",\n \"FilterMode\": \"ACTIVE\",\n \"AllowedContacts\": [\n \"<string>\"\n ],\n \"BlockedContacts\": [\n \"<string>\"\n ],\n \"KeywordFilter\": \"<string>\",\n \"NotificationPhones\": [\n \"<string>\"\n ],\n \"ApplyToOutbound\": true,\n \"ApplyToInbound\": true,\n \"BlockUnknownNumbers\": true,\n \"BlockLinks\": true,\n \"BlockMedia\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telegent.com/v1.0/subscribers/message-filter")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"SubscriberId\": \"TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441\",\n \"Phone\": \"+1234567890\",\n \"FilterMode\": \"ACTIVE\",\n \"AllowedContacts\": [\n \"<string>\"\n ],\n \"BlockedContacts\": [\n \"<string>\"\n ],\n \"KeywordFilter\": \"<string>\",\n \"NotificationPhones\": [\n \"<string>\"\n ],\n \"ApplyToOutbound\": true,\n \"ApplyToInbound\": true,\n \"BlockUnknownNumbers\": true,\n \"BlockLinks\": true,\n \"BlockMedia\": true\n}"
response = http.request(request)
puts response.read_body{
"FilterId": "MFID-7435d672-a2d0-451e-ab62-45499f5bc7a1",
"SubscriberId": "TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441",
"Phone": "+1234567890",
"FilterMode": "ACTIVE",
"AllowedContacts": [
"+1111111111",
"+2222222222"
],
"BlockedContacts": [
"+3333333333"
],
"KeywordFilter": "\"CustomKeywords\":[\"inappropriate\",\"banned\"],\"SystemKeywords\":{\"Profanity\":[\"word1\",\"word2\"],\"Violence\":[\"threat1\"]},\"SeverityMap\":{\"Word1\":\"HIGH\",\"Inappropriate\":\"MEDIUM\"}",
"NotificationPhones": [
"+9999999999"
],
"ApplyToOutbound": true,
"ApplyToInbound": true,
"BlockUnknownNumbers": true,
"BlockLinks": true,
"BlockMedia": true
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}Create Message Filter
Create a new message filter that controls what messages a subscriber can send and receive.
Prerequisites:
- Bearer token —
POST /v1.0/oauth2/tokens - An existing Subscriber (
TSUID-) —POST /v1.0/subscribers/create - AI Guardian enabled for messages —
POST /v1.0/subscribers/guardian-features
What this does: Creates a filter and returns a MessageFilterId (MFID-). The filter applies to the specified phone number. Configure mode (ACTIVE/MONITOR_ONLY/INACTIVE), allowed/blocked contacts, keyword rules, and restrictions on links, media, and unknown numbers. The filter takes effect immediately.
Next steps:
- Verify it was saved —
GET /v1.0/subscribers/message-filter - Add trusted contacts that bypass filtering —
POST /v1.0/subscribers/message-filter/allowed-contacts/add - Add senders to silently drop —
POST /v1.0/subscribers/message-filter/blocked-contacts/add - Review configured keywords —
GET /v1.0/subscribers/message-filter/keywords - Update later —
POST /v1.0/subscribers/message-filter/update
{
"SubscriberId": "SID-C7AB61E0-9AD9-4512-ACA8-EDA284131441",
"Phone": "+1234567890",
"FilterMode": "ACTIVE",
"AllowedContacts": ["+1111111111", "+2222222222"],
"BlockedContacts": ["+3333333333"],
"KeywordFilter": "{\"CustomKeywords\":[\"inappropriate\",\"banned\"],\"SystemKeywords\":{\"Profanity\":[\"word1\",\"word2\"],\"Violence\":[\"threat1\"]},\"SeverityMap\":{\"Word1\":\"HIGH\",\"Inappropriate\":\"MEDIUM\"}}",
"NotificationPhones": ["+9999999999"],
"ApplyToOutbound": true,
"ApplyToInbound": true,
"BlockUnknownNumbers": true,
"BlockLinks": true,
"BlockMedia": true
}curl -X POST https://api.telegent.com/v1.0/subscribers/message-filter \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"SubscriberId": "SID-C7AB61E0-9AD9-4512-ACA8-EDA284131441",
"Phone": "+1234567890",
"FilterMode": "ACTIVE",
"AllowedContacts": ["+1111111111", "+2222222222"],
"BlockedContacts": ["+3333333333"],
"NotificationPhones": ["+9999999999"],
"ApplyToOutbound": true,
"ApplyToInbound": true,
"BlockUnknownNumbers": true,
"BlockLinks": true,
"BlockMedia": true
}'import requests
url = "https://api.telegent.com/v1.0/subscribers/message-filter"
payload = {
"SubscriberId": "TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441",
"Phone": "+1234567890",
"FilterMode": "ACTIVE",
"AllowedContacts": ["<string>"],
"BlockedContacts": ["<string>"],
"KeywordFilter": "<string>",
"NotificationPhones": ["<string>"],
"ApplyToOutbound": True,
"ApplyToInbound": True,
"BlockUnknownNumbers": True,
"BlockLinks": True,
"BlockMedia": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
SubscriberId: 'TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441',
Phone: '+1234567890',
FilterMode: 'ACTIVE',
AllowedContacts: ['<string>'],
BlockedContacts: ['<string>'],
KeywordFilter: '<string>',
NotificationPhones: ['<string>'],
ApplyToOutbound: true,
ApplyToInbound: true,
BlockUnknownNumbers: true,
BlockLinks: true,
BlockMedia: true
})
};
fetch('https://api.telegent.com/v1.0/subscribers/message-filter', 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.telegent.com/v1.0/subscribers/message-filter",
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([
'SubscriberId' => 'TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441',
'Phone' => '+1234567890',
'FilterMode' => 'ACTIVE',
'AllowedContacts' => [
'<string>'
],
'BlockedContacts' => [
'<string>'
],
'KeywordFilter' => '<string>',
'NotificationPhones' => [
'<string>'
],
'ApplyToOutbound' => true,
'ApplyToInbound' => true,
'BlockUnknownNumbers' => true,
'BlockLinks' => true,
'BlockMedia' => true
]),
CURLOPT_HTTPHEADER => [
"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.telegent.com/v1.0/subscribers/message-filter"
payload := strings.NewReader("{\n \"SubscriberId\": \"TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441\",\n \"Phone\": \"+1234567890\",\n \"FilterMode\": \"ACTIVE\",\n \"AllowedContacts\": [\n \"<string>\"\n ],\n \"BlockedContacts\": [\n \"<string>\"\n ],\n \"KeywordFilter\": \"<string>\",\n \"NotificationPhones\": [\n \"<string>\"\n ],\n \"ApplyToOutbound\": true,\n \"ApplyToInbound\": true,\n \"BlockUnknownNumbers\": true,\n \"BlockLinks\": true,\n \"BlockMedia\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.telegent.com/v1.0/subscribers/message-filter")
.header("Content-Type", "application/json")
.body("{\n \"SubscriberId\": \"TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441\",\n \"Phone\": \"+1234567890\",\n \"FilterMode\": \"ACTIVE\",\n \"AllowedContacts\": [\n \"<string>\"\n ],\n \"BlockedContacts\": [\n \"<string>\"\n ],\n \"KeywordFilter\": \"<string>\",\n \"NotificationPhones\": [\n \"<string>\"\n ],\n \"ApplyToOutbound\": true,\n \"ApplyToInbound\": true,\n \"BlockUnknownNumbers\": true,\n \"BlockLinks\": true,\n \"BlockMedia\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telegent.com/v1.0/subscribers/message-filter")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"SubscriberId\": \"TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441\",\n \"Phone\": \"+1234567890\",\n \"FilterMode\": \"ACTIVE\",\n \"AllowedContacts\": [\n \"<string>\"\n ],\n \"BlockedContacts\": [\n \"<string>\"\n ],\n \"KeywordFilter\": \"<string>\",\n \"NotificationPhones\": [\n \"<string>\"\n ],\n \"ApplyToOutbound\": true,\n \"ApplyToInbound\": true,\n \"BlockUnknownNumbers\": true,\n \"BlockLinks\": true,\n \"BlockMedia\": true\n}"
response = http.request(request)
puts response.read_body{
"FilterId": "MFID-7435d672-a2d0-451e-ab62-45499f5bc7a1",
"SubscriberId": "TSUID-C7AB61E0-9AD9-4512-ACA8-EDA284131441",
"Phone": "+1234567890",
"FilterMode": "ACTIVE",
"AllowedContacts": [
"+1111111111",
"+2222222222"
],
"BlockedContacts": [
"+3333333333"
],
"KeywordFilter": "\"CustomKeywords\":[\"inappropriate\",\"banned\"],\"SystemKeywords\":{\"Profanity\":[\"word1\",\"word2\"],\"Violence\":[\"threat1\"]},\"SeverityMap\":{\"Word1\":\"HIGH\",\"Inappropriate\":\"MEDIUM\"}",
"NotificationPhones": [
"+9999999999"
],
"ApplyToOutbound": true,
"ApplyToInbound": true,
"BlockUnknownNumbers": true,
"BlockLinks": true,
"BlockMedia": true
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}Body
Controls how the filter behaves. ACTIVE: rules are enforced — messages that violate the filter are blocked. MONITOR_ONLY: violations are logged and notifications are sent, but messages are still delivered. INACTIVE: filter is paused and has no effect.
ACTIVE, MONITOR_ONLY, INACTIVE "ACTIVE"
Stringified JSON defining keyword rules. Structure: {"CustomKeywords":[...],"SystemKeywords":{"Profanity":[...],"Violence":[...]},"SeverityMap":{"keyword":"HIGH|MEDIUM|LOW"}}. CustomKeywords are user-added words; SystemKeywords are platform-provided categories; SeverityMap assigns a risk level to each term.
Response
Message Filter Created
The response is of type object.