Telnyx Email Suppressions Curl 标志

Telnyx Email Suppressions Curl

组织
team-telnyx
telnyx-email-suppressions-curl

Manage email suppressions (blocks), import and export suppression lists, and manage unsubscribe groups. Use for deliverability compliance and bounce handling.

Add to TypingMind

概览

发布者team-telnyx
代码仓库ai
技能名称telnyx-email-suppressions-curl
星标数
217
复刻数
21
附带文件
1
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 1 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 team-telnyx 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Telnyx Email Suppressions Curl AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/team-telnyx/ai/tree/main/providers/claude/plugins/telnyx-email/skills/telnyx-email-suppressions-curl
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/team-telnyx/ai.git /tmp/ai
mkdir -p .claude/skills
cp -r /tmp/ai/providers/claude/plugins/telnyx-email/skills/telnyx-email-suppressions-curl .claude/skills/telnyx-email-suppressions-curl
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Telnyx Email Suppressions Curl,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Telnyx Email Suppressions Curl。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Telnyx Email Suppressions Curl 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Telnyx Email Suppressions - curl

Installation

text
# curl is pre-installed on macOS, Linux, and Windows 10+
# jq is required for the import polling examples below:
#   macOS: brew install jq
#   Debian/Ubuntu: sudo apt-get install jq

Setup

bash
export TELNYX_API_KEY="YOUR_API_KEY_HERE"

All examples below use $TELNYX_API_KEY for authentication and the API base URL https://api.telnyx.com/v2.

Error Handling

All API calls can fail with network errors, authentication errors (401), or framework errors (406). List-query validation failures return 400, resource lookups can return 404, and JSON body validation failures normally return 422. Inspect the HTTP status and the top-level .errors array before continuing:

bash
response_file=$(mktemp)
status=$(curl --silent --show-error \
  --output "$response_file" \
  --write-out '%{http_code}' \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/email_blocks")

if [ "$status" -lt 200 ] || [ "$status" -ge 300 ]; then
  printf 'Telnyx API error (HTTP %s):\n' "$status" >&2
  jq . "$response_file" >&2
  rm -f "$response_file"
  exit 1
fi
jq . "$response_file"
rm -f "$response_file"

Common statuses are 400 malformed query or import, 401 invalid API key, 404 resource not found, 409 group still has active suppressions, 413 import too large, and 422 invalid request attributes. A successful delete may return 204 No Content; do not attempt to parse that response as JSON.

Important Notes

  • Account isolation: Every lookup is scoped to the authenticated account. A malformed UUID or a UUID owned by another account is reported as 404.
  • Normalized addresses: Recipient addresses are trimmed and lower-cased. The from address on a manual block is also normalized.
  • Pagination: Most list operations use page[number] and page[size] (maximum 100). The main block list also supports opaque cursors. Do not combine offset and cursor modes.
  • URL encoding: Percent-encode an email address placed in a URL path. For example, use alice%40example.com, not an untrusted raw string.
  • Idempotency: Creating a block or adding a group suppression returns 200 when the matching suppression already exists and 201 when a row is created.

Operational Caveats

  • POST /v2/email_blocks always creates reason: manual_block with source: manual. Customers cannot use this endpoint to create hard_bounce, spam_complaint, or invalid suppressions; caller-supplied reason and source are ignored.
  • Scope is server-derived as account, domain, or address, never customer-set: no domain_id and no from gives account; domain_id without from gives domain; a from address gives address scope.
  • unsubscribe and manual_block are overridable at send time with ignore_suppression: true. hard_bounce, spam_complaint, and invalid are not overridable. Bypassing an overridable suppression should be deliberate and auditable.
  • Import is asynchronous. POST /v2/email_blocks/import returns 202 and a job ID; poll GET /v2/email_blocks/import/{id} until completed or failed. Import behavior for scoped suppressions may vary. Check the import result for the actual scope assigned.
  • Export is synchronous and streams CSV directly. It does not create a job.
  • Deleting a block is a soft delete: the row remains as a tombstone with status: removed. Recreating the same removed suppression reactivates it.
  • The expires_at field is available for setting an expiration timestamp on suppressions.
  • Check both error_count and skipped_count in the import response for rejected entries.
  • A group suppression prevents sending to that address for every campaign that uses the unsubscribe group. It is not an account-wide unsubscribe for campaigns that do not use that group.

Reference Use Rules

Do not invent Telnyx parameters, enums, response fields, import counters, or CSV columns.

Core Tasks

List suppressions

Use offset pagination for page-oriented tools or cursor pagination for sequential traversal without page-number offsets.

GET /v2/email_blocks

ParameterTypeRequiredDescription
page[number]integerNoOffset page, default 1. Do not combine with a cursor.
page[size]integerNo1-100, default 25.
page[after]stringNoOpaque next-page cursor. Exclusive with page[number] and page[before].
page[before]stringNoOpaque previous-page cursor. Exclusive with page[number] and page[after].
sortenumNocreated_at or -created_at (default).
filter[reason]enumNoExact reason match.
filter[domain_id]UUIDNoExact domain ID match.
filter[created_after]date-timeNoMatch created_at > value.
filter[created_before]date-timeNoMatch created_at < value.
bash
curl --get --silent --show-error \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  --data-urlencode 'page[size]=100' \
  --data-urlencode 'filter[reason]=hard_bounce' \
  --data-urlencode 'sort=-created_at' \
  "https://api.telnyx.com/v2/email_blocks"

Offset responses expose .meta.total_pages; cursor responses expose .meta.has_next and, when another page exists, .meta.next_cursor. Pass the returned cursor unchanged.

Create a manual suppression

POST /v2/email_blocks

ParameterTypeRequiredDescription
tostringYesRecipient address; trimmed and lower-cased by the server.
domain_idUUID or nullNoDomain context; omit/null for account scope.
fromstring or nullNoSender context; a value produces address scope.
expires_atdate-time or nullNoExpiration timestamp for the suppression.
bash
curl --silent --show-error \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "blocked@example.com"
  }' \
  "https://api.telnyx.com/v2/email_blocks"

