0

Get modules

by
Published Oct 17, 2025

Returns all modules registered dynamically by the calling app. **[Permissions](#permissions) required:** Only Connect apps can make this request.

Script confluence Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Confluence = {
3
	email: string
4
	apiToken: string
5
	domain: string
6
}
7
/**
8
 * Get modules
9
 * Returns all modules registered dynamically by the calling app.
10

11
**[Permissions](#permissions) required:** Only Connect apps can make this request.
12
 */
13
export async function main(auth: Confluence) {
14
	const url = new URL(`https://${auth.domain}/atlassian-connect/1/app/module/dynamic`)
15

16
	const response = await fetch(url, {
17
		method: 'GET',
18
		headers: {
19
			Authorization: 'Basic ' + btoa(`${auth.email}:${auth.apiToken}`)
20
		},
21
		body: undefined
22
	})
23
	if (!response.ok) {
24
		const text = await response.text()
25
		throw new Error(`${response.status} ${text}`)
26
	}
27
	return await response.text()
28
}
29