Telnyx Messaging Go logo

Telnyx Messaging Go

Organization
team-telnyx
telnyx-messaging-go

Send and receive SMS/MMS, handle opt-outs and delivery webhooks. Use for notifications, 2FA, or messaging apps.

Overview

Publisherteam-telnyx
Repositoryai
Skill nametelnyx-messaging-go
Stars
217
Forks
21
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by team-telnyx on GitHub. Read the source before you install it.

Installation

Install the Telnyx Messaging Go AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/team-telnyx/ai.git /tmp/ai
mkdir -p .claude/skills
cp -r /tmp/ai/providers/claude/plugins/telnyx-messaging/skills/telnyx-messaging-go .claude/skills/telnyx-messaging-go
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Telnyx Messaging Go in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Telnyx Messaging Go on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Telnyx Messaging Go is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Telnyx Messaging - Go

Installation

bash
go get github.com/team-telnyx/telnyx-go

Setup

go
import (
  "context"
  "fmt"
  "os"

  "github.com/team-telnyx/telnyx-go"
  "github.com/team-telnyx/telnyx-go/option"
)

client := telnyx.NewClient(
  option.WithAPIKey(os.Getenv("TELNYX_API_KEY")),
)

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:

go
import "errors"

response, err := client.Messages.Send(context.Background(), telnyx.MessageSendParams{
		To: "+18445550001",
		From: "+18005550101",
		Text: "Hello from Telnyx!",
	})
if err != nil {
  var apiErr *telnyx.Error
  if errors.As(err, &apiErr) {
    switch apiErr.StatusCode {
    case 422:
      fmt.Println("Validation error — check required fields and formats")
    case 429:
      fmt.Println("Rate limited, retrying...")
    default:
      fmt.Printf("API error %d: %s\n", apiErr.StatusCode, apiErr.Error())
    }
  } else {
    fmt.Println("Network error — check connectivity and retry")
  }
}

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: Use ListAutoPaging() for automatic iteration: iter := client.Resource.ListAutoPaging(ctx, params); for iter.Next() { item := iter.Current() }.

Operational Caveats

  • The sending number must already be assigned to the correct messaging profile before you send traffic from it.
  • US A2P long-code traffic must complete 10DLC registration before production sending or carriers will block or heavily filter messages.
  • Delivery webhooks are asynchronous. Treat the send response as acceptance of the request, not final carrier delivery.

Reference Use Rules

Do not invent Telnyx parameters, enums, response fields, or webhook fields.

Core Tasks

Send an SMS

Primary outbound messaging flow. Agents need exact request fields and delivery-related response fields.

client.Messages.Send()POST /messages

