0

Delete a project releases file

by
Published Oct 17, 2025

Delete a file for a given release.

Script sentry Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Delete a project releases file
4
 * Delete a file for a given release.
5
 */
6
export async function main(
7
	auth: RT.Sentry,
8
	project_id_or_slug: string,
9
	version: string,
10
	file_id: string
11
) {
12
	const url = new URL(
13
		`https://${auth.region}.sentry.io/api/0/projects/${auth.organizationSlug}/${project_id_or_slug}/releases/${version}/files/${file_id}/`
14
	)
15

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