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

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

const campaignBuilder = await client.campaignBuilder.create({
  brandId: 'brandId',
  description: 'description',
  usecase: 'usecase',
});

console.log(campaignBuilder);
{}

Authorizations

Authorization
string
header
required

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

Body

application/json

CampaignRequest object describes the campaign to be submitted via '/campaignBuilder/brand/{brandId}/usecase/{usecase}' operation. It is also used in operations for retrieving status of campaign request and for updating a pending request.

brandId
string
required

Alphanumeric identifier of the brand associated with this campaign.

description
string
required

Summary description of this campaign.

usecase
string
required

Campaign usecase. Must be of defined valid types. Use /registry/enum/usecase operation to retrieve usecases available for given brand.

ageGated
boolean

Age gated message content in campaign.

autoRenewal
boolean

Campaign subscription auto-renewal option. If set to true, then campaign will automatically renewal at end of billing cycle.

directLending
boolean

Direct lending or loan arrangement

Does message generated by the campaign include URL link in SMS?

embeddedPhone
boolean

Does message generated by the campaign include phone number in SMS?

helpKeywords
string

Subscriber help keywords. Multiple keywords are comma separated without space.

helpMessage
string

Help message of the campaign.

messageFlow
string

Message flow description.

mnoIds
integer[]

Submit campaign to given list of MNOs by MNO's network ID. Default is all MNOs if no value provided.

numberPool
boolean

Does campaign utilize pool of phone numbers?

optinKeywords
string

Subscriber opt-in keywords. Multiple keywords are comma separated without space.

optinMessage
string

Subscriber opt-in message.

optoutKeywords
string

Subscriber opt-out keywords. Multiple keywords are comma separated without space.

optoutMessage
string

Subscriber opt-out message.

referenceId
string

Caller supplied campaign reference ID. If supplied, the value must be unique across all submitted campaigns. Can be used to prevent duplicate campaign registrations.

resellerId
string

Alphanumeric identifier of the reseller that you want to associate with this campaign.

sample1
string

Message sample. Some campaign tiers require 1 or more message samples.

sample2
string

Message sample. Some campaign tiers require 2 or more message samples.

sample3
string

Message sample. Some campaign tiers require 3 or more message samples.

sample4
string

Message sample. Some campaign tiers require 4 or more message samples.

sample5
string

Message sample. Some campaign tiers require 5 or more message samples.

subUsecases
string[]

Campaign sub-usecases. Must be of defined valid sub-usecase types. Use /registry/enum/usecase operation to retrieve list of valid sub-usecases

subscriberHelp
boolean

Does campaign responds to help keyword(s)?

subscriberOptin
boolean

Does campaign require subscriber to opt-in before SMS is sent to subscriber?

subscriberOptout
boolean

Does campaign support subscriber opt-out keyword(s)?

tag
string[]

Tags to be set on the Campaign.

termsAndConditions
boolean

Is terms and conditions accepted?

Link to the campaign's privacy policy.

Link to the campaign's terms and conditions.

Sample of an embedded link that will be sent to subscribers.

webhookURL
string

Webhook to which campaign status updates are sent.

Example:

"https://webhook.com/67ea78a8-9f32-4d04-b62d-f9502e8e5f93"

webhookFailoverURL
string

Failover webhook to which campaign status updates are sent.

Example:

"https://webhook.com/93711262-23e5-4048-a966-c0b2a16d5963"

Response

Successful Response

  • Response Submit Campaign Public Campaignbuilder Post
  • TelnyxCampaign_CSP

The response is of type object.