0

Delete a Custom Domain

by
Published Oct 17, 2025

To delete an CustomDomain you must have the project user permission

Script qovery Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Delete a Custom Domain
4
 * To delete an CustomDomain you must have the project user permission
5
 */
6
export async function main(auth: RT.Qovery, helmId: string, customDomainId: string) {
7
	const url = new URL(`https://api.qovery.com/helm/${helmId}/customDomain/${customDomainId}`)
8

9
	const response = await fetch(url, {
10
		method: 'DELETE',
11
		headers: {
12
			Authorization: 'Token ' + auth.apiKey
13
		},
14
		body: undefined
15
	})
16
	if (!response.ok) {
17
		const text = await response.text()
18
		throw new Error(`${response.status} ${text}`)
19
	}
20
	return await response.text()
21
}
22