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.
PUT
/
email_inboxes
/
{inbox_id}
/
filters
JavaScript
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.create('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.create(
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"),
)
filter, err := client.EmailInboxes.Filters.New(
context.TODO(),
"inbox_id",
telnyx.EmailInboxeFilterNewParams{
Allowlist: telnyx.String("allowlist"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", filter.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.FilterCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
FilterCreateParams params = FilterCreateParams.builder()
.allowlist("allowlist")
.build();
var response = client.emailInboxes().filters().create("inbox_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.email_inboxes.filters.create("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->create(
'inbox_id',
allowlist: 'allowlist',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-inboxes:filters create \
--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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Email inbox UUID.
Body
application/json
The complete filter configuration. An omitted list is replaced with an empty list. Unknown keys are ignored by the controller.
Maximum array length:
500An exact sender address (user@example.com) or domain wildcard
(@example.com). Values are trimmed and normalized to lowercase.
Maximum array length:
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?
⌘I
JavaScript
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.create('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.create(
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"),
)
filter, err := client.EmailInboxes.Filters.New(
context.TODO(),
"inbox_id",
telnyx.EmailInboxeFilterNewParams{
Allowlist: telnyx.String("allowlist"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", filter.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.FilterCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
FilterCreateParams params = FilterCreateParams.builder()
.allowlist("allowlist")
.build();
var response = client.emailInboxes().filters().create("inbox_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.email_inboxes.filters.create("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->create(
'inbox_id',
allowlist: 'allowlist',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-inboxes:filters create \
--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."
}
]
}