Remove sender filter entries from an inbox
Removes entries from either the allowlist or blocklist. The operation is idempotent: removing an entry that is not present still returns the current filter lists.
DELETE
/
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
});
await client.emailInboxes.filters.deleteAll('inbox_id', {
entries: 'entries',
type: 'allowlist',
});import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
client.email_inboxes.filters.delete_all(
inbox_id="inbox_id",
entries="entries",
type="allowlist",
)package main
import (
"context"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.EmailInboxes.Filters.DeleteAll(
context.TODO(),
"inbox_id",
telnyx.EmailInboxeFilterDeleteAllParams{
Entries: "entries",
Type: "allowlist",
},
)
if err != nil {
panic(err.Error())
}
}
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.FilterDeleteAllParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
FilterDeleteAllParams params = FilterDeleteAllParams.builder()
.entries("entries")
.type(FilterDeleteAllParams.Type.ALLOWLIST)
.build();
client.emailInboxes().filters().deleteAll("inbox_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.email_inboxes.filters.delete_all("inbox_id", entries: "entries", type: :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->deleteAll(
'inbox_id',
entries: 'entries',
type: 'allowlist',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-inboxes:filters delete-all \
--api-key 'My API Key' \
--inbox-id inbox_id \
--type allowlist \
--entries entriescurl --request DELETE \
--url https://api.telnyx.com/v2/email_inboxes/{inbox_id}/filters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "allowlist",
"entries": [
"former-partner@example.com"
]
}
'{
"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
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
});
await client.emailInboxes.filters.deleteAll('inbox_id', {
entries: 'entries',
type: 'allowlist',
});import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
client.email_inboxes.filters.delete_all(
inbox_id="inbox_id",
entries="entries",
type="allowlist",
)package main
import (
"context"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.EmailInboxes.Filters.DeleteAll(
context.TODO(),
"inbox_id",
telnyx.EmailInboxeFilterDeleteAllParams{
Entries: "entries",
Type: "allowlist",
},
)
if err != nil {
panic(err.Error())
}
}
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.FilterDeleteAllParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
FilterDeleteAllParams params = FilterDeleteAllParams.builder()
.entries("entries")
.type(FilterDeleteAllParams.Type.ALLOWLIST)
.build();
client.emailInboxes().filters().deleteAll("inbox_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.email_inboxes.filters.delete_all("inbox_id", entries: "entries", type: :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->deleteAll(
'inbox_id',
entries: 'entries',
type: 'allowlist',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-inboxes:filters delete-all \
--api-key 'My API Key' \
--inbox-id inbox_id \
--type allowlist \
--entries entriescurl --request DELETE \
--url https://api.telnyx.com/v2/email_inboxes/{inbox_id}/filters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "allowlist",
"entries": [
"former-partner@example.com"
]
}
'{
"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."
}
]
}