//native
type Telnyx = {
apiKey: string
}
/**
* Create Brand
* This endpoint is used to create a new brand. A brand is an entity created by The Campaign Registry (TCR) that represents an organization or a company. It is this entity that TCR created campaigns will be associated with. Each brand creation will entail an upfront, non-refundable $4 expense.
*/
export async function main(
auth: Telnyx,
body: {
entityType: 'PRIVATE_PROFIT' | 'PUBLIC_PROFIT' | 'NON_PROFIT' | 'SOLE_PROPRIETOR' | 'GOVERNMENT'
displayName: string
companyName?: string
firstName?: string
lastName?: string
ein?: string
phone?: string
street?: string
city?: string
state?: string
postalCode?: string
country: string
email: string
stockSymbol?: string
stockExchange?:
| 'NONE'
| 'NASDAQ'
| 'NYSE'
| 'AMEX'
| 'AMX'
| 'ASX'
| 'B3'
| 'BME'
| 'BSE'
| 'FRA'
| 'ICEX'
| 'JPX'
| 'JSE'
| 'KRX'
| 'LON'
| 'NSE'
| 'OMX'
| 'SEHK'
| 'SSE'
| 'STO'
| 'SWX'
| 'SZSE'
| 'TSX'
| 'TWSE'
| 'VSE'
ipAddress?: string
website?: string
vertical:
| 'GOVERNMENT'
| 'REAL_ESTATE'
| 'HEALTHCARE'
| 'ENERGY'
| 'ENTERTAINMENT'
| 'RETAIL'
| 'AGRICULTURE'
| 'INSURANCE'
| 'EDUCATION'
| 'HOSPITALITY'
| 'FINANCIAL'
| 'GAMBLING'
| 'CONSTRUCTION'
| 'NGO'
| 'MANUFACTURING'
| 'TECHNOLOGY'
| 'COMMUNICATION'
isReseller?: false | true
mock?: false | true
mobilePhone?: string
businessContactEmail?: string
webhookURL?: string
webhookFailoverURL?: string
}
) {
const url = new URL(`https://api.telnyx.com/v2/brand`)
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + auth.apiKey
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 428 days ago