0

Retrieve an integration for an organization

by
Published Oct 17, 2025

OrganizationIntegrationBaseEndpoints expect both Integration and OrganizationIntegration DB entries to exist for a given organization and integration_id.

Script sentry Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Retrieve an integration for an organization
4
 * OrganizationIntegrationBaseEndpoints expect both Integration and
5
OrganizationIntegration DB entries to exist for a given organization and
6
integration_id.
7
 */
8
export async function main(auth: RT.Sentry, integration_id: string) {
9
	const url = new URL(
10
		`https://${auth.region}.sentry.io/api/0/organizations/${auth.organizationSlug}/integrations/${integration_id}/`
11
	)
12

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