Soft-delete a suppression
Soft-deletes (status → removed; tombstone retained). A removed
audit event is appended unless the block was already removed
(idempotent — returns the existing row with 200 and no new event).
Mutates updated_at.
DELETE
/
email_blocks
/
{id}
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.emailBlocks.delete('id');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_blocks.delete(
"id",
)
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.EmailBlocks.Delete(
context.TODO(),
"id",
)
if err != nil {
panic(err.Error())
}
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
client.emailBlocks().delete("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
email_block = telnyx.email_blocks.delete("id")
puts(email_block)<?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 {
$email_block = $client->emailBlocks->delete(
'id',
);
var_dump($email_block);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-blocks delete \
--api-key 'My API Key' \
--id idcurl --request DELETE \
--url https://api.telnyx.com/v2/email_blocks/{id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"record_type": "email_block",
"domain_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"group_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"from": "string",
"to": "string",
"reason": "hard_bounce",
"source": "feedback",
"scope": "account",
"status": "active",
"created_at": "2024-01-23T18:10:02.574Z",
"updated_at": "2024-01-23T18:10:02.574Z",
"expires_at": "2024-01-23T18:10:02.574Z"
}
}{
"errors": [
{
"code": "10007",
"title": "Unauthorized",
"detail": "Missing authentication"
}
]
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested email block was not found"
}
]
}{
"errors": [
{
"code": "406",
"title": "Not Acceptable",
"detail": "Not Acceptable"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "can't be blank",
"source": {
"pointer": "/data/attributes/to"
}
}
]
}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
Resource UUID. Malformed UUIDs are treated as not-found (not 400).
Response
The post-deletion record (status removed).
Suppression record. Schema fields hidden by the view:
account_id, bounce_category, dsn_code, meta.
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.emailBlocks.delete('id');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_blocks.delete(
"id",
)
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.EmailBlocks.Delete(
context.TODO(),
"id",
)
if err != nil {
panic(err.Error())
}
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
client.emailBlocks().delete("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
email_block = telnyx.email_blocks.delete("id")
puts(email_block)<?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 {
$email_block = $client->emailBlocks->delete(
'id',
);
var_dump($email_block);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-blocks delete \
--api-key 'My API Key' \
--id idcurl --request DELETE \
--url https://api.telnyx.com/v2/email_blocks/{id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"record_type": "email_block",
"domain_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"group_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"from": "string",
"to": "string",
"reason": "hard_bounce",
"source": "feedback",
"scope": "account",
"status": "active",
"created_at": "2024-01-23T18:10:02.574Z",
"updated_at": "2024-01-23T18:10:02.574Z",
"expires_at": "2024-01-23T18:10:02.574Z"
}
}{
"errors": [
{
"code": "10007",
"title": "Unauthorized",
"detail": "Missing authentication"
}
]
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested email block was not found"
}
]
}{
"errors": [
{
"code": "406",
"title": "Not Acceptable",
"detail": "Not Acceptable"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "can't be blank",
"source": {
"pointer": "/data/attributes/to"
}
}
]
}