0

Update an external team

by
Published Oct 17, 2025

Update a team in an external provider that is currently linked to a Sentry team.

Script sentry Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Update an external team
4
 * Update a team in an external provider that is currently linked to a Sentry team.
5
 */
6
export async function main(
7
	auth: RT.Sentry,
8
	team_id_or_slug: string,
9
	external_team_id: string,
10
	body: Body
11
) {
12
	const url = new URL(
13
		`https://${auth.region}.sentry.io/api/0/teams/${auth.organizationSlug}/${team_id_or_slug}/external-teams/${external_team_id}/`
14
	)
15

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

31
/* eslint-disable */
32
/**
33
 * This file was automatically generated by json-schema-to-typescript.
34
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
35
 * and run json-schema-to-typescript to regenerate this file.
36
 */
37

38
/**
39
 * Allows parameters to be defined in snake case, but passed as camel case.
40
 *
41
 * Errors are output in camel case.
42
 */
43
export interface Body {
44
	/**
45
	 * The associated name for the provider.
46
	 */
47
	external_name: string
48
	/**
49
	 * The provider of the external actor.
50
	 *
51
	 * * `github`
52
	 * * `github_enterprise`
53
	 * * `jira_server`
54
	 * * `slack`
55
	 * * `gitlab`
56
	 * * `msteams`
57
	 * * `custom_scm`
58
	 */
59
	provider:
60
		| 'github'
61
		| 'github_enterprise'
62
		| 'jira_server'
63
		| 'slack'
64
		| 'gitlab'
65
		| 'msteams'
66
		| 'custom_scm'
67
	/**
68
	 * The Integration ID.
69
	 */
70
	integration_id: number
71
	/**
72
	 * The associated user ID for provider.
73
	 */
74
	external_id?: string
75
	[k: string]: unknown
76
}
77