List suppressions
Account-scoped list. Two mutually exclusive pagination modes:
- Offset:
page[number](default 1) +page[size](default 25, max 100).metacontainstotal_pages. - Cursor:
page[after]and/orpage[before](opaqueBase.url_encode64of{"created_at","id"}). Cannot combine withpage[number];after+beforetogether is an error.metacontainsnext_cursor/previous_cursor(omitted when their flag is false).
Sort defaults to -created_at (desc); only created_at is sortable.
A -- prefix is an error. nil/empty filter values are silently dropped.
GET
/
email_blocks
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const response of client.emailBlocks.list()) {
console.log(response);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.email_blocks.list()
print(page)
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"),
)
emailBlocks, err := client.EmailBlocks.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", emailBlocks.Data)
}
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();
var page = client.emailBlocks().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.email_blocks.list
puts(page)<?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 {
$page = $client->emailBlocks->list();
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-blocks list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/email_blocks \
--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"
}
],
"meta": {
"page_number": 0,
"page_size": 0,
"total_pages": 0,
"total_results": 0
}
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "is invalid",
"source": {
"pointer": "/filter[reason]"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unauthorized",
"detail": "Missing authentication"
}
]
}{
"errors": [
{
"code": "406",
"title": "Not Acceptable",
"detail": "Not Acceptable"
}
]
}Authorizations
Query Parameters
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const response of client.emailBlocks.list()) {
console.log(response);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.email_blocks.list()
print(page)
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"),
)
emailBlocks, err := client.EmailBlocks.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", emailBlocks.Data)
}
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();
var page = client.emailBlocks().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.email_blocks.list
puts(page)<?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 {
$page = $client->emailBlocks->list();
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-blocks list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/email_blocks \
--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"
}
],
"meta": {
"page_number": 0,
"page_size": 0,
"total_pages": 0,
"total_results": 0
}
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "is invalid",
"source": {
"pointer": "/filter[reason]"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unauthorized",
"detail": "Missing authentication"
}
]
}{
"errors": [
{
"code": "406",
"title": "Not Acceptable",
"detail": "Not Acceptable"
}
]
}