Skip to main content
DELETE
/
messaging_hosted_number_orders
/
{id}
JavaScript
import Telnyx from 'telnyx';

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

const messagingHostedNumberOrder = await client.messagingHostedNumberOrders.delete('id');

console.log(messagingHostedNumberOrder.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
)
messaging_hosted_number_order = client.messaging_hosted_number_orders.delete(
"id",
)
print(messaging_hosted_number_order.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"),
)
messagingHostedNumberOrder, err := client.MessagingHostedNumberOrders.Delete(context.TODO(), "id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", messagingHostedNumberOrder.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messaginghostednumberorders.MessagingHostedNumberOrderDeleteParams;
import com.telnyx.sdk.models.messaginghostednumberorders.MessagingHostedNumberOrderDeleteResponse;

public final class Main {
private Main() {}

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

MessagingHostedNumberOrderDeleteResponse messagingHostedNumberOrder = client.messagingHostedNumberOrders().delete("id");
}
}
require "telnyx"

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

messaging_hosted_number_order = telnyx.messaging_hosted_number_orders.delete("id")

puts(messaging_hosted_number_order)
<?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 {
$messagingHostedNumberOrder = $client->messagingHostedNumberOrders->delete(
'id'
);

var_dump($messagingHostedNumberOrder);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx messaging-hosted-number-orders delete \
--api-key 'My API Key' \
--id id
curl --request DELETE \
--url https://api.telnyx.com/v2/messaging_hosted_number_orders/{id} \
--header 'Authorization: Bearer <token>'
{
  "data": {
    "id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
    "record_type": "messaging_hosted_number_order",
    "messaging_profile_id": "dc8f39ac-953d-4520-b93b-786ae87db0da",
    "status": "pending",
    "phone_numbers": [
      {
        "record_type": "messaging_hosted_number",
        "id": "bf6307bd-884d-4c1f-b6ea-c62b8c495d3c",
        "phone_number": "+18665550001",
        "status": "pending"
      },
      {
        "record_type": "messaging_hosted_number",
        "id": "464bd54e-a328-4b11-a131-28e6793cb6f2",
        "phone_number": "+18665550002",
        "status": "pending"
      }
    ]
  }
}
{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

Identifies the messaging hosted number order to delete.

Response

Successful response with details about a messaging hosted number order.

data
object
Example:
{
"id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
"record_type": "messaging_hosted_number_order",
"messaging_profile_id": "dc8f39ac-953d-4520-b93b-786ae87db0da",
"status": "pending",
"phone_numbers": [
{
"record_type": "messaging_hosted_number",
"id": "bf6307bd-884d-4c1f-b6ea-c62b8c495d3c",
"phone_number": "+18665550001",
"status": "pending"
},
{
"record_type": "messaging_hosted_number",
"id": "464bd54e-a328-4b11-a131-28e6793cb6f2",
"phone_number": "+18665550002",
"status": "pending"
}
]
}