Skip to main content
POST
/
phoneNumberAssignmentByProfile
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: 'My API Key',
});

const response = await client.phoneNumberAssignmentByProfile.assign({
  messagingProfileId: '4001767e-ce0f-4cae-9d5f-0d5e636e7809',
});

console.log(response);
{
  "messagingProfileId": "4001767e-ce0f-4cae-9d5f-0d5e636e7809",
  "taskId": "667a80f8-b0a9-49d0-b9ab-a7a1bcc45086",
  "tcrCampaignId": "CWZTFH1",
  "campaignId": "4b300178-131c-d902-d54e-72d90ba1620j"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
messagingProfileId
string
required

The ID of the messaging profile that you want to link to the specified campaign.

Example:

"4001767e-ce0f-4cae-9d5f-0d5e636e7809"

tcrCampaignId
string

The TCR ID of the shared campaign you want to link to the specified messaging profile (for campaigns not created using Telnyx 10DLC services only). If you supply this ID in the request, do not also include a campaignId.

Example:

"CWZTFH1"

campaignId
string

The ID of the campaign you want to link to the specified messaging profile. If you supply this ID in the request, do not also include a tcrCampaignId.

Example:

"4b300178-131c-d902-d54e-72d90ba1620j"

Response

Successful Response

  • AssignProfileToCampaignResponse
  • SettingsDataErrorMessage
messagingProfileId
string
required

The ID of the messaging profile that you want to link to the specified campaign.

Example:

"4001767e-ce0f-4cae-9d5f-0d5e636e7809"

taskId
string
required

The ID of the task associated with assigning a messaging profile to a campaign.

Example:

"667a80f8-b0a9-49d0-b9ab-a7a1bcc45086"

tcrCampaignId
string

The TCR ID of the shared campaign you want to link to the specified messaging profile (for campaigns not created using Telnyx 10DLC services only). If you supply this ID in the request, do not also include a campaignId.

Example:

"CWZTFH1"

campaignId
string

The ID of the campaign you want to link to the specified messaging profile. If you supply this ID in the request, do not also include a tcrCampaignId.

Example:

"4b300178-131c-d902-d54e-72d90ba1620j"