0

Create Brand

by
Published Apr 8, 2025

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.

Script telnyx Verified

The script

Submitted by hugo697 Bun
Verified 428 days ago
1
//native
2
type Telnyx = {
3
	apiKey: string
4
}
5
/**
6
 * Create Brand
7
 * 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.
8
 */
9
export async function main(
10
	auth: Telnyx,
11
	body: {
12
		entityType: 'PRIVATE_PROFIT' | 'PUBLIC_PROFIT' | 'NON_PROFIT' | 'SOLE_PROPRIETOR' | 'GOVERNMENT'
13
		displayName: string
14
		companyName?: string
15
		firstName?: string
16
		lastName?: string
17
		ein?: string
18
		phone?: string
19
		street?: string
20
		city?: string
21
		state?: string
22
		postalCode?: string
23
		country: string
24
		email: string
25
		stockSymbol?: string
26
		stockExchange?:
27
			| 'NONE'
28
			| 'NASDAQ'
29
			| 'NYSE'
30
			| 'AMEX'
31
			| 'AMX'
32
			| 'ASX'
33
			| 'B3'
34
			| 'BME'
35
			| 'BSE'
36
			| 'FRA'
37
			| 'ICEX'
38
			| 'JPX'
39
			| 'JSE'
40
			| 'KRX'
41
			| 'LON'
42
			| 'NSE'
43
			| 'OMX'
44
			| 'SEHK'
45
			| 'SSE'
46
			| 'STO'
47
			| 'SWX'
48
			| 'SZSE'
49
			| 'TSX'
50
			| 'TWSE'
51
			| 'VSE'
52
		ipAddress?: string
53
		website?: string
54
		vertical:
55
			| 'GOVERNMENT'
56
			| 'REAL_ESTATE'
57
			| 'HEALTHCARE'
58
			| 'ENERGY'
59
			| 'ENTERTAINMENT'
60
			| 'RETAIL'
61
			| 'AGRICULTURE'
62
			| 'INSURANCE'
63
			| 'EDUCATION'
64
			| 'HOSPITALITY'
65
			| 'FINANCIAL'
66
			| 'GAMBLING'
67
			| 'CONSTRUCTION'
68
			| 'NGO'
69
			| 'MANUFACTURING'
70
			| 'TECHNOLOGY'
71
			| 'COMMUNICATION'
72
		isReseller?: false | true
73
		mock?: false | true
74
		mobilePhone?: string
75
		businessContactEmail?: string
76
		webhookURL?: string
77
		webhookFailoverURL?: string
78
	}
79
) {
80
	const url = new URL(`https://api.telnyx.com/v2/brand`)
81

82
	const response = await fetch(url, {
83
		method: 'POST',
84
		headers: {
85
			'Content-Type': 'application/json',
86
			Authorization: 'Bearer ' + auth.apiKey
87
		},
88
		body: JSON.stringify(body)
89
	})
90
	if (!response.ok) {
91
		const text = await response.text()
92
		throw new Error(`${response.status} ${text}`)
93
	}
94
	return await response.json()
95
}
96