0

Retrieve an organization member

by
Published Oct 17, 2025

Retrieve an organization member's details. Response will be a pending invite if it has been approved by organization owners or managers but is waiting to be accepted by the invitee.

Script sentry Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Retrieve an organization member
4
 * Retrieve an organization member's details.
5

6
Response will be a pending invite if it has been approved by organization owners or managers but is waiting to be accepted by the invitee.
7
 */
8
export async function main(auth: RT.Sentry, member_id: string) {
9
	const url = new URL(
10
		`https://${auth.region}.sentry.io/api/0/organizations/${auth.organizationSlug}/members/${member_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