The response is .data with forced reason: manual_block, source: manual, a server-derived scope, and status: active. Do not send scope, group_id, bounce_category, dsn_code, or meta to this public operation.

Export suppressions as CSV

GET /v2/email_blocks/export

bash
curl --get --silent --show-error \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Accept: text/csv" \
  --data-urlencode 'filter[created_after]=2026-01-01T00:00:00Z' \
  --output email_blocks_export.csv \
  "https://api.telnyx.com/v2/email_blocks/export"

The 200 response is the CSV stream itself. Filters supported by the list endpoint affect export. Although sort and page[*] are parsed and invalid values can return 400, valid values are ignored; export always streams every matching row ordered by created_at ASC, id ASC.

Start an asynchronous CSV import

POST /v2/email_blocks/import

bash
curl --silent --show-error \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Accept: application/json" \
  -F 'file=@email_blocks.csv;type=text/csv' \
  -F 'block_ttl_days=30' \
  "https://api.telnyx.com/v2/email_blocks/import"

A valid request returns 202 with .data.id and .data.status equal to pending. CSV content may not exceed 25 MiB or 250,000 rows. Provider format is auto-detected as sendgrid, mailgun, ses, or generic. block_ttl_days applies only to imported manual_block rows.

Poll an import job

GET /v2/email_blocks/import/{id}

bash
IMPORT_ID="00000000-0000-0000-0000-000000000000"

while :; do
  body=$(curl --silent --show-error \
    -H "Authorization: Bearer $TELNYX_API_KEY" \
    "https://api.telnyx.com/v2/email_blocks/import/$IMPORT_ID") || exit 1
  state=$(printf '%s' "$body" | jq -r '.data.status')
  printf 'import status: %s\n' "$state"
  case "$state" in
    completed)
      printf '%s' "$body" | jq '.data | {
        processed_rows, created_count, existing_count,
        skipped_count, error_count, errors
      }'
      break
      ;;
    failed)
      printf '%s' "$body" | jq '.data | {status, failure_reason}' >&2
      exit 1
      ;;
    pending|processing) sleep 2 ;;
    *) printf 'unexpected import status: %s\n' "$state" >&2; exit 1 ;;
  esac
done

Completion counters are omitted until status is completed; failure_reason is only present on failure. Check both error_count and skipped_count in the import response for rejected entries, and inspect errors when present.

Retrieve a suppression

GET /v2/email_blocks/{id}

bash
BLOCK_ID="00000000-0000-0000-0000-000000000000"
curl --silent --show-error \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/email_blocks/$BLOCK_ID"

Primary response fields are .data.id, .data.to, .data.from, .data.domain_id, .data.group_id, .data.reason, .data.source, .data.scope, .data.status, .data.expires_at, .data.created_at, and .data.updated_at.

Soft-delete a suppression

DELETE /v2/email_blocks/{id}

bash
BLOCK_ID="00000000-0000-0000-0000-000000000000"
curl --silent --show-error \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/email_blocks/$BLOCK_ID"