ParameterTypeRequiredDescription
Tostring (E.164)YesReceiving address (+E.164 formatted phone number or short co...
Fromstring (E.164)YesSending address (+E.164 formatted phone number, alphanumeric...
TextstringYesMessage body (i.e., content) as a non-empty string.
MessagingProfileIdstring (UUID)NoUnique identifier for a messaging profile.
MediaUrlsarray[string]NoA list of media URLs.
WebhookUrlstring (URL)NoThe URL where webhooks related to this message will be sent.
...+7 optional params in references/api-details.md
go
	response, err := client.Messages.Send(context.Background(), telnyx.MessageSendParams{
		To: "+18445550001",
		From: "+18005550101",
		Text: "Hello from Telnyx!",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Primary response fields:

  • response.Data.ID
  • response.Data.To
  • response.Data.From
  • response.Data.Text
  • response.Data.SentAt
  • response.Data.Errors

Send an SMS with an alphanumeric sender ID

Common sender variant that requires different request shape.

client.Messages.SendWithAlphanumericSender()POST /messages/alphanumeric_sender_id

ParameterTypeRequiredDescription
Fromstring (E.164)YesA valid alphanumeric sender ID on the user's account.
Tostring (E.164)YesReceiving address (+E.164 formatted phone number or short co...
TextstringYesThe message body.
MessagingProfileIdstring (UUID)YesThe messaging profile ID to use.
WebhookUrlstring (URL)NoCallback URL for delivery status updates.
WebhookFailoverUrlstring (URL)NoFailover callback URL for delivery status updates.
UseProfileWebhooksbooleanNoIf true, use the messaging profile's webhook settings.
go
	response, err := client.Messages.SendWithAlphanumericSender(context.Background(), telnyx.MessageSendWithAlphanumericSenderParams{
		From:               "MyCompany",
		MessagingProfileID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		Text: "Hello from Telnyx!",
		To: "+13125550001",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Primary response fields:

  • response.Data.ID
  • response.Data.To
  • response.Data.From
  • response.Data.Text
  • response.Data.SentAt
  • response.Data.Errors

Webhook Verification

Telnyx signs webhooks with Ed25519. Each request includes telnyx-signature-ed25519 and telnyx-timestamp headers. Always verify signatures in production:

go
// In your webhook handler:
func handleWebhook(w http.ResponseWriter, r *http.Request) {
  body, _ := io.ReadAll(r.Body)
  event, err := client.Webhooks.Unwrap(body, r.Header)
  if err != nil {
    http.Error(w, "Invalid signature", http.StatusBadRequest)
    return
  }
  // Signature valid — event is the parsed webhook payload
  fmt.Println("Received event:", event.Data.EventType)
  w.WriteHeader(http.StatusOK)
}

Webhooks

These webhook payload fields are inline because they are part of the primary integration path.

Delivery Update

FieldTypeDescription
data.event_typeenum: message.sent, message.finalizedThe type of event being delivered.
data.payload.iduuidIdentifies the type of resource.
data.payload.toarray[object]
data.payload.textstringMessage body (i.e., content) as a non-empty string.
data.payload.sent_atdate-timeISO 8601 formatted date indicating when the message was sent.
data.payload.completed_atdate-timeISO 8601 formatted date indicating when the message was finalized.
data.payload.costobject | null
data.payload.errorsarray[object]These errors may point at addressees when referring to unsuccessful/unconfirm...

Inbound Message

FieldTypeDescription
data.event_typeenum: message.receivedThe type of event being delivered.
data.payload.iduuidIdentifies the type of resource.
data.payload.directionenum: inboundThe direction of the message.
data.payload.toarray[object]
data.payload.textstringMessage body (i.e., content) as a non-empty string.
data.payload.typeenum: SMS, MMSThe type of message.
data.payload.mediaarray[object]
data.record_typeenum: eventIdentifies the type of the resource.

If you need webhook fields that are not listed inline here, read the webhook payload reference before writing the handler.


Important Supporting Operations

Use these when the core tasks above are close to your flow, but you need a common variation or follow-up step.

Send a group MMS message

Send one MMS payload to multiple recipients.

client.Messages.SendGroupMms()POST /messages/group_mms

ParameterTypeRequiredDescription
Fromstring (E.164)YesPhone number, in +E.164 format, used to send the message.
Toarray[object]YesA list of destinations.
MediaUrlsarray[string]NoA list of media URLs.
WebhookUrlstring (URL)NoThe URL where webhooks related to this message will be sent.
WebhookFailoverUrlstring (URL)NoThe failover URL where webhooks related to this message will...
...+3 optional params in references/api-details.md
go
	response, err := client.Messages.SendGroupMms(context.Background(), telnyx.MessageSendGroupMmsParams{
		From: "+13125551234",
		To:   []string{"+18655551234", "+14155551234"},
		Text: "Hello from Telnyx!",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Primary response fields:

  • response.Data.ID
  • response.Data.To
  • response.Data.From
  • response.Data.Type
  • response.Data.Direction
  • response.Data.Text

Send a long code message

Force a long-code sending path instead of the generic send endpoint.

client.Messages.SendLongCode()POST /messages/long_code

ParameterTypeRequiredDescription
Fromstring (E.164)YesPhone number, in +E.164 format, used to send the message.
Tostring (E.164)YesReceiving address (+E.164 formatted phone number or short co...
MediaUrlsarray[string]NoA list of media URLs.
WebhookUrlstring (URL)NoThe URL where webhooks related to this message will be sent.
WebhookFailoverUrlstring (URL)NoThe failover URL where webhooks related to this message will...
...+6 optional params in references/api-details.md
go
	response, err := client.Messages.SendLongCode(context.Background(), telnyx.MessageSendLongCodeParams{
		From: "+18445550001",
		To:   "+13125550002",
		Text: "Hello from Telnyx!",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Primary response fields:

  • response.Data.ID
  • response.Data.To
  • response.Data.From
  • response.Data.Type
  • response.Data.Direction
  • response.Data.Text

Send a message using number pool

Let a messaging profile or number pool choose the sender for you.

client.Messages.SendNumberPool()POST /messages/number_pool

ParameterTypeRequiredDescription
MessagingProfileIdstring (UUID)YesUnique identifier for a messaging profile.
Tostring (E.164)YesReceiving address (+E.164 formatted phone number or short co...
MediaUrlsarray[string]NoA list of media URLs.
WebhookUrlstring (URL)NoThe URL where webhooks related to this message will be sent.
WebhookFailoverUrlstring (URL)NoThe failover URL where webhooks related to this message will...
...+6 optional params in references/api-details.md
go
	response, err := client.Messages.SendNumberPool(context.Background(), telnyx.MessageSendNumberPoolParams{
		MessagingProfileID: "abc85f64-5717-4562-b3fc-2c9600000000",
		To:                 "+13125550002",
		Text: "Hello from Telnyx!",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Primary response fields:

  • response.Data.ID
  • response.Data.To
  • response.Data.From
  • response.Data.Type
  • response.Data.Direction
  • response.Data.Text

Send a short code message

Force a short-code sending path when the sender must be a short code.

client.Messages.SendShortCode()POST /messages/short_code

ParameterTypeRequiredDescription
Fromstring (E.164)YesPhone number, in +E.164 format, used to send the message.
Tostring (E.164)YesReceiving address (+E.164 formatted phone number or short co...
MediaUrlsarray[string]NoA list of media URLs.
WebhookUrlstring (URL)NoThe URL where webhooks related to this message will be sent.
WebhookFailoverUrlstring (URL)NoThe failover URL where webhooks related to this message will...
...+6 optional params in references/api-details.md
go
	response, err := client.Messages.SendShortCode(context.Background(), telnyx.MessageSendShortCodeParams{
		From: "+18445550001",
		To:   "+18445550001",
		Text: "Hello from Telnyx!",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Primary response fields:

  • response.Data.ID
  • response.Data.To
  • response.Data.From
  • response.Data.Type
  • response.Data.Direction
  • response.Data.Text

Schedule a message

Queue a message for future delivery instead of sending immediately.

client.Messages.Schedule()POST /messages/schedule

ParameterTypeRequiredDescription
Tostring (E.164)YesReceiving address (+E.164 formatted phone number or short co...
MessagingProfileIdstring (UUID)NoUnique identifier for a messaging profile.
MediaUrlsarray[string]NoA list of media URLs.
WebhookUrlstring (URL)NoThe URL where webhooks related to this message will be sent.
...+8 optional params in references/api-details.md
go
	response, err := client.Messages.Schedule(context.Background(), telnyx.MessageScheduleParams{
		To: "+18445550001",
		From: "+18005550101",
		Text: "Appointment reminder",
		SendAt: "2025-07-01T15:00:00Z",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Primary response fields:

  • response.Data.ID
  • response.Data.To
  • response.Data.From
  • response.Data.Type
  • response.Data.Direction
  • response.Data.Text

Send a WhatsApp message

Send WhatsApp traffic instead of SMS/MMS.

client.Messages.SendWhatsapp()POST /messages/whatsapp

ParameterTypeRequiredDescription
Fromstring (E.164)YesPhone number in +E.164 format associated with Whatsapp accou...
Tostring (E.164)YesPhone number in +E.164 format
WhatsappMessageobjectYes
Typeenum (WHATSAPP)NoMessage type - must be set to "WHATSAPP"
WebhookUrlstring (URL)NoThe URL where webhooks related to this message will be sent.
MessagingProfileIdstring (UUID)NoMessaging profile ID - required if the 'from' number is not ...
go
	response, err := client.Messages.SendWhatsapp(context.Background(), telnyx.MessageSendWhatsappParams{
		From:            "+13125551234",
		To:              "+13125551234",
		WhatsappMessage: telnyx.WhatsappMessageContentParam{},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Primary response fields:

  • response.Data.ID
  • response.Data.To
  • response.Data.From
  • response.Data.Type
  • response.Data.Direction
  • response.Data.Body

Additional Operations

Use the core tasks above first. The operations below are indexed here with exact SDK methods and required params; use references/api-details.md for full optional params, response schemas, and lower-frequency webhook payloads. Before using any operation below, read the optional-parameters section and the response-schemas section so you do not guess missing fields.

OperationSDK methodEndpointUse whenRequired params
Retrieve a messageclient.Messages.Get()GET /messages/{id}Fetch the current state before updating, deleting, or making control-flow decisions.Id
Cancel a scheduled messageclient.Messages.CancelScheduled()DELETE /messages/{id}Remove, detach, or clean up an existing resource.Id
List alphanumeric sender IDsclient.AlphanumericSenderIDs.List()GET /alphanumeric_sender_idsInspect available resources or choose an existing resource before mutating it.None
Create an alphanumeric sender IDclient.AlphanumericSenderIDs.New()POST /alphanumeric_sender_idsCreate or provision an additional resource when the core tasks do not cover this flow.AlphanumericSenderId, MessagingProfileId
Retrieve an alphanumeric sender IDclient.AlphanumericSenderIDs.Get()GET /alphanumeric_sender_ids/{id}Fetch the current state before updating, deleting, or making control-flow decisions.Id
Delete an alphanumeric sender IDclient.AlphanumericSenderIDs.Delete()DELETE /alphanumeric_sender_ids/{id}Remove, detach, or clean up an existing resource.Id
Retrieve group MMS messagesclient.Messages.GetGroupMessages()GET /messages/group/{message_id}Fetch the current state before updating, deleting, or making control-flow decisions.MessageId
List messaging hosted numbersclient.MessagingHostedNumbers.List()GET /messaging_hosted_numbersInspect available resources or choose an existing resource before mutating it.None
Retrieve a messaging hosted numberclient.MessagingHostedNumbers.Get()GET /messaging_hosted_numbers/{id}Fetch the current state before updating, deleting, or making control-flow decisions.Id
Update a messaging hosted numberclient.MessagingHostedNumbers.Update()PATCH /messaging_hosted_numbers/{id}Modify an existing resource without recreating it.Id
List opt-outsclient.MessagingOptouts.List()GET /messaging_optoutsInspect available resources or choose an existing resource before mutating it.None
List high-level messaging profile metricsclient.MessagingProfileMetrics.List()GET /messaging_profile_metricsInspect available resources or choose an existing resource before mutating it.None
Regenerate messaging profile secretclient.MessagingProfiles.Actions.RegenerateSecret()POST /messaging_profiles/{id}/actions/regenerate_secretTrigger a follow-up action in an existing workflow rather than creating a new top-level resource.Id
List alphanumeric sender IDs for a messaging profileclient.MessagingProfiles.ListAlphanumericSenderIDs()GET /messaging_profiles/{id}/alphanumeric_sender_idsFetch the current state before updating, deleting, or making control-flow decisions.Id
Get detailed messaging profile metricsclient.MessagingProfiles.GetMetrics()GET /messaging_profiles/{id}/metricsFetch the current state before updating, deleting, or making control-flow decisions.Id
List Auto-Response Settingsclient.MessagingProfiles.AutorespConfigs.List()GET /messaging_profiles/{profile_id}/autoresp_configsFetch the current state before updating, deleting, or making control-flow decisions.ProfileId
Create auto-response settingclient.MessagingProfiles.AutorespConfigs.New()POST /messaging_profiles/{profile_id}/autoresp_configsCreate or provision an additional resource when the core tasks do not cover this flow.Op, Keywords, CountryCode, ProfileId
Get Auto-Response Settingclient.MessagingProfiles.AutorespConfigs.Get()GET /messaging_profiles/{profile_id}/autoresp_configs/{autoresp_cfg_id}Fetch the current state before updating, deleting, or making control-flow decisions.ProfileId, AutorespCfgId
Update Auto-Response Settingclient.MessagingProfiles.AutorespConfigs.Update()PUT /messaging_profiles/{profile_id}/autoresp_configs/{autoresp_cfg_id}Modify an existing resource without recreating it.Op, Keywords, CountryCode, ProfileId, +1 more
Delete Auto-Response Settingclient.MessagingProfiles.AutorespConfigs.Delete()DELETE /messaging_profiles/{profile_id}/autoresp_configs/{autoresp_cfg_id}Remove, detach, or clean up an existing resource.ProfileId, AutorespCfgId

Other Webhook Events

Eventdata.event_typeDescription
replacedLinkClickmessage.link_clickReplaced Link Click

For exhaustive optional parameters, full response schemas, and complete webhook payloads, see references/api-details.md.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Telnyx Messaging Go AI skill do?

Send and receive SMS/MMS, handle opt-outs and delivery webhooks. Use for notifications, 2FA, or messaging apps.

Why use Telnyx Messaging Go on TypingMind?

Because you install it once and use it with any model. Telnyx Messaging Go is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Telnyx Messaging Go in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/team-telnyx/ai/tree/main/providers/claude/plugins/telnyx-messaging/skills/telnyx-messaging-go. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Telnyx Messaging Go?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Telnyx Messaging Go?

As many as you like. As long as a model supports skills, you can use Telnyx Messaging Go with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Telnyx Messaging Go AI skill free?

Yes. It is published on GitHub by team-telnyx under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