Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/team-telnyx-telnyx-porting-out-go/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 135% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 138% | 0% |
| case-21 | ✗→✓ | ▲ Improved | 164% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 140% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 179% | 0% |
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
bashgo get github.com/team-telnyx/telnyx-go
goimport ( "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.
All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:
goimport "errors" result, err := client.Messages.Send(ctx, params) 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: // Rate limited — wait and retry with exponential backoff 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).
ListAutoPaging() for automatic iteration: iter := client.Resource.ListAutoPaging(ctx, params); for iter.Next() { item := iter.Current() }.Returns the portout requests according to filters
GET /portouts
gopage, err := client.Portouts.List(context.Background(), telnyx.PortoutListParams{}) if err != nil { log.Fatal(err) } fmt.Printf("%+v\n", page)
Returns: already_ported (boolean), authorized_name (string), carrier_name (string), city (string), created_at (string), current_carrier (string), end_user_name (string), foc_date (string), host_messaging (boolean), id (string), inserted_at (string), lsr (arraystring]), phone_numbers (arraystring]), pon (string), reason (string | null), record_type (string), rejection_code (integer), requested_foc_date (string), service_address (string), spid (string), state (string), status (enum: pending, authorized, ported, rejected, rejected-pending, canceled), support_key (string), updated_at (string), user_id (uuid), vendor (uuid), zip (string)
Returns a list of all port-out events.
GET /portouts/events
gopage, err := client.Portouts.Events.List(context.Background(), telnyx.PortoutEventListParams{}) if err != nil { log.Fatal(err) } fmt.Printf("%+v\n", page)
Returns: available_notification_methods (arraystring]), created_at (date-time), event_type (enum: portout.status_changed, portout.foc_date_changed, portout.new_comment), id (uuid), payload (object), payload_status (enum: created, completed), portout_id (uuid), record_type (string), updated_at (date-time)
Show a specific port-out event.
GET /portouts/events/{id}
goevent, err := client.Portouts.Events.Get(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") if err != nil { log.Fatal(err) } fmt.Printf("%+v\n", event.Data)
Returns: available_notification_methods (arraystring]), created_at (date-time), event_type (enum: portout.status_changed, portout.foc_date_changed, portout.new_comment), id (uuid), payload (object), payload_status (enum: created, completed), portout_id (uuid), record_type (string), updated_at (date-time)
Republish a specific port-out event.
POST /portouts/events/{id}/republish
goerr := client.Portouts.Events.Republish(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") if err != nil { log.Fatal(err) }
Given a port-out ID, list rejection codes that are eligible for that port-out
GET /portouts/rejections/{portout_id}
goresponse, err := client.Portouts.ListRejectionCodes( context.Background(), "329d6658-8f93-405d-862f-648776e8afd7", telnyx.PortoutListRejectionCodesParams{}, ) if err != nil { log.Fatal(err) } fmt.Printf("%+v\n", response.Data)
Returns: code (integer), description (string), reason_required (boolean)
List the reports generated about port-out operations.
GET /portouts/reports
gopage, err := client.Portouts.Reports.List(context.Background(), telnyx.PortoutReportListParams{}) if err != nil { log.Fatal(err) } fmt.Printf("%+v\n", page)
Returns: created_at (date-time), document_id (uuid), id (uuid), params (object), record_type (string), report_type (enum: export_portouts_csv), status (enum: pending, completed), updated_at (date-time)
Generate reports about port-out operations.
POST /portouts/reports
goreport, err := client.Portouts.Reports.New(context.Background(), telnyx.PortoutReportNewParams{ Params: telnyx.ExportPortoutsCsvReportParam{ Filters: telnyx.ExportPortoutsCsvReportFiltersParam{}, }, ReportType: telnyx.PortoutReportNewParamsReportTypeExportPortoutsCsv, }) if err != nil { log.Fatal(err) } fmt.Printf("%+v\n", report.Data)
Returns: created_at (date-time), document_id (uuid), id (uuid), params (object), record_type (string), report_type (enum: export_portouts_csv), status (enum: pending, completed), updated_at (date-time)
Retrieve a specific report generated.
GET /portouts/reports/{id}
goreport, err := client.Portouts.Reports.Get(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") if err != nil { log.Fatal(err) } fmt.Printf("%+v\n", report.Data)
Returns: created_at (date-time), document_id (uuid), id (uuid), params (object), record_type (string), report_type (enum: export_portouts_csv), status (enum: pending, completed), updated_at (date-time)
Returns the portout request based on the ID provided
GET /portouts/{id}
goportout, err := client.Portouts.Get(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") if err != nil { log.Fatal(err) } fmt.Printf("%+v\n", portout.Data)
Returns: already_ported (boolean), authorized_name (string), carrier_name (string), city (string), created_at (string), current_carrier (string), end_user_name (string), foc_date (string), host_messaging (boolean), id (string), inserted_at (string), lsr (arraystring]), phone_numbers (arraystring]), pon (string), reason (string | null), record_type (string), rejection_code (integer), requested_foc_date (string), service_address (string), spid (string), state (string), status (enum: pending, authorized, ported, rejected, rejected-pending, canceled), support_key (string), updated_at (string), user_id (uuid), vendor (uuid), zip (string)
Returns a list of comments for a portout request.
GET /portouts/{id}/comments
gocomments, err := client.Portouts.Comments.List(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") if err != nil { log.Fatal(err) } fmt.Printf("%+v\n", comments.Data)
Returns: body (string), created_at (string), id (string), portout_id (string), record_type (string), user_id (string)
Creates a comment on a portout request.
POST /portouts/{id}/comments
Optional: body (string)
gocomment, err := client.Portouts.Comments.New( context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", telnyx.PortoutCommentNewParams{}, ) if err != nil { log.Fatal(err) } fmt.Printf("%+v\n", comment.Data)
Returns: body (string), created_at (string), id (string), portout_id (string), record_type (string), user_id (string)
List every supporting documents for a portout request.
GET /portouts/{id}/supporting_documents
gosupportingDocuments, err := client.Portouts.SupportingDocuments.List(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") if err != nil { log.Fatal(err) } fmt.Printf("%+v\n", supportingDocuments.Data)
Returns: created_at (string), document_id (uuid), id (uuid), portout_id (uuid), record_type (string), type (enum: loa, invoice), updated_at (string)
Creates a list of supporting documents on a portout request.
POST /portouts/{id}/supporting_documents
Optional: documents (arrayobject])
gosupportingDocument, err := client.Portouts.SupportingDocuments.New( context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", telnyx.PortoutSupportingDocumentNewParams{}, ) if err != nil { log.Fatal(err) } fmt.Printf("%+v\n", supportingDocument.Data)
Returns: created_at (string), document_id (uuid), id (uuid), portout_id (uuid), record_type (string), type (enum: loa, invoice), updated_at (string)
Authorize or reject portout request
PATCH /portouts/{id}/{status} — Required: reason
Optional: host_messaging (boolean)
goresponse, err := client.Portouts.UpdateStatus( context.Background(), telnyx.PortoutUpdateStatusParamsStatusAuthorized, telnyx.PortoutUpdateStatusParams{ ID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", Reason: "I do not recognize this transaction", }, ) if err != nil { log.Fatal(err) } fmt.Printf("%+v\n", response.Data)
Returns: already_ported (boolean), authorized_name (string), carrier_name (string), city (string), created_at (string), current_carrier (string), end_user_name (string), foc_date (string), host_messaging (boolean), id (string), inserted_at (string), lsr (arraystring]), phone_numbers (arraystring]), pon (string), reason (string | null), record_type (string), rejection_code (integer), requested_foc_date (string), service_address (string), spid (string), state (string), status (enum: pending, authorized, ported, rejected, rejected-pending, canceled), support_key (string), updated_at (string), user_id (uuid), vendor (uuid), zip (string)
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 10,360 | 4,537 | -56% | 1 | 1 | 0% | 1,934 | 4,551 | +135% | 0 | 0 | — |
case-02 | fail→pass | 11,147 | 7,771 | -30% | 1 | 1 | 0% | 2,242 | 5,338 | +138% | 0 | 0 | — |
case-20 | pass→pass | 12,163 | 3,389 | -72% | 1 | 1 | 0% | 2,545 | 4,367 | +72% | 0 | 0 | — |
case-21 | fail→pass | 8,890 | 4,333 | -51% | 1 | 1 | 0% | 1,725 | 4,551 | +164% | 0 | 0 | — |
case-03 | fail→pass | 10,761 | 7,408 | -31% | 1 | 1 | 0% | 2,241 | 5,380 | +140% | 0 | 0 | — |
case-04 | fail→pass | 29,474 | 7,729 | -74% | 1 | 1 | 0% | 1,841 | 5,144 | +179% | 0 | 0 | — |
case-05 | pass→pass | 13,340 | 7,342 | -45% | 1 | 1 | 0% | 2,550 | 5,014 | +97% | 0 | 0 | — |
case-06 | fail→pass | 9,916 | 5,670 | -43% | 1 | 1 | 0% | 2,132 | 4,852 | +128% | 0 | 0 | — |
case-07 | pass→pass | 7,220 | 2,703 | -63% | 1 | 1 | 0% | 1,442 | 4,229 | +193% | 0 | 0 | — |
case-08 | fail→pass | 8,102 | 2,326 | -71% | 1 | 1 | 0% | 1,649 | 4,113 | +149% | 0 | 0 | — |
case-09 | pass→pass | 8,746 | 2,693 | -69% | 1 | 1 | 0% | 1,776 | 4,279 | +141% | 0 | 0 | — |
case-10 | fail→pass | 8,279 | 3,891 | -53% | 1 | 1 | 0% | 1,668 | 4,454 | +167% | 0 | 0 | — |
case-11 | fail→pass | 9,443 | 3,430 | -64% | 1 | 1 | 0% | 2,238 | 4,348 | +94% | 0 | 0 | — |
case-12 | fail→pass | 9,790 | 2,480 | -75% | 1 | 1 | 0% | 2,149 | 4,148 | +93% | 0 | 0 | — |
case-13 | fail→pass | 12,144 | 2,364 | -81% | 1 | 1 | 0% | 2,610 | 4,142 | +59% | 0 | 0 | — |
case-14 | fail→pass | 8,004 | 4,988 | -38% | 1 | 1 | 0% | 1,817 | 4,596 | +153% | 0 | 0 | — |
case-15 | fail→pass | 9,586 | 2,933 | -69% | 1 | 1 | 0% | 1,914 | 4,296 | +124% | 0 | 0 | — |
case-16 | fail→pass | 13,150 | 4,307 | -67% | 1 | 1 | 0% | 2,717 | 4,547 | +67% | 0 | 0 | — |
case-17 | fail→pass | 9,058 | 2,347 | -74% | 1 | 1 | 0% | 1,786 | 4,058 | +127% | 0 | 0 | — |
case-18 | pass→pass | 9,439 | 5,732 | -39% | 1 | 1 | 0% | 1,950 | 4,939 | +153% | 0 | 0 | — |
case-19 | fail→pass | 15,282 | 3,729 | -76% | 1 | 1 | 0% | 3,101 | 4,366 | +41% | 0 | 0 | — |
case-22 | fail→pass | 26,341 | 1,838 | -93% | 1 | 1 | 0% | 1,514 | 3,969 | +162% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 20 counted toward the lift figure. The other 2 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +77 percentage points is the difference between those two pass rates over the 20 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.