0

Delete Goal Comment

by
Published Oct 17, 2025

Delete a goal comment.

Script bamboo_hr Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Delete Goal Comment
4
 * Delete a goal comment.
5
 */
6
export async function main(
7
	auth: RT.BambooHr,
8
	employeeId: string,
9
	goalId: string,
10
	commentId: string
11
) {
12
	const url = new URL(
13
		`https://${auth.companyDomain}.bamboohr.com/api/v1/performance/employees/${employeeId}/goals/${goalId}/comments/${commentId}`
14
	)
15

16
	const response = await fetch(url, {
17
		method: 'DELETE',
18
		headers: {
19
			Authorization: 'Basic ' + btoa(`${auth.apiKey}:x`)
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.json()
28
}
29