Phone Number Campaigns

Phone number campaign assignment

Create New Phone Number Campaign

Assign an individual phone number to campaign.

SecuritybearerAuth
Request
Request Body schema: application/json
required
phoneNumber
required
string (Phonenumber)

The phone number you want to link to a specified campaign.

campaignId
required
string (Campaignid)

The ID of the campaign you want to link to the specified phone number.

Responses
200

Successful Response

Response Schema: application/json
phoneNumber
required
string (Phonenumber)
campaignId
required
string (Campaignid)
createdAt
required
string <date-time> (Createdat)
updatedAt
required
string <date-time> (Updatedat)
post/phoneNumberCampaign
Request samples
application/json
{
  • "phoneNumber": "+18005550199",
  • "campaignId": "4b300178-131c-d902-d54e-72d90ba1620j"
}
Response samples
application/json
{
  • "phoneNumber": "string",
  • "campaignId": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Retrieve All Phone Number Campaigns

Retrieve all of your organization's phone number/campaign assignments.

SecuritybearerAuth
Request
query Parameters
recordsPerPage
any (Recordsperpage)
Default: 10
page
any (Page)
Default: 1
Responses
200

Successful Response

Response Schema: application/json
required
Array of objects (Records)
page
required
integer (Page)
totalRecords
required
integer (Totalrecords)
get/phoneNumberCampaign
Request samples
# install http://docs.python-requests.org/en/master/
import requests

url = 'https://api.telnyx.com/10dlc/phoneNumberCampaign'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json', 
  'Authorization': 'Bearer API_TOKEN'
}
response = requests.request('get', url, headers=headers)
print(response.text)
Response samples
application/json
{
  • "records": [
    • {
      • "phoneNumber": "string",
      • "campaignId": "string",
      • "createdAt": "2019-08-24T14:15:22Z",
      • "updatedAt": "2019-08-24T14:15:22Z"
      }
    ],
  • "page": 0,
  • "totalRecords": 0
}

Get Single Phone Number Campaign

Retrieve an individual phone number/campaign assignment by phoneNumber.

SecuritybearerAuth
Request
path Parameters
phoneNumber
required
string (Phonenumber)
Responses
200

Successful Response

Response Schema: application/json
phoneNumber
required
string (Phonenumber)
campaignId
required
string (Campaignid)
createdAt
required
string <date-time> (Createdat)
updatedAt
required
string <date-time> (Updatedat)
get/phoneNumberCampaign/{phoneNumber}
Request samples
# install http://docs.python-requests.org/en/master/
import requests

url = 'https://api.telnyx.com/10dlc/phoneNumberCampaign/{phoneNumber}'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json', 
  'Authorization': 'Bearer API_TOKEN'
}
response = requests.request('get', url, headers=headers)
print(response.text)
Response samples
application/json
{
  • "phoneNumber": "string",
  • "campaignId": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Update Phone Number Campaign

This endpoint allows you to assign a different campaign to a supplied phoneNumber.

SecuritybearerAuth
Request
path Parameters
phoneNumber
required
string (Phonenumber)
Request Body schema: application/json
required
campaignId
required
string (Campaignid)
Responses
200

Successful Response

Response Schema: application/json
phoneNumber
required
string (Phonenumber)
campaignId
required
string (Campaignid)
createdAt
required
string <date-time> (Createdat)
updatedAt
required
string <date-time> (Updatedat)
put/phoneNumberCampaign/{phoneNumber}
Request samples
application/json
{
  • "campaignId": "string"
}
Response samples
application/json
{
  • "phoneNumber": "string",
  • "campaignId": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Delete Phone Number Campaign

This endpoint allows you to remove a campaign assignment from the supplied phoneNumber.

SecuritybearerAuth
Request
path Parameters
phoneNumber
required
any (Phonenumber)
Responses
200

Successful Response

Response Schema: application/json
phoneNumber
required
string (Phonenumber)
campaignId
required
string (Campaignid)
createdAt
required
string <date-time> (Createdat)
updatedAt
required
string <date-time> (Updatedat)
delete/phoneNumberCampaign/{phoneNumber}
Request samples
# install http://docs.python-requests.org/en/master/
import requests

url = 'https://api.telnyx.com/10dlc/phoneNumberCampaign/{phoneNumber}'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json', 
  'Authorization': 'Bearer API_TOKEN'
}
response = requests.request('delete', url, headers=headers)
print(response.text)
Response samples
application/json
{
  • "phoneNumber": "string",
  • "campaignId": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}