Skip to main content
env.MY_TELNYX is a ready-to-use, authenticated Telnyx client handle — call it like any Telnyx API client, with auth already wired in (no new Telnyx(...), no API key to manage). Calls take the shape env.MY_TELNYX.<resource>.<method>(...), using resource and method names — not raw HTTP paths:
  • <resource> — a camelCase property: messages, calls, balance, availablePhoneNumbers, …
  • <method> — a method on the resource: .send, .dial, .list, .retrieve, …
The names don’t always track the HTTP API (messages.send is POST /messages, but messages.cancelScheduled is DELETE /messages/{id}), so discover them rather than guessing from endpoints:
Each method returns the API response; list and retrieve calls expose the payload on .data.

Errors

Calls reject on API errors. Catch and inspect: