Skip to main content
DELETE
/
10dlc
/
phone_number_campaigns
/
{phoneNumber}
JavaScript
import Telnyx from 'telnyx';

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

const phoneNumberCampaign = await client.messaging10dlc.phoneNumberCampaigns.delete('phoneNumber');

console.log(phoneNumberCampaign.campaignId);
import os
from telnyx import Telnyx

client = Telnyx(
    api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
)
phone_number_campaign = client.messaging_10dlc.phone_number_campaigns.delete(
    "phoneNumber",
)
print(phone_number_campaign.campaign_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"),
	)
	phoneNumberCampaign, err := client.Messaging10dlc.PhoneNumberCampaigns.Delete(context.TODO(), "phoneNumber")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", phoneNumberCampaign.CampaignID)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messaging10dlc.phonenumbercampaigns.PhoneNumberCampaign;
import com.telnyx.sdk.models.messaging10dlc.phonenumbercampaigns.PhoneNumberCampaignDeleteParams;

public final class Main {
    private Main() {}

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

        PhoneNumberCampaign phoneNumberCampaign = client.messaging10dlc().phoneNumberCampaigns().delete("phoneNumber");
    }
}
require "telnyx"

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

phone_number_campaign = telnyx.messaging_10dlc.phone_number_campaigns.delete("phoneNumber")

puts(phone_number_campaign)
<?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 {
  $phoneNumberCampaign = $client->messaging10dlc->phoneNumberCampaigns->delete(
    'phoneNumber'
  );

  var_dump($phoneNumberCampaign);
} catch (APIException $e) {
  echo $e->getMessage();
}
telnyx messaging-10dlc:phone-number-campaigns delete \
  --api-key 'My API Key' \
  --phone-number phoneNumber
curl --request DELETE \
  --url https://api.telnyx.com/v2/10dlc/phone_number_campaigns/{phoneNumber} \
  --header 'Authorization: Bearer <token>'
{
  "phoneNumber": "+18005550199",
  "campaignId": "<string>",
  "createdAt": "2021-03-08T17:57:48.801186",
  "updatedAt": "2021-03-08T17:57:48.801186",
  "brandId": "7ba705b7-22af-493f-addc-ac04b7ca071c",
  "tcrBrandId": "BBRAND1",
  "tcrCampaignId": "CCAMPA1",
  "telnyxCampaignId": "3008dd9f-66d7-40e0-bf23-bf2d8d1a96ba",
  "assignmentStatus": "ASSIGNED",
  "failureReasons": "<string>"
}
{
  "errors": [
    {
      "code": "<string>",
      "title": "<string>",
      "detail": "<string>",
      "source": {
        "pointer": "<string>",
        "parameter": "<string>"
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

phoneNumber
string
required

Unique identifier of the phone number.

Response

Successful Response

phoneNumber
string
required
Example:

"+18005550199"

campaignId
string
required

For shared campaigns, this is the TCR campaign ID, otherwise it is the campaign ID

createdAt
string
required
Example:

"2021-03-08T17:57:48.801186"

updatedAt
string
required
Example:

"2021-03-08T17:57:48.801186"

brandId
string

Brand ID. Empty if the number is associated to a shared campaign.

Example:

"7ba705b7-22af-493f-addc-ac04b7ca071c"

tcrBrandId
string

TCR's alphanumeric ID for the brand.

Example:

"BBRAND1"

tcrCampaignId
string

TCR's alphanumeric ID for the campaign.

Example:

"CCAMPA1"

telnyxCampaignId
string

Campaign ID. Empty if the number is associated to a shared campaign.

Example:

"3008dd9f-66d7-40e0-bf23-bf2d8d1a96ba"

assignmentStatus
enum<string>

The assignment status of the number.

Available options:
FAILED_ASSIGNMENT,
PENDING_ASSIGNMENT,
ASSIGNED,
PENDING_UNASSIGNMENT,
FAILED_UNASSIGNMENT
Example:

"ASSIGNED"

failureReasons
string

Extra info about a failure to assign/unassign a number. Relevant only if the assignmentStatus is either FAILED_ASSIGNMENT or FAILED_UNASSIGNMENT