0

Get global theme

by
Published Oct 17, 2025

Returns the globally assigned theme. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: None

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 global theme
9
 * Returns the globally assigned theme.
10

11
**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: None
12
 */
13
export async function main(auth: Confluence) {
14
	const url = new URL(`https://${auth.domain}/wiki/rest/api/settings/theme/selected`)
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.json()
28
}
29