api/go/telnyx-ai-assistants-go/SKILL.md
Create and manage AI voice assistants with custom personalities, knowledge bases, and tool integrations. This skill provides Go SDK examples.
npx skillsauth add team-telnyx/telnyx-toolkit telnyx-ai-assistants-goInstall 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.
go get github.com/team-telnyx/telnyx-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.
Retrieve a list of all AI Assistants configured by the user.
GET /ai/assistants
assistantsList, err := client.AI.Assistants.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistantsList.Data)
Create a new AI Assistant.
POST /ai/assistants — Required: name, model, instructions
assistant, err := client.AI.Assistants.New(context.TODO(), telnyx.AIAssistantNewParams{
Instructions: "instructions",
Model: "model",
Name: "name",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistant.ID)
Retrieve an AI Assistant configuration by assistant_id.
GET /ai/assistants/{assistant_id}
assistant, err := client.AI.Assistants.Get(
context.TODO(),
"assistant_id",
telnyx.AIAssistantGetParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistant.ID)
Update an AI Assistant's attributes.
POST /ai/assistants/{assistant_id}
assistant, err := client.AI.Assistants.Update(
context.TODO(),
"assistant_id",
telnyx.AIAssistantUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistant.ID)
Delete an AI Assistant by assistant_id.
DELETE /ai/assistants/{assistant_id}
assistant, err := client.AI.Assistants.Delete(context.TODO(), "assistant_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistant.ID)
This endpoint allows a client to send a chat message to a specific AI Assistant.
POST /ai/assistants/{assistant_id}/chat — Required: content, conversation_id
response, err := client.AI.Assistants.Chat(
context.TODO(),
"assistant_id",
telnyx.AIAssistantChatParams{
Content: "Tell me a joke about cats",
ConversationID: "42b20469-1215-4a9a-8964-c36f66b406f4",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Content)
Send an SMS message for an assistant.
POST /ai/assistants/{assistant_id}/chat/sms — Required: from, to
response, err := client.AI.Assistants.SendSMS(
context.TODO(),
"assistant_id",
telnyx.AIAssistantSendSMSParams{
From: "from",
To: "to",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.ConversationID)
Clone an existing assistant, excluding telephony and messaging settings.
POST /ai/assistants/{assistant_id}/clone
assistant, err := client.AI.Assistants.Clone(context.TODO(), "assistant_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistant.ID)
Import assistants from external providers.
POST /ai/assistants/import — Required: provider, api_key_ref
assistantsList, err := client.AI.Assistants.Imports(context.TODO(), telnyx.AIAssistantImportsParams{
APIKeyRef: "api_key_ref",
Provider: telnyx.AIAssistantImportsParamsProviderElevenlabs,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistantsList.Data)
Get scheduled events for an assistant with pagination and filtering
GET /ai/assistants/{assistant_id}/scheduled_events
page, err := client.AI.Assistants.ScheduledEvents.List(
context.TODO(),
"assistant_id",
telnyx.AIAssistantScheduledEventListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a scheduled event for an assistant
POST /ai/assistants/{assistant_id}/scheduled_events — Required: telnyx_conversation_channel, telnyx_end_user_target, telnyx_agent_target, scheduled_at_fixed_datetime
scheduledEventResponse, err := client.AI.Assistants.ScheduledEvents.New(
context.TODO(),
"assistant_id",
telnyx.AIAssistantScheduledEventNewParams{
ScheduledAtFixedDatetime: time.Now(),
TelnyxAgentTarget: "telnyx_agent_target",
TelnyxConversationChannel: telnyx.ConversationChannelTypePhoneCall,
TelnyxEndUserTarget: "telnyx_end_user_target",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", scheduledEventResponse)
Retrieve a scheduled event by event ID
GET /ai/assistants/{assistant_id}/scheduled_events/{event_id}
scheduledEventResponse, err := client.AI.Assistants.ScheduledEvents.Get(
context.TODO(),
"event_id",
telnyx.AIAssistantScheduledEventGetParams{
AssistantID: "assistant_id",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", scheduledEventResponse)
If the event is pending, this will cancel the event.
DELETE /ai/assistants/{assistant_id}/scheduled_events/{event_id}
err := client.AI.Assistants.ScheduledEvents.Delete(
context.TODO(),
"event_id",
telnyx.AIAssistantScheduledEventDeleteParams{
AssistantID: "assistant_id",
},
)
if err != nil {
panic(err.Error())
}
Retrieves a paginated list of assistant tests with optional filtering capabilities
GET /ai/assistants/tests
page, err := client.AI.Assistants.Tests.List(context.TODO(), telnyx.AIAssistantTestListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Creates a comprehensive test configuration for evaluating AI assistant performance
POST /ai/assistants/tests — Required: name, destination, instructions, rubric
assistantTest, err := client.AI.Assistants.Tests.New(context.TODO(), telnyx.AIAssistantTestNewParams{
Destination: "+15551234567",
Instructions: "Act as a frustrated customer who received a damaged product. Ask for a refund and escalate if not satisfied with the initial response.",
Name: "Customer Support Bot Test",
Rubric: []telnyx.AIAssistantTestNewParamsRubric{{
Criteria: "Assistant responds within 30 seconds",
Name: "Response Time",
}, {
Criteria: "Provides correct product information",
Name: "Accuracy",
}},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistantTest.TestID)
Retrieves a list of all distinct test suite names available to the current user
GET /ai/assistants/tests/test-suites
testSuites, err := client.AI.Assistants.Tests.TestSuites.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", testSuites.Data)
Retrieves paginated history of test runs for a specific test suite with filtering options
GET /ai/assistants/tests/test-suites/{suite_name}/runs
page, err := client.AI.Assistants.Tests.TestSuites.Runs.List(
context.TODO(),
"suite_name",
telnyx.AIAssistantTestTestSuiteRunListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Executes all tests within a specific test suite as a batch operation
POST /ai/assistants/tests/test-suites/{suite_name}/runs
testRunResponses, err := client.AI.Assistants.Tests.TestSuites.Runs.Trigger(
context.TODO(),
"suite_name",
telnyx.AIAssistantTestTestSuiteRunTriggerParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", testRunResponses)
Retrieves detailed information about a specific assistant test
GET /ai/assistants/tests/{test_id}
assistantTest, err := client.AI.Assistants.Tests.Get(context.TODO(), "test_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistantTest.TestID)
Updates an existing assistant test configuration with new settings
PUT /ai/assistants/tests/{test_id}
assistantTest, err := client.AI.Assistants.Tests.Update(
context.TODO(),
"test_id",
telnyx.AIAssistantTestUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistantTest.TestID)
Permanently removes an assistant test and all associated data
DELETE /ai/assistants/tests/{test_id}
err := client.AI.Assistants.Tests.Delete(context.TODO(), "test_id")
if err != nil {
panic(err.Error())
}
Retrieves paginated execution history for a specific assistant test with filtering options
GET /ai/assistants/tests/{test_id}/runs
page, err := client.AI.Assistants.Tests.Runs.List(
context.TODO(),
"test_id",
telnyx.AIAssistantTestRunListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Initiates immediate execution of a specific assistant test
POST /ai/assistants/tests/{test_id}/runs
testRunResponse, err := client.AI.Assistants.Tests.Runs.Trigger(
context.TODO(),
"test_id",
telnyx.AIAssistantTestRunTriggerParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", testRunResponse.RunID)
Retrieves detailed information about a specific test run execution
GET /ai/assistants/tests/{test_id}/runs/{run_id}
testRunResponse, err := client.AI.Assistants.Tests.Runs.Get(
context.TODO(),
"run_id",
telnyx.AIAssistantTestRunGetParams{
TestID: "test_id",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", testRunResponse.RunID)
Retrieves all versions of a specific assistant with complete configuration and metadata
GET /ai/assistants/{assistant_id}/versions
assistantsList, err := client.AI.Assistants.Versions.List(context.TODO(), "assistant_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistantsList.Data)
Retrieves a specific version of an assistant by assistant_id and version_id
GET /ai/assistants/{assistant_id}/versions/{version_id}
assistant, err := client.AI.Assistants.Versions.Get(
context.TODO(),
"version_id",
telnyx.AIAssistantVersionGetParams{
AssistantID: "assistant_id",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistant.ID)
Updates the configuration of a specific assistant version.
POST /ai/assistants/{assistant_id}/versions/{version_id}
assistant, err := client.AI.Assistants.Versions.Update(
context.TODO(),
"version_id",
telnyx.AIAssistantVersionUpdateParams{
AssistantID: "assistant_id",
UpdateAssistant: telnyx.UpdateAssistantParam{},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistant.ID)
Permanently removes a specific version of an assistant.
DELETE /ai/assistants/{assistant_id}/versions/{version_id}
err := client.AI.Assistants.Versions.Delete(
context.TODO(),
"version_id",
telnyx.AIAssistantVersionDeleteParams{
AssistantID: "assistant_id",
},
)
if err != nil {
panic(err.Error())
}
Promotes a specific version to be the main/current version of the assistant.
POST /ai/assistants/{assistant_id}/versions/{version_id}/promote
assistant, err := client.AI.Assistants.Versions.Promote(
context.TODO(),
"version_id",
telnyx.AIAssistantVersionPromoteParams{
AssistantID: "assistant_id",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistant.ID)
Endpoint to get a canary deploy configuration for an assistant.
GET /ai/assistants/{assistant_id}/canary-deploys
canaryDeployResponse, err := client.AI.Assistants.CanaryDeploys.Get(context.TODO(), "assistant_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", canaryDeployResponse.AssistantID)
Endpoint to create a canary deploy configuration for an assistant.
POST /ai/assistants/{assistant_id}/canary-deploys — Required: versions
canaryDeployResponse, err := client.AI.Assistants.CanaryDeploys.New(
context.TODO(),
"assistant_id",
telnyx.AIAssistantCanaryDeployNewParams{
CanaryDeploy: telnyx.CanaryDeployParam{
Versions: []telnyx.VersionConfigParam{{
Percentage: 1,
VersionID: "version_id",
}},
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", canaryDeployResponse.AssistantID)
Endpoint to update a canary deploy configuration for an assistant.
PUT /ai/assistants/{assistant_id}/canary-deploys — Required: versions
canaryDeployResponse, err := client.AI.Assistants.CanaryDeploys.Update(
context.TODO(),
"assistant_id",
telnyx.AIAssistantCanaryDeployUpdateParams{
CanaryDeploy: telnyx.CanaryDeployParam{
Versions: []telnyx.VersionConfigParam{{
Percentage: 1,
VersionID: "version_id",
}},
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", canaryDeployResponse.AssistantID)
Endpoint to delete a canary deploy configuration for an assistant.
DELETE /ai/assistants/{assistant_id}/canary-deploys
err := client.AI.Assistants.CanaryDeploys.Delete(context.TODO(), "assistant_id")
if err != nil {
panic(err.Error())
}
Get an assistant texml by assistant_id.
GET /ai/assistants/{assistant_id}/texml
response, err := client.AI.Assistants.GetTexml(context.TODO(), "assistant_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
Test a webhook tool for an assistant
POST /ai/assistants/{assistant_id}/tools/{tool_id}/test
response, err := client.AI.Assistants.Tools.Test(
context.TODO(),
"tool_id",
telnyx.AIAssistantToolTestParams{
AssistantID: "assistant_id",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
List all available integrations.
GET /ai/integrations
integrations, err := client.AI.Integrations.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", integrations.Data)
List user setup integrations
GET /ai/integrations/connections
connections, err := client.AI.Integrations.Connections.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", connections.Data)
Get user setup integrations
GET /ai/integrations/connections/{user_connection_id}
connection, err := client.AI.Integrations.Connections.Get(context.TODO(), "user_connection_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", connection.Data)
Delete a specific integration connection.
DELETE /ai/integrations/connections/{user_connection_id}
err := client.AI.Integrations.Connections.Delete(context.TODO(), "user_connection_id")
if err != nil {
panic(err.Error())
}
Retrieve integration details
GET /ai/integrations/{integration_id}
integration, err := client.AI.Integrations.Get(context.TODO(), "integration_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", integration.ID)
Retrieve a list of MCP servers.
GET /ai/mcp_servers
page, err := client.AI.McpServers.List(context.TODO(), telnyx.AIMcpServerListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a new MCP server.
POST /ai/mcp_servers — Required: name, type, url
mcpServer, err := client.AI.McpServers.New(context.TODO(), telnyx.AIMcpServerNewParams{
Name: "name",
Type: "type",
URL: "url",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mcpServer.ID)
Retrieve details for a specific MCP server.
GET /ai/mcp_servers/{mcp_server_id}
mcpServer, err := client.AI.McpServers.Get(context.TODO(), "mcp_server_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mcpServer.ID)
Update an existing MCP server.
PUT /ai/mcp_servers/{mcp_server_id}
mcpServer, err := client.AI.McpServers.Update(
context.TODO(),
"mcp_server_id",
telnyx.AIMcpServerUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mcpServer.ID)
Delete a specific MCP server.
DELETE /ai/mcp_servers/{mcp_server_id}
err := client.AI.McpServers.Delete(context.TODO(), "mcp_server_id")
if err != nil {
panic(err.Error())
}
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.