telnyx-email-suppressions-curllisted
Install: claude install-skill team-telnyx/ai
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
# 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
re