Skip to main content
PATCH
/
portouts
/
{id}
/
{status}
JavaScript
import Telnyx from 'telnyx';

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

const response = await client.portouts.updateStatus('authorized', {
  id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  reason: 'I do not recognize this transaction',
});

console.log(response.data);
import os
from telnyx import Telnyx

client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.portouts.update_status(
status="authorized",
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
reason="I do not recognize this transaction",
)
print(response.data)
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"),
)
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)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.portouts.PortoutUpdateStatusParams;
import com.telnyx.sdk.models.portouts.PortoutUpdateStatusResponse;

public final class Main {
private Main() {}

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

PortoutUpdateStatusParams params = PortoutUpdateStatusParams.builder()
.id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.status(PortoutUpdateStatusParams.Status.AUTHORIZED)
.reason("I do not recognize this transaction")
.build();
PortoutUpdateStatusResponse response = client.portouts().updateStatus(params);
}
}
require "telnyx"

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

response = telnyx.portouts.update_status(
:authorized,
id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
reason: "I do not recognize this transaction"
)

puts(response)
<?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 {
$response = $client->portouts->updateStatus(
'authorized',
id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
reason: 'I do not recognize this transaction',
hostMessaging: false,
);

var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx portouts update-status \
--api-key 'My API Key' \
--id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--status authorized \
--reason 'I do not recognize this transaction'
curl --request PATCH \
--url https://api.telnyx.com/v2/portouts/{id}/{status} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "I do not recognize this transaction",
"host_messaging": false
}
'
{
  "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
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string<uuid>
required

Portout id

status
enum<string>
required

Updated portout status

Available options:
authorized,
rejected-pending

Body

application/json
reason
string
required

Provide a reason if rejecting the port out request

Example:

"I do not recognize this transaction"

host_messaging
boolean
default:false

Indicates whether messaging services should be maintained with Telnyx after the port out completes

Example:

false

Response

Portout Response

data
object