Skip to main content
GET
/
portouts
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const portoutDetails of client.portouts.list()) {
  console.log(portoutDetails.id);
}
import os
from telnyx import Telnyx

client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.portouts.list()
page = page.data[0]
print(page.id)
package main

import (
"context"
"fmt"

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

func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Portouts.List(context.TODO(), telnyx.PortoutListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.portouts.PortoutListPage;
import com.telnyx.sdk.models.portouts.PortoutListParams;

public final class Main {
private Main() {}

public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();

PortoutListPage page = client.portouts().list();
}
}
require "telnyx"

telnyx = Telnyx::Client.new(api_key: "My API Key")

page = telnyx.portouts.list

puts(page)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');

try {
$page = $client->portouts->list(
filter: [
'carrierName' => 'carrier_name',
'countryCode' => 'US',
'countryCodeIn' => ['CA', 'US'],
'focDate' => new \DateTimeImmutable('2024-09-04T00:00:00.000Z'),
'insertedAt' => [
'gte' => new \DateTimeImmutable('2024-09-04T00:00:00.000Z'),
'lte' => new \DateTimeImmutable('2024-09-04T00:00:00.000Z'),
],
'phoneNumber' => '+13035551212',
'pon' => 'pon',
'portedOutAt' => [
'gte' => new \DateTimeImmutable('2024-09-04T00:00:00.000Z'),
'lte' => new \DateTimeImmutable('2024-09-04T00:00:00.000Z'),
],
'spid' => 'spid',
'status' => 'pending',
'statusIn' => ['pending'],
'supportKey' => 'PO_abc123',
],
pageNumber: 0,
pageSize: 0,
);

var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx portouts list \
--api-key 'My API Key'
curl --request GET \
--url https://api.telnyx.com/v2/portouts \
--header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "0ccc7b54-4df3-4bca-a65a-3da1ecc777f0",
      "record_type": "portout",
      "phone_numbers": [
        "+35312345678"
      ],
      "authorized_name": "McPortersen",
      "carrier_name": "test",
      "current_carrier": "telnyx",
      "end_user_name": "McPortersen",
      "city": "Chicago",
      "state": "IL",
      "zip": "00000",
      "lsr": [
        "https://example.com/files/lsr.pdf"
      ],
      "pon": "00000000",
      "reason": null,
      "rejection_code": 1002,
      "service_address": "000 Example Street",
      "foc_date": "2018-02-02T22:25:27.521Z",
      "requested_foc_date": "2018-02-02T22:25:27.521Z",
      "spid": "0ccc7b54-4df3-4bca-a65a-3da1ecc777f0",
      "support_key": "PO_764725",
      "status": "rejected",
      "already_ported": false,
      "user_id": "7865816a-ee85-4e50-b19e-52983dcc6d4a",
      "vendor": "0e66ed3b-37e6-4fed-93d6-a30ce2493661",
      "created_at": "2018-02-02T22:25:27.521Z",
      "inserted_at": "2018-02-02T22:25:27.521Z",
      "updated_at": "2018-02-02T22:25:27.521Z",
      "host_messaging": false
    }
  ],
  "meta": {
    "total_pages": 13,
    "total_results": 13,
    "page_number": 3,
    "page_size": 1
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

page
object

Consolidated page parameter (deepObject style). Originally: page[number], page[size]

filter
object

Consolidated filter parameter (deepObject style). Originally: filter[carrier_name], filter[country_code], filter[country_code_in], filter[foc_date], filter[inserted_at], filter[phone_number], filter[pon], filter[ported_out_at], filter[spid], filter[status], filter[status_in], filter[support_key]

Response

Portout Response

data
object[]
meta
Metadata · object