This returns 200 with the tombstone in .data; verify .data.status == "removed". Repeating the delete is idempotent and does not append another audit event.

List a suppression's audit events

GET /v2/email_blocks/{id}/events

bash
BLOCK_ID="00000000-0000-0000-0000-000000000000"
curl --get --silent --show-error \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  --data-urlencode 'page[number]=1' \
  --data-urlencode 'page[size]=50' \
  "https://api.telnyx.com/v2/email_blocks/$BLOCK_ID/events"

Events are newest first and can be created, removed, expired, or override_used. This endpoint has offset pagination only and a default page size of 50; it has no filters, sort, or cursor parameters.

List unsubscribe groups

GET /v2/email_unsubscribe_groups

bash
curl --get --silent --show-error \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  --data-urlencode 'page[number]=1' \
  --data-urlencode 'page[size]=25' \
  "https://api.telnyx.com/v2/email_unsubscribe_groups"

Groups use offset pagination only and fixed newest-first ordering.

Create an unsubscribe group

POST /v2/email_unsubscribe_groups

bash
curl --silent --show-error \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product announcements",
    "description": "Optional opt-out category for product email"
  }' \
  "https://api.telnyx.com/v2/email_unsubscribe_groups"

name is required, non-empty, and at most 255 characters. A successful create returns 201 and the group in .data.

Retrieve an unsubscribe group

GET /v2/email_unsubscribe_groups/{id}

bash
GROUP_ID="00000000-0000-0000-0000-000000000000"
curl --silent --show-error \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/email_unsubscribe_groups/$GROUP_ID"

Update an unsubscribe group

Only name and description are mutable. This is a partial update; PUT is not routed.

PATCH /v2/email_unsubscribe_groups/{id}

bash
GROUP_ID="00000000-0000-0000-0000-000000000000"
curl --silent --show-error \
  -X PATCH \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Announcements and release notes"
  }' \
  "https://api.telnyx.com/v2/email_unsubscribe_groups/$GROUP_ID"

Delete an unsubscribe group

DELETE /v2/email_unsubscribe_groups/{id}

bash
GROUP_ID="00000000-0000-0000-0000-000000000000"
curl --silent --show-error \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/email_unsubscribe_groups/$GROUP_ID"

A successful delete returns 204. If active group suppressions remain, the request returns 409. Either remove them first or deliberately force the delete:

bash
curl --get --silent --show-error \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  --data-urlencode 'force=true' \
  "https://api.telnyx.com/v2/email_unsubscribe_groups/$GROUP_ID"

force=true soft-deletes active group suppressions, clears their group links, appends removal events, and then hard-deletes the group in one transaction.

List suppressions in a group

GET /v2/email_unsubscribe_groups/{id}/suppressions

bash
GROUP_ID="00000000-0000-0000-0000-000000000000"
curl --get --silent --show-error \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  --data-urlencode 'page[number]=1' \
  --data-urlencode 'page[size]=100' \
  "https://api.telnyx.com/v2/email_unsubscribe_groups/$GROUP_ID/suppressions"

Rows use the standard email-block shape with .group_id set to this group. This list supports offset pagination only; no filters, sort, or cursor.

Add a group suppression

POST /v2/email_unsubscribe_groups/{id}/suppressions

bash
GROUP_ID="00000000-0000-0000-0000-000000000000"
curl --silent --show-error \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "subscriber@example.com"
  }' \
  "https://api.telnyx.com/v2/email_unsubscribe_groups/$GROUP_ID/suppressions"

Only to is read. The server forces reason: unsubscribe, source: manual, and this group's group_id. A duplicate is idempotent and returns 200.

Remove a group suppression

DELETE /v2/email_unsubscribe_groups/{id}/suppressions/{email}

bash
GROUP_ID="00000000-0000-0000-0000-000000000000"
# The email path segment is percent-encoded.
EMAIL_PATH="subscriber%40example.com"
curl --silent --show-error \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/email_unsubscribe_groups/$GROUP_ID/suppressions/$EMAIL_PATH"

A successful removal returns 204 and soft-deletes every active matching row for the normalized address in that group. A repeat returns 404 because no active matching group suppression remains.

Webhooks

Email webhooks are configured at the domain level, not on an individual suppression. Create a subscription with POST /email_domains/{id}/webhooks using the https://api.telnyx.com/v2 base URL. The suppression-related event names in the current OpenAPI EmailWebhookEvent enum are:

