Skip to main content
The official telnyx package provides Java and Kotlin-compatible clients generated from the same OpenAPI definition as the API reference.

Requests, types, and pagination

Immutable request and response models, uploads, raw responses, and pagination.

Resource map

Search every SDK resource and method and open the matching REST endpoint.

Errors, retries, and timeouts

Handle structured errors and configure retry and timeout behavior.

Webhooks

Verify ED25519 signatures and process webhook events.

Advanced usage

Configure language-specific logging, transport, raw responses, and custom requests.

Install

Add com.telnyx.sdk:telnyx to the Gradle or Maven build using the current version published on Maven Central.

Requirements

This library requires Java 8 or later.

Initialize the client and make a request

Quickstart from the current SDK source, using TELNYX_API_KEY for authentication:

Usage

Client configuration

Configure the client using system properties or environment variables:
Or manually:
Or using a combination of the two approaches:
See this table for the available options: System properties take precedence over environment variables.
[!TIP] Don’t create more than one client in the same application. Each client has a connection pool and thread pools, which are more efficient to share between requests.

Modifying configuration

To temporarily use a modified client configuration, while reusing the same connection and thread pools, call withOptions() on any client or service:
The withOptions() method does not affect the original client or service.

Asynchronous execution

The default client is synchronous. To switch to asynchronous execution, call the async() method:
Or create an asynchronous client from the beginning:
The asynchronous client supports the same options as the synchronous one, except most methods return CompletableFutures.

Source and releases

SDK releases can follow REST API changes at different times. Check the package registry for the current version and use the resource map to confirm method availability.