Replace sender filters for an inbox
Replaces both sender filter lists atomically. Omitting either list clears
that list. Use POST or DELETE for incremental changes.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.emailInboxes.filters.replace('inbox_id', {
allowlist: 'allowlist',
});
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.email_inboxes.filters.replace(
inbox_id="inbox_id",
allowlist="allowlist",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.EmailInboxes.Filters.Replace(
context.TODO(),
"inbox_id",
telnyx.EmailInboxeFilterReplaceParams{
Allowlist: telnyx.String("allowlist"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.emailInboxes.filters.FilterReplaceParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
FilterReplaceParams params = FilterReplaceParams.builder()
.allowlist("allowlist")
.build();
var response = client.emailInboxes().filters().replace("inbox_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.email_inboxes.filters.replace("inbox_id", allowlist: "allowlist")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->emailInboxes->filters->replace(
'inbox_id',
allowlist: 'allowlist',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-inboxes:filters replace \
--api-key 'My API Key' \
--inbox-id inbox_id \
--allowlist allowlistcurl --request PUT \
--url https://api.telnyx.com/v2/email_inboxes/{inbox_id}/filters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allowlist": [
"trusted@example.com",
"@partner.example"
],
"blocklist": [
"@spam.example"
]
}
'{
"data": {
"record_type": "email_inbox_filters",
"allowlist": [
"trusted@example.com",
"@partner.example"
],
"blocklist": [
"@spam.example"
]
}
}{
"errors": [
{
"code": "10006",
"title": "Not authorized",
"detail": "Invalid API key",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10006"
}
}
]
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested resource was not found"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "subject can't be blank",
"source": {
"pointer": "/data/attributes/subject"
}
}
]
}{
"errors": [
{
"code": "10016",
"title": "Service Unavailable",
"detail": "The email domain service is temporarily unavailable. Please try again later."
}
]
}Authorizations
Telnyx API key supplied as Authorization: Bearer <token>. In production, auth may be validated by the API gateway and forwarded via Telnyx auth headers.
Path Parameters
Email inbox UUID.
Body
The complete filter configuration. An omitted list is replaced with an empty list. Unknown keys are ignored by the controller.
500An exact sender address (user@example.com) or domain wildcard
(@example.com). Values are trimmed and normalized to lowercase.
500An exact sender address (user@example.com) or domain wildcard
(@example.com). Values are trimmed and normalized to lowercase.
Response
The inbox's current sender allowlist and blocklist.
Show child attributes
Show child attributes
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.emailInboxes.filters.replace('inbox_id', {
allowlist: 'allowlist',
});
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.email_inboxes.filters.replace(
inbox_id="inbox_id",
allowlist="allowlist",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.EmailInboxes.Filters.Replace(
context.TODO(),
"inbox_id",
telnyx.EmailInboxeFilterReplaceParams{
Allowlist: telnyx.String("allowlist"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.emailInboxes.filters.FilterReplaceParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
FilterReplaceParams params = FilterReplaceParams.builder()
.allowlist("allowlist")
.build();
var response = client.emailInboxes().filters().replace("inbox_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.email_inboxes.filters.replace("inbox_id", allowlist: "allowlist")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->emailInboxes->filters->replace(
'inbox_id',
allowlist: 'allowlist',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-inboxes:filters replace \
--api-key 'My API Key' \
--inbox-id inbox_id \
--allowlist allowlistcurl --request PUT \
--url https://api.telnyx.com/v2/email_inboxes/{inbox_id}/filters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allowlist": [
"trusted@example.com",
"@partner.example"
],
"blocklist": [
"@spam.example"
]
}
'{
"data": {
"record_type": "email_inbox_filters",
"allowlist": [
"trusted@example.com",
"@partner.example"
],
"blocklist": [
"@spam.example"
]
}
}{
"errors": [
{
"code": "10006",
"title": "Not authorized",
"detail": "Invalid API key",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10006"
}
}
]
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested resource was not found"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "subject can't be blank",
"source": {
"pointer": "/data/attributes/subject"
}
}
]
}{
"errors": [
{
"code": "10016",
"title": "Service Unavailable",
"detail": "The email domain service is temporarily unavailable. Please try again later."
}
]
}