EventUse in a suppression workflow
email.bouncedProcess a bounced-delivery outcome.
email.failedProcess a terminal delivery failure.
email.complainedProcess a recipient complaint.
email.unsubscribedProcess a recipient unsubscribe action.
bash
DOMAIN_ID="00000000-0000-0000-0000-000000000000"
curl --silent --show-error \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/webhooks/email",
    "events": ["email.bounced", "email.failed", "email.complained", "email.unsubscribed"]
  }' \
  "https://api.telnyx.com/v2/email_domains/$DOMAIN_ID/webhooks"

Verify signatures before parsing

Telnyx signs webhook requests with Ed25519. Read the telnyx-signature-ed25519 and telnyx-timestamp headers, and retain the exact raw request body bytes. Do not parse or re-serialize the JSON before verification.

  1. Reject a missing or malformed timestamp, signature, or body.
  2. Reject a timestamp more than 5 minutes outside the server clock.
  3. Verify the Ed25519 signature over telnyx-timestamp + "|" + raw_body with the Telnyx public key. Ed25519 verification is not HMAC validation.
  4. Parse the JSON only after the signature and timestamp are valid.

Deduplicate and acknowledge quickly

  • Deduplicate by event ID with an atomic uniqueness check before applying side effects. Treat an already-seen event as successfully handled.
  • Enqueue slow work and return a 2xx response within 10 seconds.
  • Telnyx retries on timeout or non-2xx. Keep your endpoint idempotent.

Additional Operations

Use the core tasks above first. All 16 reachable suppression and unsubscribe group operations are indexed here with their exact HTTP endpoints. Use references/api-details.md for full optional parameters, response schemas, status codes, and operation IDs.

OperationSDK methodEndpointUse whenRequired params
List suppressionsHTTP onlyGET /email_blocksInspect suppressions or select a block before another action.None
Create a manual suppressionHTTP onlyPOST /email_blocksAdd a manual recipient suppression.to
Export suppressions as CSVHTTP onlyGET /email_blocks/exportDownload matching suppressions as CSV.None
Start a CSV importHTTP onlyPOST /email_blocks/importUpload suppressions for asynchronous import.file
Poll an import jobHTTP onlyGET /email_blocks/import/{id}Check whether an asynchronous import completed or failed.id
Retrieve a suppressionHTTP onlyGET /email_blocks/{id}Fetch one suppression by ID.id
Soft-delete a suppressionHTTP onlyDELETE /email_blocks/{id}Remove an existing suppression.id
List suppression audit eventsHTTP onlyGET /email_blocks/{id}/eventsInspect the history of one suppression.id
List unsubscribe groupsHTTP onlyGET /email_unsubscribe_groupsInspect available unsubscribe groups.None
Create an unsubscribe groupHTTP onlyPOST /email_unsubscribe_groupsCreate a campaign-level unsubscribe category.name
Retrieve an unsubscribe groupHTTP onlyGET /email_unsubscribe_groups/{id}Fetch one unsubscribe group by ID.id
Update an unsubscribe groupHTTP onlyPATCH /email_unsubscribe_groups/{id}Change a group's name or description.id
Delete an unsubscribe groupHTTP onlyDELETE /email_unsubscribe_groups/{id}Remove an unsubscribe group.id
List group suppressionsHTTP onlyGET /email_unsubscribe_groups/{id}/suppressionsInspect recipients suppressed in one group.id
Add a group suppressionHTTP onlyPOST /email_unsubscribe_groups/{id}/suppressionsSuppress a recipient in one unsubscribe group.id, to
Remove a group suppressionHTTP onlyDELETE /email_unsubscribe_groups/{id}/suppressions/{email}Remove a recipient suppression from one group.id, email

For exhaustive parameter behavior, CSV columns and limitations, response schemas, status codes, and operation IDs, see references/api-details.md.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Telnyx Email Suppressions Curl AI 技能有什么作用?

Manage email suppressions (blocks), import and export suppression lists, and manage unsubscribe groups. Use for deliverability compliance and bounce handling.

为什么在 TypingMind 中使用 Telnyx Email Suppressions Curl?

因为您只需安装一次,就能搭配任何模型使用。Telnyx Email Suppressions Curl 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Telnyx Email Suppressions Curl?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/team-telnyx/ai/tree/main/providers/claude/plugins/telnyx-email/skills/telnyx-email-suppressions-curl。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Telnyx Email Suppressions Curl?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Telnyx Email Suppressions Curl 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Telnyx Email Suppressions Curl 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Telnyx Email Suppressions Curl AI 技能免费吗?

是的。team-telnyx 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