0

Retrieve a spike protection notification action

by
Published Oct 17, 2025

Returns a serialized Spike Protection Notification Action object. Notification Actions notify a set of members when an action has been triggered through a notification service such as Slack or Sentry. For example, organization owners and managers can receive an email when a spike occurs.

Script sentry Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Retrieve a spike protection notification action
4
 * Returns a serialized Spike Protection Notification Action object.
5

6
Notification Actions notify a set of members when an action has been triggered through a notification service such as Slack or Sentry.
7
For example, organization owners and managers can receive an email when a spike occurs.
8
 */
9
export async function main(auth: RT.Sentry, action_id: string) {
10
	const url = new URL(
11
		`https://${auth.region}.sentry.io/api/0/organizations/${auth.organizationSlug}/notifications/actions/${action_id}/`
12
	)
13

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