telnyx-email-domains-curllisted
Install: claude install-skill team-telnyx/ai
# Telnyx Email Domains — curl
## Installation
```text
# curl is pre-installed on macOS, Linux, and Windows 10+.
# A JSON formatter such as `python3 -m json.tool` is optional.
```
## Setup
```bash
export TELNYX_API_KEY="YOUR_API_KEY_HERE"
export TELNYX_API_BASE="https://api.telnyx.com/v2"
# Set these from API responses after creating or listing resources.
export EMAIL_DOMAIN_ID="123e4567-e89b-12d3-a456-426614174000"
export EMAIL_WEBHOOK_ID="123e4567-e89b-12d3-a456-426614174003"
```
Every request requires:
```bash
-H "Authorization: Bearer $TELNYX_API_KEY"
```
Mutation requests with JSON also require:
```bash
-H "Content-Type: application/json"
```
Use `--fail-with-body --silent --show-error` in automation so non-2xx responses
fail the command without hiding the Telnyx error body.
## Error Handling
Error responses use an `errors` array:
```json
{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "domain is invalid",
"source": {"pointer": "/data/attributes/domain"}
}
]
}
```
Common cases:
| HTTP | Meaning | Action |
|------|---------|--------|
| `400` | Invalid list query or malformed input | Fix the query; do not retry unchanged. |
| `401` | Missing or invalid API key | Fix authentication. |
| `403` | Shared domain is read-only (`10008`) or access is insufficient | Use an owned custom domain or correct permissions. |
| `404` | Domain or webhook not found (`10001`) | Re-list resources and verify both IDs. |