0

Update Group

by
Published Oct 17, 2025

Use this method to modify a log group. You can change the name of the group and the access scope that defines the data that is accessible by members in that group.

Script mezmo Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Update Group
4
 * Use this method to modify a log group. You can change the name of the group and the access scope that defines the data that is accessible by members in that group.
5
 */
6
export async function main(auth: RT.Mezmo, groupId: string, servicekey: string, body: Body) {
7
	const url = new URL(`https://api.mezmo.com/v1/config/groups/${groupId}`)
8

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

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

32
export interface Body {
33
	/**
34
	 * Name of a log group.
35
	 */
36
	name?: string
37
	/**
38
	 * Query that determines the data that is visible to members of a group.
39
	 */
40
	accessScopes?: string
41
	[k: string]: unknown
42
}
43