0

Get theme

by
Published Oct 17, 2025

Returns a theme. This includes information about the theme name, description, and icon. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: None

Script confluence
  • Submitted by hugo697 Bun
    Created 284 days ago
    1
    //native
    2
    type Confluence = {
    3
    	email: string
    4
    	apiToken: string
    5
    	domain: string
    6
    }
    7
    /**
    8
     * Get theme
    9
     * Returns a theme. This includes information about the theme name,
    10
    description, and icon.
    11
    
    
    12
    **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: None
    13
     */
    14
    export async function main(auth: Confluence, themeKey: string) {
    15
    	const url = new URL(`https://${auth.domain}/wiki/rest/api/settings/theme/${themeKey}`)
    16
    
    
    17
    	const response = await fetch(url, {
    18
    		method: 'GET',
    19
    		headers: {
    20
    			Authorization: 'Basic ' + btoa(`${auth.email}:${auth.apiToken}`)
    21
    		},
    22
    		body: undefined
    23
    	})
    24
    	if (!response.ok) {
    25
    		const text = await response.text()
    26
    		throw new Error(`${response.status} ${text}`)
    27
    	}
    28
    	return await response.json()
    29
    }
    30