team-telnyx/ai

telnyx-porting-in-go

>- Port phone numbers into Telnyx. Check portability, create port orders, upload LOA documents, and track porting status. This skill provides Go SDK examples.

First seen Apr 27, 2026

Installation

$ npx skills add team-telnyx/ai --skill telnyx-porting-in-go

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from team-telnyx/ai · top by installs.

npx skills add team-telnyx/ai

Browse all from team-telnyx/ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 213
License LICENSE
Default branch main
Open issues 2
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

More metadata
author
telnyx
product
porting-in
language
go
generated_by
telnyx-openapi-pipeline

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 40,044 B
  • docs SUMMARY.md 183 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 12 installs

SKILL.md

<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->

Telnyx Porting In - 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.

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 "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).

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() }.

Run a portability check

Runs a portability check, returning the results immediately.

POST /portability_checks

Optional: phone_numbers (array[string])

	response, err := client.PortabilityChecks.Run(context.Background(), telnyx.PortabilityCheckRunParams{
		PhoneNumbers: []string{"+18005550101"},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Returns: fastportable (boolean), notportablereason (string), phonenumber (string), portable (boolean), record_type (string)

List all porting events

Returns a list of all porting events.

GET /porting/events

	page, err := client.Porting.Events.List(context.Background(), telnyx.PortingEventListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: availablenotificationmethods (array[string]), eventtype (enum: portingorder.deleted), id (uuid), payload (object), payloadstatus (enum: created, completed), portingorder_id (uuid)

Show a porting event

Show a specific porting event.

GET /porting/events/{id}

	event, err := client.Porting.Events.Get(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", event.Data)

Returns: availablenotificationmethods (array[string]), eventtype (enum: portingorder.deleted), id (uuid), payload (object), payloadstatus (enum: created, completed), portingorder_id (uuid)

Republish a porting event

Republish a specific porting event.

POST /porting/events/{id}/republish

	err := client.Porting.Events.Republish(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
	if err != nil {
		log.Fatal(err)
	}

List LOA configurations

List the LOA configurations.

GET /porting/loa_configurations

	page, err := client.Porting.LoaConfigurations.List(context.Background(), telnyx.PortingLoaConfigurationListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: address (object), companyname (string), contact (object), createdat (date-time), id (uuid), logo (object), name (string), organizationid (string), recordtype (string), updated_at (date-time)

Create a LOA configuration

Create a LOA configuration.

POST /porting/loa_configurations

	loaConfiguration, err := client.Porting.LoaConfigurations.New(context.Background(), telnyx.PortingLoaConfigurationNewParams{
		Address: telnyx.PortingLoaConfigurationNewParamsAddress{
			City:          "Austin",
			CountryCode:   "US",
			State:         "TX",
			StreetAddress: "600 Congress Avenue",
			ZipCode:       "78701",
		},
		CompanyName: "Telnyx",
		Contact: telnyx.PortingLoaConfigurationNewParamsContact{
			Email:       "[email protected]",
			PhoneNumber: "+12003270001",
		},
		Logo: telnyx.PortingLoaConfigurationNewParamsLogo{
			DocumentID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		},
		Name: "My LOA Configuration",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", loaConfiguration.Data)

Returns: address (object), companyname (string), contact (object), createdat (date-time), id (uuid), logo (object), name (string), organizationid (string), recordtype (string), updated_at (date-time)

Preview the LOA configuration parameters

Preview the LOA template that would be generated without need to create LOA configuration.

POST /porting/loa_configurations/preview

	response, err := client.Porting.LoaConfigurations.Preview(context.Background(), telnyx.PortingLoaConfigurationPreviewParams{
		Address: telnyx.PortingLoaConfigurationPreviewParamsAddress{
			City:          "Austin",
			CountryCode:   "US",
			State:         "TX",
			StreetAddress: "600 Congress Avenue",
			ZipCode:       "78701",
		},
		CompanyName: "Telnyx",
		Contact: telnyx.PortingLoaConfigurationPreviewParamsContact{
			Email:       "[email protected]",
			PhoneNumber: "+12003270001",
		},
		Logo: telnyx.PortingLoaConfigurationPreviewParamsLogo{
			DocumentID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		},
		Name: "My LOA Configuration",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response)

Retrieve a LOA configuration

Retrieve a specific LOA configuration.

GET /porting/loa_configurations/{id}

	loaConfiguration, err := client.Porting.LoaConfigurations.Get(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", loaConfiguration.Data)

Returns: address (object), companyname (string), contact (object), createdat (date-time), id (uuid), logo (object), name (string), organizationid (string), recordtype (string), updated_at (date-time)

Update a LOA configuration

Update a specific LOA configuration.

PATCH /porting/loa_configurations/{id}

	loaConfiguration, err := client.Porting.LoaConfigurations.Update(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingLoaConfigurationUpdateParams{
			Address: telnyx.PortingLoaConfigurationUpdateParamsAddress{
				City:          "Austin",
				CountryCode:   "US",
				State:         "TX",
				StreetAddress: "600 Congress Avenue",
				ZipCode:       "78701",
			},
			CompanyName: "Telnyx",
			Contact: telnyx.PortingLoaConfigurationUpdateParamsContact{
				Email:       "[email protected]",
				PhoneNumber: "+12003270001",
			},
			Logo: telnyx.PortingLoaConfigurationUpdateParamsLogo{
				DocumentID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
			},
			Name: "My LOA Configuration",
		},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", loaConfiguration.Data)

Returns: address (object), companyname (string), contact (object), createdat (date-time), id (uuid), logo (object), name (string), organizationid (string), recordtype (string), updated_at (date-time)

Delete a LOA configuration

Delete a specific LOA configuration.

DELETE /porting/loa_configurations/{id}

	err := client.Porting.LoaConfigurations.Delete(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
	if err != nil {
		log.Fatal(err)
	}

Preview a LOA configuration

Preview a specific LOA configuration.

GET /porting/loa_configurations/{id}/preview

	response, err := client.Porting.LoaConfigurations.Preview1(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response)

List porting related reports

List the reports generated about porting operations.

GET /porting/reports

	page, err := client.Porting.Reports.List(context.Background(), telnyx.PortingReportListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: createdat (date-time), documentid (uuid), id (uuid), params (object), recordtype (string), reporttype (enum: exportportingorderscsv), status (enum: pending, completed), updatedat (date-time)

Create a porting related report

Generate reports about porting operations.

POST /porting/reports

	report, err := client.Porting.Reports.New(context.Background(), telnyx.PortingReportNewParams{
		Params: telnyx.ExportPortingOrdersCsvReportParam{
			Filters: telnyx.ExportPortingOrdersCsvReportFiltersParam{},
		},
		ReportType: telnyx.PortingReportNewParamsReportTypeExportPortingOrdersCsv,
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", report.Data)

Returns: createdat (date-time), documentid (uuid), id (uuid), params (object), recordtype (string), reporttype (enum: exportportingorderscsv), status (enum: pending, completed), updatedat (date-time)

Retrieve a report

Retrieve a specific report generated.

GET /porting/reports/{id}

	report, err := client.Porting.Reports.Get(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", report.Data)

Returns: createdat (date-time), documentid (uuid), id (uuid), params (object), recordtype (string), reporttype (enum: exportportingorderscsv), status (enum: pending, completed), updatedat (date-time)

List available carriers in the UK

List available carriers in the UK.

GET /porting/uk_carriers

	response, err := client.Porting.ListUkCarriers(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Returns: alternativecupids (array[string]), createdat (date-time), cupid (string), id (uuid), name (string), recordtype (string), updatedat (date-time)

List all porting orders

Returns a list of your porting order.

GET /porting_orders

	page, err := client.PortingOrders.List(context.Background(), telnyx.PortingOrderListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: activationsettings (object), additionalsteps (array[string]), createdat (date-time), customergroupreference (string | null), customerreference (string | null), description (string), documents (object), enduser (object), id (uuid), messaging (object), misc (object), oldserviceproviderocn (string), parentsupportkey (string | null), phonenumberconfiguration (object), phonenumbertype (enum: landline, local, mobile, national, sharedcost, tollfree), phonenumbers (array[object]), portingphonenumberscount (integer), recordtype (string), requirements (array[object]), requirementsmet (boolean), status (object), supportkey (string | null), updatedat (date-time), userfeedback (object), userid (uuid), webhook_url (uri)

Create a porting order

Creates a new porting order object.

POST /portingorders — Required: phonenumbers

Optional: customergroupreference (string), customer_reference (string | null)

	portingOrder, err := client.PortingOrders.New(context.Background(), telnyx.PortingOrderNewParams{
		PhoneNumbers: []string{"+13035550000", "+13035550001", "+13035550002"},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", portingOrder.Data)

Returns: activationsettings (object), additionalsteps (array[string]), createdat (date-time), customergroupreference (string | null), customerreference (string | null), description (string), documents (object), enduser (object), id (uuid), messaging (object), misc (object), oldserviceproviderocn (string), parentsupportkey (string | null), phonenumberconfiguration (object), phonenumbertype (enum: landline, local, mobile, national, sharedcost, tollfree), phonenumbers (array[object]), portingphonenumberscount (integer), recordtype (string), requirements (array[object]), requirementsmet (boolean), status (object), supportkey (string | null), updatedat (date-time), userfeedback (object), userid (uuid), webhook_url (uri)

List all exception types

Returns a list of all possible exception types for a porting order.

GET /portingorders/exceptiontypes

	response, err := client.PortingOrders.GetExceptionTypes(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Returns: code (enum: ACCOUNTNUMBERMISMATCH, AUTHPERSONMISMATCH, BTNATNMISMATCH, ENTITYNAMEMISMATCH, FOCEXPIRED, FOCREJECTED, LOCATIONMISMATCH, LSRPENDING, MAINBTNPORTING, OSPIRRESPONSIVE, OTHER, PASSCODEPININVALID, PHONENUMBERHASSPECIALFEATURE, PHONENUMBERMISMATCH, PHONENUMBERNOTPORTABLE, PORTTYPEINCORRECT, PORTINGORDERSPLITREQUIRED, POSTALCODEMISMATCH, RATECENTERNOTPORTABLE, SVCONFLICT, SVUNKNOWN_FAILURE), description (string)

List all phone number configurations

Returns a list of phone number configurations paginated.

GET /portingorders/phonenumber_configurations

	page, err := client.PortingOrders.PhoneNumberConfigurations.List(context.Background(), telnyx.PortingOrderPhoneNumberConfigurationListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: createdat (date-time), id (uuid), portingphonenumberid (uuid), recordtype (string), updatedat (date-time), userbundleid (uuid)

Create a list of phone number configurations

Creates a list of phone number configurations.

POST /portingorders/phonenumber_configurations

	phoneNumberConfiguration, err := client.PortingOrders.PhoneNumberConfigurations.New(context.Background(), telnyx.PortingOrderPhoneNumberConfigurationNewParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", phoneNumberConfiguration.Data)

Returns: createdat (date-time), id (uuid), portingphonenumberid (uuid), recordtype (string), updatedat (date-time), userbundleid (uuid)

Retrieve a porting order

Retrieves the details of an existing porting order.

GET /porting_orders/{id}

	portingOrder, err := client.PortingOrders.Get(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderGetParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", portingOrder.Data)

Returns: activationsettings (object), additionalsteps (array[string]), createdat (date-time), customergroupreference (string | null), customerreference (string | null), description (string), documents (object), enduser (object), id (uuid), messaging (object), misc (object), oldserviceproviderocn (string), parentsupportkey (string | null), phonenumberconfiguration (object), phonenumbertype (enum: landline, local, mobile, national, sharedcost, tollfree), phonenumbers (array[object]), portingphonenumberscount (integer), recordtype (string), requirements (array[object]), requirementsmet (boolean), status (object), supportkey (string | null), updatedat (date-time), userfeedback (object), userid (uuid), webhook_url (uri)

Edit a porting order

Edits the details of an existing porting order. Any or all of a porting orders attributes may be included in the resource object included in a PATCH request. If a request does not include all of the attributes for a resource, the system will interpret the missing attributes as if they were included with their current values.

PATCH /porting_orders/{id}

Optional: activationsettings (object), customergroupreference (string), customerreference (string), documents (object), enduser (object), messaging (object), misc (object), phonenumberconfiguration (object), requirementgroupid (uuid), requirements (array[object]), userfeedback (object), webhook_url (uri)

	portingOrder, err := client.PortingOrders.Update(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderUpdateParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", portingOrder.Data)

Returns: activationsettings (object), additionalsteps (array[string]), createdat (date-time), customergroupreference (string | null), customerreference (string | null), description (string), documents (object), enduser (object), id (uuid), messaging (object), misc (object), oldserviceproviderocn (string), parentsupportkey (string | null), phonenumberconfiguration (object), phonenumbertype (enum: landline, local, mobile, national, sharedcost, tollfree), phonenumbers (array[object]), portingphonenumberscount (integer), recordtype (string), requirements (array[object]), requirementsmet (boolean), status (object), supportkey (string | null), updatedat (date-time), userfeedback (object), userid (uuid), webhook_url (uri)

Delete a porting order

Deletes an existing porting order. This operation is restrict to porting orders in draft state.

DELETE /porting_orders/{id}

	err := client.PortingOrders.Delete(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
	if err != nil {
		log.Fatal(err)
	}

Activate every number in a porting order asynchronously.

Activate each number in a porting order asynchronously. This operation is limited to US FastPort orders only.

POST /porting_orders/{id}/actions/activate

	response, err := client.PortingOrders.Actions.Activate(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Returns: activateat (date-time), activationtype (enum: scheduled, on-demand), activationwindows (array[object]), createdat (date-time), id (uuid), recordtype (string), status (enum: created, in-process, completed, failed), updatedat (date-time)

Cancel a porting order

POST /porting_orders/{id}/actions/cancel

	response, err := client.PortingOrders.Actions.Cancel(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Returns: activationsettings (object), additionalsteps (array[string]), createdat (date-time), customergroupreference (string | null), customerreference (string | null), description (string), documents (object), enduser (object), id (uuid), messaging (object), misc (object), oldserviceproviderocn (string), parentsupportkey (string | null), phonenumberconfiguration (object), phonenumbertype (enum: landline, local, mobile, national, sharedcost, tollfree), phonenumbers (array[object]), portingphonenumberscount (integer), recordtype (string), requirements (array[object]), requirementsmet (boolean), status (object), supportkey (string | null), updatedat (date-time), userfeedback (object), userid (uuid), webhook_url (uri)

Submit a porting order.

Confirm and submit your porting order.

POST /porting_orders/{id}/actions/confirm

	response, err := client.PortingOrders.Actions.Confirm(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Returns: activationsettings (object), additionalsteps (array[string]), createdat (date-time), customergroupreference (string | null), customerreference (string | null), description (string), documents (object), enduser (object), id (uuid), messaging (object), misc (object), oldserviceproviderocn (string), parentsupportkey (string | null), phonenumberconfiguration (object), phonenumbertype (enum: landline, local, mobile, national, sharedcost, tollfree), phonenumbers (array[object]), portingphonenumberscount (integer), recordtype (string), requirements (array[object]), requirementsmet (boolean), status (object), supportkey (string | null), updatedat (date-time), userfeedback (object), userid (uuid), webhook_url (uri)

Share a porting order

Creates a sharing token for a porting order. The token can be used to share the porting order with non-Telnyx users.

POST /porting_orders/{id}/actions/share

	response, err := client.PortingOrders.Actions.Share(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderActionShareParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Returns: createdat (date-time), expiresat (date-time), expiresinseconds (integer), id (uuid), permissions (array[string]), portingorderid (uuid), record_type (string), token (string)

List all porting activation jobs

Returns a list of your porting activation jobs.

GET /portingorders/{id}/activationjobs

	page, err := client.PortingOrders.ActivationJobs.List(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderActivationJobListParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: activateat (date-time), activationtype (enum: scheduled, on-demand), activationwindows (array[object]), createdat (date-time), id (uuid), recordtype (string), status (enum: created, in-process, completed, failed), updatedat (date-time)

Retrieve a porting activation job

Returns a porting activation job.

GET /portingorders/{id}/activationjobs/{activationJobId}

	activationJob, err := client.PortingOrders.ActivationJobs.Get(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderActivationJobGetParams{
			ID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", activationJob.Data)

Returns: activateat (date-time), activationtype (enum: scheduled, on-demand), activationwindows (array[object]), createdat (date-time), id (uuid), recordtype (string), status (enum: created, in-process, completed, failed), updatedat (date-time)

Update a porting activation job

Updates the activation time of a porting activation job.

PATCH /portingorders/{id}/activationjobs/{activationJobId}

	activationJob, err := client.PortingOrders.ActivationJobs.Update(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderActivationJobUpdateParams{
			ID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", activationJob.Data)

Returns: activateat (date-time), activationtype (enum: scheduled, on-demand), activationwindows (array[object]), createdat (date-time), id (uuid), recordtype (string), status (enum: created, in-process, completed, failed), updatedat (date-time)

List additional documents

Returns a list of additional documents for a porting order.

GET /portingorders/{id}/additionaldocuments

	page, err := client.PortingOrders.AdditionalDocuments.List(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderAdditionalDocumentListParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: contenttype (string), createdat (date-time), documentid (uuid), documenttype (enum: loa, invoice, csr, other), filename (string), id (uuid), portingorderid (uuid), recordtype (string), updatedat (date-time)

Create a list of additional documents

Creates a list of additional documents for a porting order.

POST /portingorders/{id}/additionaldocuments

	additionalDocument, err := client.PortingOrders.AdditionalDocuments.New(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderAdditionalDocumentNewParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", additionalDocument.Data)

Returns: contenttype (string), createdat (date-time), documentid (uuid), documenttype (enum: loa, invoice, csr, other), filename (string), id (uuid), portingorderid (uuid), recordtype (string), updatedat (date-time)

Delete an additional document

Deletes an additional document for a porting order.

DELETE /portingorders/{id}/additionaldocuments/{additionaldocumentid}

	err := client.PortingOrders.AdditionalDocuments.Delete(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderAdditionalDocumentDeleteParams{
			ID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		},
	)
	if err != nil {
		log.Fatal(err)
	}

List allowed FOC dates

Returns a list of allowed FOC dates for a porting order.

GET /portingorders/{id}/allowedfoc_windows

	response, err := client.PortingOrders.GetAllowedFocWindows(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Returns: endedat (date-time), recordtype (string), started_at (date-time)

List all comments of a porting order

Returns a list of all comments of a porting order.

GET /porting_orders/{id}/comments

	page, err := client.PortingOrders.Comments.List(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderCommentListParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: body (string), createdat (date-time), id (uuid), portingorderid (uuid), recordtype (string), user_type (enum: admin, user, system)

Create a comment for a porting order

Creates a new comment for a porting order.

POST /porting_orders/{id}/comments

Optional: body (string)

	comment, err := client.PortingOrders.Comments.New(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderCommentNewParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", comment.Data)

Returns: body (string), createdat (date-time), id (uuid), portingorderid (uuid), recordtype (string), user_type (enum: admin, user, system)

Download a porting order loa template

GET /portingorders/{id}/loatemplate

	response, err := client.PortingOrders.GetLoaTemplate(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderGetLoaTemplateParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response)

List porting order requirements

Returns a list of all requirements based on country/number type for this porting order.

GET /porting_orders/{id}/requirements

	page, err := client.PortingOrders.GetRequirements(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderGetRequirementsParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: fieldtype (enum: document, textual), fieldvalue (string), recordtype (string), requirementstatus (string), requirement_type (object)

Retrieve the associated V1 subrequestid and portrequestid

GET /portingorders/{id}/subrequest

	response, err := client.PortingOrders.GetSubRequest(context.Background(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Returns: portrequestid (string), subrequestid (string)

List verification codes

Returns a list of verification codes for a porting order.

GET /portingorders/{id}/verificationcodes

	page, err := client.PortingOrders.VerificationCodes.List(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderVerificationCodeListParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: createdat (date-time), id (uuid), phonenumber (string), portingorderid (uuid), recordtype (string), updatedat (date-time), verified (boolean)

Send the verification codes

Send the verification code for all porting phone numbers.

POST /portingorders/{id}/verificationcodes/send

	err := client.PortingOrders.VerificationCodes.Send(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderVerificationCodeSendParams{},
	)
	if err != nil {
		log.Fatal(err)
	}

Verify the verification code for a list of phone numbers

Verifies the verification code for a list of phone numbers.

POST /portingorders/{id}/verificationcodes/verify

	response, err := client.PortingOrders.VerificationCodes.Verify(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderVerificationCodeVerifyParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Returns: createdat (date-time), id (uuid), phonenumber (string), portingorderid (uuid), recordtype (string), updatedat (date-time), verified (boolean)

List action requirements for a porting order

Returns a list of action requirements for a specific porting order.

GET /portingorders/{portingorderid}/actionrequirements

	page, err := client.PortingOrders.ActionRequirements.List(
		context.Background(),
		"porting_order_id",
		telnyx.PortingOrderActionRequirementListParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: actiontype (string), actionurl (string | null), cancelreason (string | null), createdat (date-time), id (string), portingorderid (string), recordtype (enum: portingactionrequirement), requirementtypeid (string), status (enum: created, pending, completed, cancelled, failed), updatedat (date-time)

Initiate an action requirement

Initiates a specific action requirement for a porting order.

POST /portingorders/{portingorderid}/actionrequirements/{id}/initiate

	response, err := client.PortingOrders.ActionRequirements.Initiate(
		context.Background(),
		"id",
		telnyx.PortingOrderActionRequirementInitiateParams{
			PortingOrderID: "550e8400-e29b-41d4-a716-446655440000",
			Params: telnyx.PortingOrderActionRequirementInitiateParamsParams{
				FirstName: "John",
				LastName:  "Doe",
			},
		},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response.Data)

Returns: actiontype (string), actionurl (string | null), cancelreason (string | null), createdat (date-time), id (string), portingorderid (string), recordtype (enum: portingactionrequirement), requirementtypeid (string), status (enum: created, pending, completed, cancelled, failed), updatedat (date-time)

List all associated phone numbers

Returns a list of all associated phone numbers for a porting order. Associated phone numbers are used for partial porting in GB to specify which phone numbers should be kept or disconnected.

GET /portingorders/{portingorderid}/associatedphone_numbers

	page, err := client.PortingOrders.AssociatedPhoneNumbers.List(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderAssociatedPhoneNumberListParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: action (enum: keep, disconnect), countrycode (string), createdat (date-time), id (uuid), phonenumberrange (object), phonenumbertype (enum: landline, local, mobile, national, sharedcost, tollfree), portingorderid (uuid), recordtype (string), updatedat (date-time)

Create an associated phone number

Creates a new associated phone number for a porting order. This is used for partial porting in GB to specify which phone numbers should be kept or disconnected.

POST /portingorders/{portingorderid}/associatedphone_numbers

	associatedPhoneNumber, err := client.PortingOrders.AssociatedPhoneNumbers.New(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderAssociatedPhoneNumberNewParams{
			Action:           telnyx.PortingOrderAssociatedPhoneNumberNewParamsActionKeep,
			PhoneNumberRange: telnyx.PortingOrderAssociatedPhoneNumberNewParamsPhoneNumberRange{},
		},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", associatedPhoneNumber.Data)

Returns: action (enum: keep, disconnect), countrycode (string), createdat (date-time), id (uuid), phonenumberrange (object), phonenumbertype (enum: landline, local, mobile, national, sharedcost, tollfree), portingorderid (uuid), recordtype (string), updatedat (date-time)

Delete an associated phone number

Deletes an associated phone number from a porting order.

DELETE /portingorders/{portingorderid}/associatedphone_numbers/{id}

	associatedPhoneNumber, err := client.PortingOrders.AssociatedPhoneNumbers.Delete(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderAssociatedPhoneNumberDeleteParams{
			PortingOrderID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", associatedPhoneNumber.Data)

Returns: action (enum: keep, disconnect), countrycode (string), createdat (date-time), id (uuid), phonenumberrange (object), phonenumbertype (enum: landline, local, mobile, national, sharedcost, tollfree), portingorderid (uuid), recordtype (string), updatedat (date-time)

List all phone number blocks

Returns a list of all phone number blocks of a porting order.

GET /portingorders/{portingorderid}/phonenumber_blocks

	page, err := client.PortingOrders.PhoneNumberBlocks.List(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderPhoneNumberBlockListParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: activationranges (array[object]), countrycode (string), createdat (date-time), id (uuid), phonenumberrange (object), phonenumbertype (enum: landline, local, mobile, national, sharedcost, tollfree), recordtype (string), updated_at (date-time)

Create a phone number block

Creates a new phone number block.

POST /portingorders/{portingorderid}/phonenumber_blocks

	phoneNumberBlock, err := client.PortingOrders.PhoneNumberBlocks.New(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderPhoneNumberBlockNewParams{
			ActivationRanges: []telnyx.PortingOrderPhoneNumberBlockNewParamsActivationRange{{
				EndAt:   "+4930244999910",
				StartAt: "+4930244999901",
			}},
			PhoneNumberRange: telnyx.PortingOrderPhoneNumberBlockNewParamsPhoneNumberRange{
				EndAt:   "+4930244999910",
				StartAt: "+4930244999901",
			},
		},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", phoneNumberBlock.Data)

Returns: activationranges (array[object]), countrycode (string), createdat (date-time), id (uuid), phonenumberrange (object), phonenumbertype (enum: landline, local, mobile, national, sharedcost, tollfree), recordtype (string), updated_at (date-time)

Delete a phone number block

Deletes a phone number block.

DELETE /portingorders/{portingorderid}/phonenumber_blocks/{id}

	phoneNumberBlock, err := client.PortingOrders.PhoneNumberBlocks.Delete(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderPhoneNumberBlockDeleteParams{
			PortingOrderID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", phoneNumberBlock.Data)

Returns: activationranges (array[object]), countrycode (string), createdat (date-time), id (uuid), phonenumberrange (object), phonenumbertype (enum: landline, local, mobile, national, sharedcost, tollfree), recordtype (string), updated_at (date-time)

List all phone number extensions

Returns a list of all phone number extensions of a porting order.

GET /portingorders/{portingorderid}/phonenumber_extensions

	page, err := client.PortingOrders.PhoneNumberExtensions.List(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderPhoneNumberExtensionListParams{},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: activationranges (array[object]), createdat (date-time), extensionrange (object), id (uuid), portingphonenumberid (uuid), recordtype (string), updatedat (date-time)

Create a phone number extension

Creates a new phone number extension.

POST /portingorders/{portingorderid}/phonenumber_extensions

	phoneNumberExtension, err := client.PortingOrders.PhoneNumberExtensions.New(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderPhoneNumberExtensionNewParams{
			ActivationRanges: []telnyx.PortingOrderPhoneNumberExtensionNewParamsActivationRange{{
				EndAt:   10,
				StartAt: 1,
			}},
			ExtensionRange: telnyx.PortingOrderPhoneNumberExtensionNewParamsExtensionRange{
				EndAt:   10,
				StartAt: 1,
			},
			PortingPhoneNumberID: "f24151b6-3389-41d3-8747-7dd8c681e5e2",
		},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", phoneNumberExtension.Data)

Returns: activationranges (array[object]), createdat (date-time), extensionrange (object), id (uuid), portingphonenumberid (uuid), recordtype (string), updatedat (date-time)

Delete a phone number extension

Deletes a phone number extension.

DELETE /portingorders/{portingorderid}/phonenumber_extensions/{id}

	phoneNumberExtension, err := client.PortingOrders.PhoneNumberExtensions.Delete(
		context.Background(),
		"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		telnyx.PortingOrderPhoneNumberExtensionDeleteParams{
			PortingOrderID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
		},
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", phoneNumberExtension.Data)

Returns: activationranges (array[object]), createdat (date-time), extensionrange (object), id (uuid), portingphonenumberid (uuid), recordtype (string), updatedat (date-time)

List all porting phone numbers

Returns a list of your porting phone numbers.

GET /portingphonenumbers

	page, err := client.PortingPhoneNumbers.List(context.Background(), telnyx.PortingPhoneNumberListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)

Returns: activationstatus (enum: New, Pending, Conflict, Cancel Pending, Failed, Concurred, Activate RDY, Disconnect Pending, Concurrence Sent, Old, Sending, Active, Cancelled), phonenumber (string), phonenumbertype (enum: landline, local, mobile, national, sharedcost, tollfree), portabilitystatus (enum: pending, confirmed, provisional), portingorderid (uuid), portingorderstatus (enum: draft, in-process, submitted, exception, foc-date-confirmed, cancel-pending, ported, cancelled), recordtype (string), requirementsstatus (enum: requirement-info-pending, requirement-info-under-review, requirement-info-exception, approved), supportkey (string)