Skip to main contenttelnyx-porting-out-go
Manage port-out requests when numbers are being ported away from Telnyx. List, view, and update port-out status. This skill provides Go SDK examples.
Ir a la instalación Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Un comando directo omite el prompt de revisión. Revisa el origen antes de ejecutarlo.
npx skills add https://github.com/team-telnyx/telnyx-toolkit --skill telnyx-porting-out-goEl comando permanece en una sola línea. Desplázate horizontalmente para revisarlo antes de copiarlo.
¿Prefieres una copia local? Descarga los archivos que SkillsMP tiene disponibles ahora.
Más de este repositorio
Complete Telnyx toolkit — ready-to-use tools (STT, TTS, RAG, Networking, 10DLC) plus SDK documentation for JavaScript, Python, Go, Java, and Ruby.
Automated Telnyx bot account signup via challenge-response
Track agent activities using the Telnyx AI Missions API. Use this skill when executing multi-step tasks that should be logged and tracked. Supports creating voice/SMS agents, scheduling calls, and retrieving conversation insights. Use when tasks involve calling people, sending SMS, or any substantial tracked work.
SOC
Basado en la clasificación ocupacional SOC
| name | telnyx-porting-out-go |
| description | Manage port-out requests when numbers are being ported away from Telnyx. List, view, and update port-out status. This skill provides Go SDK examples. |
| metadata | {"author":"telnyx","product":"porting-out","language":"go","generated_by":"telnyx-ext-skills-generator"} |
Telnyx Porting Out - Go
Installation
go get github.com/team-telnyx/telnyx-go
Setup
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.
List portout requests
Returns the portout requests according to filters
GET /portouts
page, err := client.Portouts.List(context.TODO(), telnyx.PortoutListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Get a portout request
Returns the portout request based on the ID provided
GET /portouts/{id}
portout, err := client.Portouts.Get(context.TODO(), )
err != {
(err.Error())
}
fmt.Printf(, portout.Data)
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
if
nil
panic
"%+v\n"
List all comments for a portout request
Returns a list of comments for a portout request.
GET /portouts/{id}/comments
comments, err := client.Portouts.Comments.List(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", comments.Data)
Create a comment on a portout request
Creates a comment on a portout request.
POST /portouts/{id}/comments
comment, err := client.Portouts.Comments.New(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.PortoutCommentNewParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", comment.Data)
List supporting documents on a portout request
List every supporting documents for a portout request.
GET /portouts/{id}/supporting_documents
supportingDocuments, err := client.Portouts.SupportingDocuments.List(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", supportingDocuments.Data)
Create a list of supporting documents on a portout request
Creates a list of supporting documents on a portout request.
POST /portouts/{id}/supporting_documents
supportingDocument, err := client.Portouts.SupportingDocuments.New(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.PortoutSupportingDocumentNewParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", supportingDocument.Data)
Update Status
Authorize or reject portout request
PATCH /portouts/{id}/{status} — Required: reason
response, err := client.Portouts.UpdateStatus(
context.TODO(),
telnyx.PortoutUpdateStatusParamsStatusAuthorized,
telnyx.PortoutUpdateStatusParams{
ID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
Reason: "I do not recognize this transaction",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
List all port-out events
Returns a list of all port-out events.
page, err := client.Portouts.Events.List(context.TODO(), telnyx.PortoutEventListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Show a port-out event
Show a specific port-out event.
GET /portouts/events/{id}
event, err := client.Portouts.Events.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", event.Data)
Republish a port-out event
Republish a specific port-out event.
POST /portouts/events/{id}/republish
err := client.Portouts.Events.Republish(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
List eligible port-out rejection codes for a specific order
Given a port-out ID, list rejection codes that are eligible for that port-out
GET /portouts/rejections/{portout_id}
response, err := client.Portouts.ListRejectionCodes(
context.TODO(),
"329d6658-8f93-405d-862f-648776e8afd7",
telnyx.PortoutListRejectionCodesParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
List port-out related reports
List the reports generated about port-out operations.
page, err := client.Portouts.Reports.List(context.TODO(), telnyx.PortoutReportListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a port-out related report
Generate reports about port-out operations.
report, err := client.Portouts.Reports.New(context.TODO(), telnyx.PortoutReportNewParams{
Params: telnyx.ExportPortoutsCsvReportParam{
Filters: telnyx.ExportPortoutsCsvReportFiltersParam{},
},
ReportType: telnyx.PortoutReportNewParamsReportTypeExportPortoutsCsv,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", report.Data)
Retrieve a report
Retrieve a specific report generated.
GET /portouts/reports/{id}
report, err := client.Portouts.Reports.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", report.Data)