api/java/telnyx-oauth-java/SKILL.md
Implement OAuth 2.0 authentication flows for Telnyx API access. This skill provides Java SDK examples.
npx skillsauth add team-telnyx/telnyx-toolkit telnyx-oauth-javaInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
// See https://github.com/team-telnyx/telnyx-java for Maven/Gradle setup
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
All examples below assume client is already initialized as shown above.
OAuth 2.0 Authorization Server Metadata (RFC 8414)
GET /.well-known/oauth-authorization-server
import com.telnyx.sdk.models.wellknown.WellKnownRetrieveAuthorizationServerMetadataParams;
import com.telnyx.sdk.models.wellknown.WellKnownRetrieveAuthorizationServerMetadataResponse;
WellKnownRetrieveAuthorizationServerMetadataResponse response = client.wellKnown().retrieveAuthorizationServerMetadata();
OAuth 2.0 Protected Resource Metadata for resource discovery
GET /.well-known/oauth-protected-resource
import com.telnyx.sdk.models.wellknown.WellKnownRetrieveProtectedResourceMetadataParams;
import com.telnyx.sdk.models.wellknown.WellKnownRetrieveProtectedResourceMetadataResponse;
WellKnownRetrieveProtectedResourceMetadataResponse response = client.wellKnown().retrieveProtectedResourceMetadata();
OAuth 2.0 authorization endpoint for the authorization code flow
GET /oauth/authorize
import com.telnyx.sdk.models.oauth.OAuthRetrieveAuthorizeParams;
OAuthRetrieveAuthorizeParams params = OAuthRetrieveAuthorizeParams.builder()
.clientId("client_id")
.redirectUri("https://example.com")
.responseType(OAuthRetrieveAuthorizeParams.ResponseType.CODE)
.build();
client.oauth().retrieveAuthorize(params);
Retrieve a paginated list of OAuth clients for the authenticated user
GET /oauth/clients
import com.telnyx.sdk.models.oauthclients.OAuthClientListPage;
import com.telnyx.sdk.models.oauthclients.OAuthClientListParams;
OAuthClientListPage page = client.oauthClients().list();
Create a new OAuth client
POST /oauth/clients — Required: name, allowed_scopes, client_type, allowed_grant_types
import com.telnyx.sdk.models.oauthclients.OAuthClientCreateParams;
import com.telnyx.sdk.models.oauthclients.OAuthClientCreateResponse;
OAuthClientCreateParams params = OAuthClientCreateParams.builder()
.addAllowedGrantType(OAuthClientCreateParams.AllowedGrantType.CLIENT_CREDENTIALS)
.addAllowedScope("admin")
.clientType(OAuthClientCreateParams.ClientType.PUBLIC)
.name("My OAuth client")
.build();
OAuthClientCreateResponse oauthClient = client.oauthClients().create(params);
Retrieve a single OAuth client by ID
GET /oauth/clients/{id}
import com.telnyx.sdk.models.oauthclients.OAuthClientRetrieveParams;
import com.telnyx.sdk.models.oauthclients.OAuthClientRetrieveResponse;
OAuthClientRetrieveResponse oauthClient = client.oauthClients().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
Update an existing OAuth client
PUT /oauth/clients/{id}
import com.telnyx.sdk.models.oauthclients.OAuthClientUpdateParams;
import com.telnyx.sdk.models.oauthclients.OAuthClientUpdateResponse;
OAuthClientUpdateResponse oauthClient = client.oauthClients().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
Delete an OAuth client
DELETE /oauth/clients/{id}
import com.telnyx.sdk.models.oauthclients.OAuthClientDeleteParams;
client.oauthClients().delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
Retrieve details about an OAuth consent token
GET /oauth/consent/{consent_token}
import com.telnyx.sdk.models.oauth.OAuthRetrieveParams;
import com.telnyx.sdk.models.oauth.OAuthRetrieveResponse;
OAuthRetrieveResponse oauth = client.oauth().retrieve("consent_token");
Retrieve a paginated list of OAuth grants for the authenticated user
GET /oauth/grants
import com.telnyx.sdk.models.oauthgrants.OAuthGrantListPage;
import com.telnyx.sdk.models.oauthgrants.OAuthGrantListParams;
OAuthGrantListPage page = client.oauthGrants().list();
Retrieve a single OAuth grant by ID
GET /oauth/grants/{id}
import com.telnyx.sdk.models.oauthgrants.OAuthGrantRetrieveParams;
import com.telnyx.sdk.models.oauthgrants.OAuthGrantRetrieveResponse;
OAuthGrantRetrieveResponse oauthGrant = client.oauthGrants().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
Revoke an OAuth grant
DELETE /oauth/grants/{id}
import com.telnyx.sdk.models.oauthgrants.OAuthGrantDeleteParams;
import com.telnyx.sdk.models.oauthgrants.OAuthGrantDeleteResponse;
OAuthGrantDeleteResponse oauthGrant = client.oauthGrants().delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
Introspect an OAuth access token to check its validity and metadata
POST /oauth/introspect — Required: token
import com.telnyx.sdk.models.oauth.OAuthIntrospectParams;
import com.telnyx.sdk.models.oauth.OAuthIntrospectResponse;
OAuthIntrospectParams params = OAuthIntrospectParams.builder()
.token("token")
.build();
OAuthIntrospectResponse response = client.oauth().introspect(params);
Retrieve the JSON Web Key Set for token verification
GET /oauth/jwks
import com.telnyx.sdk.models.oauth.OAuthRetrieveJwksParams;
import com.telnyx.sdk.models.oauth.OAuthRetrieveJwksResponse;
OAuthRetrieveJwksResponse response = client.oauth().retrieveJwks();
Register a new OAuth client dynamically (RFC 7591)
POST /oauth/register
import com.telnyx.sdk.models.oauth.OAuthRegisterParams;
import com.telnyx.sdk.models.oauth.OAuthRegisterResponse;
OAuthRegisterResponse response = client.oauth().register();
Exchange authorization code, client credentials, or refresh token for access token
POST /oauth/token — Required: grant_type
import com.telnyx.sdk.models.oauth.OAuthTokenParams;
import com.telnyx.sdk.models.oauth.OAuthTokenResponse;
OAuthTokenParams params = OAuthTokenParams.builder()
.grantType(OAuthTokenParams.GrantType.CLIENT_CREDENTIALS)
.build();
OAuthTokenResponse response = client.oauth().token(params);
tools
Build cross-platform VoIP calling apps with React Native using Telnyx Voice SDK. High-level reactive API with automatic lifecycle management, CallKit/ConnectionService integration, and push notifications. Use for mobile VoIP apps with minimal setup.
tools
Build browser-based VoIP calling apps using Telnyx WebRTC JavaScript SDK. Covers authentication, voice calls, events, debugging, call quality metrics, and AI Agent integration. Use for web-based real-time communication.
tools
Build VoIP calling apps on iOS using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, CallKit integration, PushKit/APNS push notifications, call quality metrics, and AI Agent integration. Use when implementing real-time voice communication on iOS.
tools
Build cross-platform VoIP calling apps with Flutter using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, push notifications (FCM + APNS), call quality metrics, and AI Agent integration. Works on Android, iOS, and Web.