0

Update an existing custom integration

by
Published Oct 17, 2025

Update an existing custom integration.

Script sentry Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Update an existing custom integration
4
 * Update an existing custom integration.
5
 */
6
export async function main(auth: RT.Sentry, sentry_app_id_or_slug: string, body: Body) {
7
	const url = new URL(
8
		`https://${auth.region}.sentry.io/api/0/sentry-apps/${sentry_app_id_or_slug}/`
9
	)
10

11
	const response = await fetch(url, {
12
		method: 'PUT',
13
		headers: {
14
			'Content-Type': 'application/json',
15
			Authorization: 'Bearer ' + auth.token
16
		},
17
		body: JSON.stringify(body)
18
	})
19
	if (!response.ok) {
20
		const text = await response.text()
21
		throw new Error(`${response.status} ${text}`)
22
	}
23
	return await response.json()
24
}
25

26
/* eslint-disable */
27
/**
28
 * This file was automatically generated by json-schema-to-typescript.
29
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
30
 * and run json-schema-to-typescript to regenerate this file.
31
 */
32

33
export interface Body {
34
	/**
35
	 * The name of the custom integration.
36
	 */
37
	name: string
38
	/**
39
	 * The custom integration's permission scopes for API access.
40
	 */
41
	scopes: string[]
42
	/**
43
	 * The custom integration's author.
44
	 */
45
	author?: string
46
	/**
47
	 * Webhook events the custom integration is subscribed to.
48
	 */
49
	events?: string[]
50
	/**
51
	 * The UI components schema, used to render the custom integration's configuration UI elements. See our [schema docs](https://docs.sentry.io/organization/integrations/integration-platform/ui-components/) for more information.
52
	 */
53
	schema?: {
54
		[k: string]: unknown
55
	}
56
	/**
57
	 * The webhook destination URL.
58
	 */
59
	webhookUrl?: string
60
	/**
61
	 * The post-installation redirect URL.
62
	 */
63
	redirectUrl?: string
64
	/**
65
	 * Whether or not the integration is internal only. False means the integration is public.
66
	 */
67
	isInternal?: boolean
68
	/**
69
	 * Marks whether or not the custom integration can be used in an alert rule.
70
	 */
71
	isAlertable?: boolean
72
	/**
73
	 * The custom integration's description.
74
	 */
75
	overview?: string
76
	/**
77
	 * Whether or not an installation of the custom integration should be verified.
78
	 */
79
	verifyInstall?: boolean
80
	/**
81
	 * The list of allowed origins for CORS.
82
	 */
83
	allowedOrigins?: string[]
84
	[k: string]: unknown
85
}
86