0

Delete an organizations custom dashboard

by
Published Oct 17, 2025

Delete an organization's custom dashboard, or tombstone a pre-built dashboard which effectively deletes it.

Script sentry Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Delete an organizations custom dashboard
4
 * Delete an organization's custom dashboard, or tombstone
5
a pre-built dashboard which effectively deletes it.
6
 */
7
export async function main(auth: RT.Sentry, dashboard_id: string) {
8
	const url = new URL(
9
		`https://${auth.region}.sentry.io/api/0/organizations/${auth.organizationSlug}/dashboards/${dashboard_id}/`
10
	)
11

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