/telnyx-messaging-hosted-java
Set up hosted SMS numbers, toll-free verification, and RCS messaging. Use when migrating numbers or enabling rich messaging features. This skill provides Java SDK examples.
$ npx -y skills add team-telnyx/ai --skill telnyx-messaging-hosted-java --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/telnyx-messaging-hosted-java
Context preview
The summary Claude sees to decide when to auto-load this skill.
Set up hosted SMS numbers, toll-free verification, and RCS messaging. Use when migrating numbers or enabling rich messaging features. This skill provides Java SDK examples.
SKILL.md
telnyx-messaging-hosted-java.SKILL.mdname: telnyx-messaging-hosted-java
description: >-
Set up hosted SMS numbers, toll-free verification, and RCS messaging. Use when
migrating numbers or enabling rich messaging features. This skill provides
Java SDK examples.
metadata:
author: telnyx
product: messaging-hosted
language: java
generated_by: telnyx-openapi-pipeline
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
Telnyx Messaging Hosted - Java
Installation
<!-- Maven -->
<dependency>
<groupId>com.telnyx.sdk</groupId>
<artifactId>telnyx</artifactId>
<version>6.84.0</version>
</dependency>
// Gradle
implementation("com.telnyx.sdk:telnyx:6.84.0")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.
Error Handling
All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:
import com.telnyx.sdk.errors.TelnyxServiceException;
try {
var result = client.messages().send(params);
} catch (TelnyxServiceException e) {
System.err.println("API error " + e.statusCode() + ": " + e.getMessage());
if (e.statusCode() == 422) {
System.err.println("Validation error — check required fields and formats");
} else if (e.statusCode() == 429) {
// Rate limited — wait and retry with exponential backoff
Thread.sleep(1000);
}
}Common error codes: `401` invalid API key, `403` insufficient permissions, `404` resource not found, `422` validation error (check field formats), `429` rate limited (retry with exponential backoff).
Important Notes
- **Phone numbers** must be in E.164 format (e.g., `+13125550001`). Include the `+` prefix and country code. No spaces, dashes, or parentheses.
- **Pagination:** List methods return a page. Use `.autoPager()` for automatic iteration: `for (var item : page.autoPager()) { ... }`. For manual control, use `.hasNextPage()` and `.nextPage()`.
Send an RCS message
`POST /messages/rcs` — Required: `agent_id`, `to`, `messaging_profile_id`, `agent_message`
Optional: `mms_fallback` (object), `sms_fallback` (object), `type` (enum: RCS), `webhook_url` (url)
import com.telnyx.sdk.models.messages.RcsAgentMessage;
import com.telnyx.sdk.models.messages.rcs.RcSendParams;
import com.telnyx.sdk.models.messages.rcs.RcSendResponse;
RcSendParams params = RcSendParams.builder()
.agentId("Agent007")
.agentMessage(RcsAgentMessage.builder().build())
.messagingProfileId("550e8400-e29b-41d4-a716-446655440000")
.to("+13125551234")
.build();
RcSendResponse response = client.messages().rcs().send(params);Returns: `body` (object), `direction` (string), `encoding` (string), `from` (object), `id` (string), `messaging_profile_id` (string), `organization_id` (string), `received_at` (date-time), `record_type` (string), `to` (array[object]), `type` (string), `wait_seconds` (float)
Generate RCS deeplink
Generate a deeplink URL that can be used to start an RCS conversation with a specific agent.
`GET /messages/rcs/deeplinks/{agent_id}`
import com.telnyx.sdk.models.messages.rcs.RcGenerateDeeplinkParams;
import com.telnyx.sdk.models.messages.rcs.RcGenerateDeeplinkResponse;
RcGenerateDeeplinkResponse response = client.messages().rcs().generateDeeplink("550e8400-e29b-41d4-a716-446655440000");Returns: `url` (string)
List all RCS agents
`GET /messaging/rcs/agents`
import com.telnyx.sdk.models.messaging.rcs.agents.AgentListPage;
import com.telnyx.sdk.models.messaging.rcs.agents.AgentListParams;
AgentListPage page = client.messaging().rcs().agents().list();
Returns: `agent_id` (string), `agent_name` (string), `created_at` (date-time), `enabled` (boolean), `profile_id` (uuid), `updated_at` (date-time), `user_id` (string), `webhook_failover_url` (url), `webhook_url` (url)
Retrieve an RCS agent
`GET /messaging/rcs/agents/{id}`
import com.telnyx.sdk.models.messaging.rcs.agents.AgentRetrieveParams;
import com.telnyx.sdk.models.rcsagents.RcsAgentResponse;
RcsAgentResponse rcsAgentResponse = client.messaging().rcs().agents().retrieve("550e8400-e29b-41d4-a716-446655440000");Returns: `agent_id` (string), `agent_name` (string), `created_at` (date-time), `enabled` (boolean), `profile_id` (uuid), `updated_at` (date-time), `user_id` (string), `webhook_failover_url` (url), `webhook_url` (url)
Modify an RCS agent
`PATCH /messaging/rcs/agents/{id}`
Optional: `profile_id` (uuid), `webhook_failover_url` (url), `webhook_url` (url)
import com.telnyx.sdk.models.messaging.rcs.agents.AgentUpdateParams;
import com.telnyx.sdk.models.rcsagents.RcsAgentResponse;
RcsAgentResponse rcsAgentResponse = client.messaging().rcs().agents().update("550e8400-e29b-41d4-a716-446655440000");Returns: `agent_id` (string), `agent_name` (string), `created_at` (date-time), `enabled` (boolean), `profile_id` (uuid), `updated_at` (date-time), `user_id` (string), `webhook_failover_url` (url), `webhook_url` (url)
Check RCS capabilities (batch)
`POST /messaging/rcs/bulk_capabilities` — Required: `agent_id`, `phone_numbers`
import com.telnyx.sdk.models.messaging.rcs.RcListBulkCapabilitiesParams;
import com.telnyx.sdk.models.messaging.rcs.RcListBulkCapabilitiesResponse;
RcListBulkCapabilitiesParams params = RcListBulkCapabilitiesParams.builder()
.agentId("TestAgent")
.addPhoneNumber("+13125551234")
.build();
RcListBulkCapabilitiesResponse response = client.messaging().rcs().listBulkCapabilities(params);Returns: `agent_id` (string), `agent_name` (string), `features` (array[string]), `phone_number` (string), `record_type` (enum: rcs.capabilities)
Check RCS capabilities
`GET /messaging/rcs/capabilities/{agent_id}/{phone_number}`
Read more
name: telnyx-messaging-hosted-java description: >- Set up hosted SMS numbers, toll-free verification, and RCS messaging. Use when migrating numbers or enabling rich messaging features. This skill provides Java SDK examples. metadata: author: telnyx product: messaging-hosted language: java generated_by: telnyx-openapi-pipeline
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
Telnyx Messaging Hosted - Java
Installation
<!-- Maven -->
<dependency>
<groupId>com.telnyx.sdk</groupId>
<artifactId>telnyx</artifactId>
<version>6.84.0</version>
</dependency>
// Gradle
implementation("com.telnyx.sdk:telnyx:6.84.0")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.
Error Handling
All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:
import com.telnyx.sdk.errors.TelnyxServiceException;
try {
var result = client.messages().send(params);
} catch (TelnyxServiceException e) {
System.err.println("API error " + e.statusCode() + ": " + e.getMessage());
if (e.statusCode() == 422) {
System.err.println("Validation error — check required fields and formats");
} else if (e.statusCode() == 429) {
// Rate limited — wait and retry with exponential backoff
Thread.sleep(1000);
}
}Common error codes: `401` invalid API key, `403` insufficient permissions, `404` resource not found, `422` validation error (check field formats), `429` rate limited (retry with exponential backoff).
Important Notes
- **Phone numbers** must be in E.164 format (e.g., `+13125550001`). Include the `+` prefix and country code. No spaces, dashes, or parentheses.
- **Pagination:** List methods return a page. Use `.autoPager()` for automatic iteration: `for (var item : page.autoPager()) { ... }`. For manual control, use `.hasNextPage()` and `.nextPage()`.
Send an RCS message
`POST /messages/rcs` — Required: `agent_id`, `to`, `messaging_profile_id`, `agent_message`
Optional: `mms_fallback` (object), `sms_fallback` (object), `type` (enum: RCS), `webhook_url` (url)
import com.telnyx.sdk.models.messages.RcsAgentMessage;
import com.telnyx.sdk.models.messages.rcs.RcSendParams;
import com.telnyx.sdk.models.messages.rcs.RcSendResponse;
RcSendParams params = RcSendParams.builder()
.agentId("Agent007")
.agentMessage(RcsAgentMessage.builder().build())
.messagingProfileId("550e8400-e29b-41d4-a716-446655440000")
.to("+13125551234")
.build();
RcSendResponse response = client.messages().rcs().send(params);Returns: `body` (object), `direction` (string), `encoding` (string), `from` (object), `id` (string), `messaging_profile_id` (string), `organization_id` (string), `received_at` (date-time), `record_type` (string), `to` (array[object]), `type` (string), `wait_seconds` (float)
Generate RCS deeplink
Generate a deeplink URL that can be used to start an RCS conversation with a specific agent.
`GET /messages/rcs/deeplinks/{agent_id}`
import com.telnyx.sdk.models.messages.rcs.RcGenerateDeeplinkParams;
import com.telnyx.sdk.models.messages.rcs.RcGenerateDeeplinkResponse;
RcGenerateDeeplinkResponse response = client.messages().rcs().generateDeeplink("550e8400-e29b-41d4-a716-446655440000");Returns: `url` (string)
List all RCS agents
`GET /messaging/rcs/agents`
import com.telnyx.sdk.models.messaging.rcs.agents.AgentListPage; import com.telnyx.sdk.models.messaging.rcs.agents.AgentListParams; AgentListPage page = client.messaging().rcs().agents().list();
Returns: `agent_id` (string), `agent_name` (string), `created_at` (date-time), `enabled` (boolean), `profile_id` (uuid), `updated_at` (date-time), `user_id` (string), `webhook_failover_url` (url), `webhook_url` (url)
Retrieve an RCS agent
`GET /messaging/rcs/agents/{id}`
import com.telnyx.sdk.models.messaging.rcs.agents.AgentRetrieveParams;
import com.telnyx.sdk.models.rcsagents.RcsAgentResponse;
RcsAgentResponse rcsAgentResponse = client.messaging().rcs().agents().retrieve("550e8400-e29b-41d4-a716-446655440000");Returns: `agent_id` (string), `agent_name` (string), `created_at` (date-time), `enabled` (boolean), `profile_id` (uuid), `updated_at` (date-time), `user_id` (string), `webhook_failover_url` (url), `webhook_url` (url)
Modify an RCS agent
`PATCH /messaging/rcs/agents/{id}`
Optional: `profile_id` (uuid), `webhook_failover_url` (url), `webhook_url` (url)
import com.telnyx.sdk.models.messaging.rcs.agents.AgentUpdateParams;
import com.telnyx.sdk.models.rcsagents.RcsAgentResponse;
RcsAgentResponse rcsAgentResponse = client.messaging().rcs().agents().update("550e8400-e29b-41d4-a716-446655440000");Returns: `agent_id` (string), `agent_name` (string), `created_at` (date-time), `enabled` (boolean), `profile_id` (uuid), `updated_at` (date-time), `user_id` (string), `webhook_failover_url` (url), `webhook_url` (url)
Check RCS capabilities (batch)
`POST /messaging/rcs/bulk_capabilities` — Required: `agent_id`, `phone_numbers`
import com.telnyx.sdk.models.messaging.rcs.RcListBulkCapabilitiesParams;
import com.telnyx.sdk.models.messaging.rcs.RcListBulkCapabilitiesResponse;
RcListBulkCapabilitiesParams params = RcListBulkCapabilitiesParams.builder()
.agentId("TestAgent")
.addPhoneNumber("+13125551234")
.build();
RcListBulkCapabilitiesResponse response = client.messaging().rcs().listBulkCapabilities(params);Returns: `agent_id` (string), `agent_name` (string), `features` (array[string]), `phone_number` (string), `record_type` (enum: rcs.capabilities)
Check RCS capabilities
`GET /messaging/rcs/capabilities/{agent_id}/{phone_number}`
This repo is the one-stop shop for AI Agents and AI-first developers building with Telnyx — everything an agent needs to build production-grade applications and manage its account, from signup to funding.
Repo: team-telnyx/ai
Other skills on team-telnyx-ai.
- /telnyx-ai-assistants-curl
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
Open skill - /telnyx-ai-assistants-go
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
Open skill - /telnyx-ai-assistants-java
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
Open skill - /telnyx-ai-assistants-javascript
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
Open skill - /telnyx-ai-assistants-python
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
Open skill - /telnyx-ai-assistants-ruby
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
Open skill

