0

Update a team

by
Published Oct 17, 2025

Update various attributes and configurable settings for the given team.

Script sentry Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Update a team
4
 * Update various attributes and configurable settings for the given
5
team.
6
 */
7
export async function main(auth: RT.Sentry, team_id_or_slug: string, body: Body) {
8
	const url = new URL(
9
		`https://${auth.region}.sentry.io/api/0/teams/${auth.organizationSlug}/${team_id_or_slug}/`
10
	)
11

12
	const response = await fetch(url, {
13
		method: 'PUT',
14
		headers: {
15
			'Content-Type': 'application/json',
16
			Authorization: 'Bearer ' + auth.token
17
		},
18
		body: JSON.stringify(body)
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

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

34
/**
35
 * Allows parameters to be defined in snake case, but passed as camel case.
36
 *
37
 * Errors are output in camel case.
38
 */
39
export interface Body {
40
	/**
41
	 * Uniquely identifies a team. This is must be available.
42
	 */
43
	slug: string
44
	[k: string]: unknown
45
}
46